Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
74defc57
Commit
74defc57
authored
Aug 24, 2006
by
jonas@perch.ndb.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ndb - fix monster bug in NdbEventOperation->stop where Suma sent uninitialized data
affects basically all replication tests
parent
e16c4317
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
119 additions
and
63 deletions
+119
-63
storage/ndb/include/kernel/signaldata/SumaImpl.hpp
storage/ndb/include/kernel/signaldata/SumaImpl.hpp
+23
-4
storage/ndb/src/common/debugger/signaldata/SumaImpl.cpp
storage/ndb/src/common/debugger/signaldata/SumaImpl.cpp
+2
-2
storage/ndb/src/kernel/blocks/suma/Suma.cpp
storage/ndb/src/kernel/blocks/suma/Suma.cpp
+36
-18
storage/ndb/src/ndbapi/NdbBlob.cpp
storage/ndb/src/ndbapi/NdbBlob.cpp
+2
-1
storage/ndb/src/ndbapi/NdbEventOperation.cpp
storage/ndb/src/ndbapi/NdbEventOperation.cpp
+2
-2
storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp
storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp
+47
-32
storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp
storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp
+2
-1
storage/ndb/src/ndbapi/Ndbif.cpp
storage/ndb/src/ndbapi/Ndbif.cpp
+5
-3
No files found.
storage/ndb/include/kernel/signaldata/SumaImpl.hpp
View file @
74defc57
...
@@ -302,13 +302,32 @@ struct SubTableData {
...
@@ -302,13 +302,32 @@ struct SubTableData {
Uint32
senderData
;
Uint32
senderData
;
Uint32
gci
;
Uint32
gci
;
Uint32
tableId
;
Uint32
tableId
;
Uint8
operation
;
Uint32
requestInfo
;
Uint8
req_nodeid
;
Uint8
ndbd_nodeid
;
Uint8
not_used3
;
Uint32
logType
;
Uint32
logType
;
Uint32
changeMask
;
Uint32
changeMask
;
Uint32
totalLen
;
Uint32
totalLen
;
static
void
setOperation
(
Uint32
&
ri
,
Uint32
val
)
{
ri
=
(
ri
&
0xFFFFFF00
)
|
val
;
}
static
void
setReqNodeId
(
Uint32
&
ri
,
Uint32
val
)
{
ri
=
(
ri
&
0xFFFF00FF
)
|
(
val
<<
8
);
}
static
void
setNdbdNodeId
(
Uint32
&
ri
,
Uint32
val
)
{
ri
=
(
ri
&
0xFF00FFFF
)
|
(
val
<<
16
);
}
static
Uint32
getOperation
(
const
Uint32
&
ri
){
return
(
ri
&
0xFF
);
}
static
Uint32
getReqNodeId
(
const
Uint32
&
ri
){
return
(
ri
>>
8
)
&
0xFF
;
}
static
Uint32
getNdbdNodeId
(
const
Uint32
&
ri
){
return
(
ri
>>
16
)
&
0xFF
;
}
};
};
struct
SubSyncContinueReq
{
struct
SubSyncContinueReq
{
...
...
storage/ndb/src/common/debugger/signaldata/SumaImpl.cpp
View file @
74defc57
...
@@ -174,10 +174,10 @@ printSUB_TABLE_DATA(FILE * output, const Uint32 * theData,
...
@@ -174,10 +174,10 @@ printSUB_TABLE_DATA(FILE * output, const Uint32 * theData,
Uint32
len
,
Uint16
receiverBlockNo
)
{
Uint32
len
,
Uint16
receiverBlockNo
)
{
const
SubTableData
*
const
sig
=
(
SubTableData
*
)
theData
;
const
SubTableData
*
const
sig
=
(
SubTableData
*
)
theData
;
fprintf
(
output
,
" senderData: %x
\n
"
,
sig
->
senderData
);
fprintf
(
output
,
" senderData: %x
\n
"
,
sig
->
senderData
);
fprintf
(
output
,
" senderData: %x
\n
"
,
sig
->
senderData
);
fprintf
(
output
,
" gci: %x
\n
"
,
sig
->
gci
);
fprintf
(
output
,
" gci: %x
\n
"
,
sig
->
gci
);
fprintf
(
output
,
" tableId: %x
\n
"
,
sig
->
tableId
);
fprintf
(
output
,
" tableId: %x
\n
"
,
sig
->
tableId
);
fprintf
(
output
,
" operation: %x
\n
"
,
sig
->
operation
);
fprintf
(
output
,
" operation: %x
\n
"
,
SubTableData
::
getOperation
(
sig
->
requestInfo
));
return
false
;
return
false
;
}
}
...
...
storage/ndb/src/kernel/blocks/suma/Suma.cpp
View file @
74defc57
...
@@ -2642,12 +2642,16 @@ Suma::sendSubStopComplete(Signal* signal, SubscriberPtr subbPtr)
...
@@ -2642,12 +2642,16 @@ Suma::sendSubStopComplete(Signal* signal, SubscriberPtr subbPtr)
SubTableData
*
data
=
(
SubTableData
*
)
signal
->
getDataPtrSend
();
SubTableData
*
data
=
(
SubTableData
*
)
signal
->
getDataPtrSend
();
data
->
gci
=
m_last_complete_gci
+
1
;
// XXX ???
data
->
gci
=
m_last_complete_gci
+
1
;
// XXX ???
data
->
tableId
=
0
;
data
->
tableId
=
0
;
data
->
operation
=
NdbDictionary
::
Event
::
_TE_STOP
;
data
->
requestInfo
=
0
;
SubTableData
::
setOperation
(
data
->
requestInfo
,
NdbDictionary
::
Event
::
_TE_STOP
);
SubTableData
::
setNdbdNodeId
(
data
->
requestInfo
,
getOwnNodeId
());
data
->
senderData
=
subbPtr
.
p
->
m_senderData
;
data
->
senderData
=
subbPtr
.
p
->
m_senderData
;
sendSignal
(
subbPtr
.
p
->
m_senderRef
,
GSN_SUB_TABLE_DATA
,
signal
,
sendSignal
(
subbPtr
.
p
->
m_senderRef
,
GSN_SUB_TABLE_DATA
,
signal
,
SubTableData
::
SignalLength
,
JBB
);
SubTableData
::
SignalLength
,
JBB
);
}
}
SubStopConf
*
const
conf
=
(
SubStopConf
*
)
signal
->
getDataPtrSend
();
SubStopConf
*
const
conf
=
(
SubStopConf
*
)
signal
->
getDataPtrSend
();
conf
->
senderRef
=
reference
();
conf
->
senderRef
=
reference
();
...
@@ -2681,11 +2685,14 @@ Suma::reportAllSubscribers(Signal *signal,
...
@@ -2681,11 +2685,14 @@ Suma::reportAllSubscribers(Signal *signal,
{
{
data
->
gci
=
m_last_complete_gci
+
1
;
data
->
gci
=
m_last_complete_gci
+
1
;
data
->
tableId
=
subPtr
.
p
->
m_tableId
;
data
->
tableId
=
subPtr
.
p
->
m_tableId
;
data
->
operation
=
NdbDictionary
::
Event
::
_TE_ACTIVE
;
data
->
requestInfo
=
0
;
data
->
ndbd_nodeid
=
refToNode
(
reference
());
SubTableData
::
setOperation
(
data
->
requestInfo
,
NdbDictionary
::
Event
::
_TE_ACTIVE
);
SubTableData
::
setNdbdNodeId
(
data
->
requestInfo
,
getOwnNodeId
());
SubTableData
::
setReqNodeId
(
data
->
requestInfo
,
refToNode
(
subbPtr
.
p
->
m_senderRef
));
data
->
changeMask
=
0
;
data
->
changeMask
=
0
;
data
->
totalLen
=
0
;
data
->
totalLen
=
0
;
data
->
req_nodeid
=
refToNode
(
subbPtr
.
p
->
m_senderRef
);
data
->
senderData
=
subbPtr
.
p
->
m_senderData
;
data
->
senderData
=
subbPtr
.
p
->
m_senderData
;
sendSignal
(
subbPtr
.
p
->
m_senderRef
,
GSN_SUB_TABLE_DATA
,
signal
,
sendSignal
(
subbPtr
.
p
->
m_senderRef
,
GSN_SUB_TABLE_DATA
,
signal
,
SubTableData
::
SignalLength
,
JBB
);
SubTableData
::
SignalLength
,
JBB
);
...
@@ -2707,8 +2714,9 @@ Suma::reportAllSubscribers(Signal *signal,
...
@@ -2707,8 +2714,9 @@ Suma::reportAllSubscribers(Signal *signal,
//#endif
//#endif
data
->
gci
=
m_last_complete_gci
+
1
;
data
->
gci
=
m_last_complete_gci
+
1
;
data
->
tableId
=
subPtr
.
p
->
m_tableId
;
data
->
tableId
=
subPtr
.
p
->
m_tableId
;
data
->
operation
=
table_event
;
data
->
requestInfo
=
0
;
data
->
ndbd_nodeid
=
refToNode
(
reference
());
SubTableData
::
setOperation
(
data
->
requestInfo
,
table_event
);
SubTableData
::
setNdbdNodeId
(
data
->
requestInfo
,
getOwnNodeId
());
data
->
changeMask
=
0
;
data
->
changeMask
=
0
;
data
->
totalLen
=
0
;
data
->
totalLen
=
0
;
...
@@ -2720,7 +2728,8 @@ Suma::reportAllSubscribers(Signal *signal,
...
@@ -2720,7 +2728,8 @@ Suma::reportAllSubscribers(Signal *signal,
{
{
if
(
i_subbPtr
.
p
->
m_subPtrI
==
subPtr
.
i
)
if
(
i_subbPtr
.
p
->
m_subPtrI
==
subPtr
.
i
)
{
{
data
->
req_nodeid
=
refToNode
(
subbPtr
.
p
->
m_senderRef
);
SubTableData
::
setReqNodeId
(
data
->
requestInfo
,
refToNode
(
subbPtr
.
p
->
m_senderRef
));
data
->
senderData
=
i_subbPtr
.
p
->
m_senderData
;
data
->
senderData
=
i_subbPtr
.
p
->
m_senderData
;
sendSignal
(
i_subbPtr
.
p
->
m_senderRef
,
GSN_SUB_TABLE_DATA
,
signal
,
sendSignal
(
i_subbPtr
.
p
->
m_senderRef
,
GSN_SUB_TABLE_DATA
,
signal
,
SubTableData
::
SignalLength
,
JBB
);
SubTableData
::
SignalLength
,
JBB
);
...
@@ -2729,12 +2738,14 @@ Suma::reportAllSubscribers(Signal *signal,
...
@@ -2729,12 +2738,14 @@ Suma::reportAllSubscribers(Signal *signal,
table_event
==
NdbDictionary
::
Event
::
_TE_SUBSCRIBE
?
table_event
==
NdbDictionary
::
Event
::
_TE_SUBSCRIBE
?
"SUBSCRIBE"
:
"UNSUBSCRIBE"
,
(
int
)
table_event
,
"SUBSCRIBE"
:
"UNSUBSCRIBE"
,
(
int
)
table_event
,
refToNode
(
i_subbPtr
.
p
->
m_senderRef
),
refToNode
(
i_subbPtr
.
p
->
m_senderRef
),
data
->
req_nodeid
,
data
->
senderData
refToNode
(
subbPtr
.
p
->
m_senderRef
)
,
data
->
senderData
);
);
//#endif
//#endif
if
(
i_subbPtr
.
i
!=
subbPtr
.
i
)
if
(
i_subbPtr
.
i
!=
subbPtr
.
i
)
{
{
data
->
req_nodeid
=
refToNode
(
i_subbPtr
.
p
->
m_senderRef
);
SubTableData
::
setReqNodeId
(
data
->
requestInfo
,
refToNode
(
i_subbPtr
.
p
->
m_senderRef
));
data
->
senderData
=
subbPtr
.
p
->
m_senderData
;
data
->
senderData
=
subbPtr
.
p
->
m_senderData
;
sendSignal
(
subbPtr
.
p
->
m_senderRef
,
GSN_SUB_TABLE_DATA
,
signal
,
sendSignal
(
subbPtr
.
p
->
m_senderRef
,
GSN_SUB_TABLE_DATA
,
signal
,
SubTableData
::
SignalLength
,
JBB
);
SubTableData
::
SignalLength
,
JBB
);
...
@@ -2743,7 +2754,7 @@ Suma::reportAllSubscribers(Signal *signal,
...
@@ -2743,7 +2754,7 @@ Suma::reportAllSubscribers(Signal *signal,
table_event
==
NdbDictionary
::
Event
::
_TE_SUBSCRIBE
?
table_event
==
NdbDictionary
::
Event
::
_TE_SUBSCRIBE
?
"SUBSCRIBE"
:
"UNSUBSCRIBE"
,
(
int
)
table_event
,
"SUBSCRIBE"
:
"UNSUBSCRIBE"
,
(
int
)
table_event
,
refToNode
(
subbPtr
.
p
->
m_senderRef
),
refToNode
(
subbPtr
.
p
->
m_senderRef
),
data
->
req_nodeid
,
data
->
senderData
refToNode
(
i_subbPtr
.
p
->
m_senderRef
)
,
data
->
senderData
);
);
//#endif
//#endif
}
}
...
@@ -3146,7 +3157,9 @@ Suma::execTRANSID_AI(Signal* signal)
...
@@ -3146,7 +3157,9 @@ Suma::execTRANSID_AI(Signal* signal)
Uint32
ref
=
subPtr
.
p
->
m_senderRef
;
Uint32
ref
=
subPtr
.
p
->
m_senderRef
;
sdata
->
tableId
=
syncPtr
.
p
->
m_currentTableId
;
sdata
->
tableId
=
syncPtr
.
p
->
m_currentTableId
;
sdata
->
senderData
=
subPtr
.
p
->
m_senderData
;
sdata
->
senderData
=
subPtr
.
p
->
m_senderData
;
sdata
->
operation
=
NdbDictionary
::
Event
::
_TE_SCAN
;
// Scan
sdata
->
requestInfo
=
0
;
SubTableData
::
setOperation
(
sdata
->
requestInfo
,
NdbDictionary
::
Event
::
_TE_SCAN
);
// Scan
sdata
->
gci
=
0
;
// Undefined
sdata
->
gci
=
0
;
// Undefined
#if PRINT_ONLY
#if PRINT_ONLY
ndbout_c
(
"GSN_SUB_TABLE_DATA (scan) #attr: %d len: %d"
,
attribs
,
sum
);
ndbout_c
(
"GSN_SUB_TABLE_DATA (scan) #attr: %d len: %d"
,
attribs
,
sum
);
...
@@ -3362,7 +3375,8 @@ Suma::execFIRE_TRIG_ORD(Signal* signal)
...
@@ -3362,7 +3375,8 @@ Suma::execFIRE_TRIG_ORD(Signal* signal)
SubTableData
*
data
=
(
SubTableData
*
)
signal
->
getDataPtrSend
();
//trg;
SubTableData
*
data
=
(
SubTableData
*
)
signal
->
getDataPtrSend
();
//trg;
data
->
gci
=
gci
;
data
->
gci
=
gci
;
data
->
tableId
=
tabPtr
.
p
->
m_tableId
;
data
->
tableId
=
tabPtr
.
p
->
m_tableId
;
data
->
operation
=
event
;
data
->
requestInfo
=
0
;
SubTableData
::
setOperation
(
data
->
requestInfo
,
event
);
data
->
logType
=
0
;
data
->
logType
=
0
;
data
->
changeMask
=
0
;
data
->
changeMask
=
0
;
data
->
totalLen
=
ptrLen
;
data
->
totalLen
=
ptrLen
;
...
@@ -3588,8 +3602,9 @@ Suma::execDROP_TAB_CONF(Signal *signal)
...
@@ -3588,8 +3602,9 @@ Suma::execDROP_TAB_CONF(Signal *signal)
SubTableData
*
data
=
(
SubTableData
*
)
signal
->
getDataPtrSend
();
SubTableData
*
data
=
(
SubTableData
*
)
signal
->
getDataPtrSend
();
data
->
gci
=
m_last_complete_gci
+
1
;
data
->
gci
=
m_last_complete_gci
+
1
;
data
->
tableId
=
tableId
;
data
->
tableId
=
tableId
;
data
->
operation
=
NdbDictionary
::
Event
::
_TE_DROP
;
data
->
requestInfo
=
0
;
data
->
req_nodeid
=
refToNode
(
senderRef
);
SubTableData
::
setOperation
(
data
->
requestInfo
,
NdbDictionary
::
Event
::
_TE_DROP
);
SubTableData
::
setReqNodeId
(
data
->
requestInfo
,
refToNode
(
senderRef
));
{
{
LocalDLList
<
Subscriber
>
subbs
(
c_subscriberPool
,
tabPtr
.
p
->
c_subscribers
);
LocalDLList
<
Subscriber
>
subbs
(
c_subscriberPool
,
tabPtr
.
p
->
c_subscribers
);
...
@@ -3667,8 +3682,10 @@ Suma::execALTER_TAB_REQ(Signal *signal)
...
@@ -3667,8 +3682,10 @@ Suma::execALTER_TAB_REQ(Signal *signal)
SubTableData
*
data
=
(
SubTableData
*
)
signal
->
getDataPtrSend
();
SubTableData
*
data
=
(
SubTableData
*
)
signal
->
getDataPtrSend
();
data
->
gci
=
m_last_complete_gci
+
1
;
data
->
gci
=
m_last_complete_gci
+
1
;
data
->
tableId
=
tableId
;
data
->
tableId
=
tableId
;
data
->
operation
=
NdbDictionary
::
Event
::
_TE_ALTER
;
data
->
requestInfo
=
0
;
data
->
req_nodeid
=
refToNode
(
senderRef
);
SubTableData
::
setOperation
(
data
->
requestInfo
,
NdbDictionary
::
Event
::
_TE_ALTER
);
SubTableData
::
setReqNodeId
(
data
->
requestInfo
,
refToNode
(
senderRef
));
data
->
logType
=
0
;
data
->
logType
=
0
;
data
->
changeMask
=
changeMask
;
data
->
changeMask
=
changeMask
;
data
->
totalLen
=
tabInfoPtr
.
sz
;
data
->
totalLen
=
tabInfoPtr
.
sz
;
...
@@ -4898,7 +4915,8 @@ Suma::resend_bucket(Signal* signal, Uint32 buck, Uint32 min_gci,
...
@@ -4898,7 +4915,8 @@ Suma::resend_bucket(Signal* signal, Uint32 buck, Uint32 min_gci,
SubTableData
*
data
=
(
SubTableData
*
)
signal
->
getDataPtrSend
();
//trg;
SubTableData
*
data
=
(
SubTableData
*
)
signal
->
getDataPtrSend
();
//trg;
data
->
gci
=
last_gci
;
data
->
gci
=
last_gci
;
data
->
tableId
=
tabPtr
.
p
->
m_tableId
;
data
->
tableId
=
tabPtr
.
p
->
m_tableId
;
data
->
operation
=
event
;
data
->
requestInfo
=
0
;
SubTableData
::
setOperation
(
data
->
requestInfo
,
event
);
data
->
logType
=
0
;
data
->
logType
=
0
;
data
->
changeMask
=
0
;
data
->
changeMask
=
0
;
data
->
totalLen
=
ptrLen
;
data
->
totalLen
=
ptrLen
;
...
...
storage/ndb/src/ndbapi/NdbBlob.cpp
View file @
74defc57
...
@@ -1894,7 +1894,8 @@ int
...
@@ -1894,7 +1894,8 @@ int
NdbBlob
::
atNextEvent
()
NdbBlob
::
atNextEvent
()
{
{
DBUG_ENTER
(
"NdbBlob::atNextEvent"
);
DBUG_ENTER
(
"NdbBlob::atNextEvent"
);
Uint32
optype
=
theEventOp
->
m_data_item
->
sdata
->
operation
;
Uint32
optype
=
SubTableData
::
getOperation
(
theEventOp
->
m_data_item
->
sdata
->
requestInfo
);
DBUG_PRINT
(
"info"
,
(
"this=%p op=%p blob op=%p version=%d optype=%u"
,
this
,
theEventOp
,
theBlobEventOp
,
theEventBlobVersion
,
optype
));
DBUG_PRINT
(
"info"
,
(
"this=%p op=%p blob op=%p version=%d optype=%u"
,
this
,
theEventOp
,
theBlobEventOp
,
theEventBlobVersion
,
optype
));
if
(
theState
==
Invalid
)
if
(
theState
==
Invalid
)
DBUG_RETURN
(
-
1
);
DBUG_RETURN
(
-
1
);
...
...
storage/ndb/src/ndbapi/NdbEventOperation.cpp
View file @
74defc57
...
@@ -192,12 +192,12 @@ void * NdbEventOperation::getCustomData() const
...
@@ -192,12 +192,12 @@ void * NdbEventOperation::getCustomData() const
int
NdbEventOperation
::
getReqNodeId
()
const
int
NdbEventOperation
::
getReqNodeId
()
const
{
{
return
m_impl
.
m_data_item
->
sdata
->
req_nodeid
;
return
SubTableData
::
getReqNodeId
(
m_impl
.
m_data_item
->
sdata
->
requestInfo
)
;
}
}
int
NdbEventOperation
::
getNdbdNodeId
()
const
int
NdbEventOperation
::
getNdbdNodeId
()
const
{
{
return
m_impl
.
m_data_item
->
sdata
->
ndbd_nodeid
;
return
SubTableData
::
getNdbdNodeId
(
m_impl
.
m_data_item
->
sdata
->
requestInfo
)
;
}
}
/*
/*
...
...
storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp
View file @
74defc57
...
@@ -54,7 +54,8 @@ static const Uint32 ACTIVE_GCI_MASK = ACTIVE_GCI_DIRECTORY_SIZE - 1;
...
@@ -54,7 +54,8 @@ static const Uint32 ACTIVE_GCI_MASK = ACTIVE_GCI_DIRECTORY_SIZE - 1;
static
void
static
void
print_std
(
const
SubTableData
*
sdata
,
LinearSectionPtr
ptr
[
3
])
print_std
(
const
SubTableData
*
sdata
,
LinearSectionPtr
ptr
[
3
])
{
{
printf
(
"addr=%p gci=%d op=%d
\n
"
,
(
void
*
)
sdata
,
sdata
->
gci
,
sdata
->
operation
);
printf
(
"addr=%p gci=%d op=%d
\n
"
,
(
void
*
)
sdata
,
sdata
->
gci
,
SubTableData
::
getOperation
(
sdata
->
requestInfo
));
for
(
int
i
=
0
;
i
<=
2
;
i
++
)
{
for
(
int
i
=
0
;
i
<=
2
;
i
++
)
{
printf
(
"sec=%d addr=%p sz=%d
\n
"
,
i
,
(
void
*
)
ptr
[
i
].
p
,
ptr
[
i
].
sz
);
printf
(
"sec=%d addr=%p sz=%d
\n
"
,
i
,
(
void
*
)
ptr
[
i
].
p
,
ptr
[
i
].
sz
);
for
(
int
j
=
0
;
j
<
ptr
[
i
].
sz
;
j
++
)
for
(
int
j
=
0
;
j
<
ptr
[
i
].
sz
;
j
++
)
...
@@ -672,7 +673,8 @@ NdbEventOperationImpl::execSUB_TABLE_DATA(NdbApiSignal * signal,
...
@@ -672,7 +673,8 @@ NdbEventOperationImpl::execSUB_TABLE_DATA(NdbApiSignal * signal,
int
int
NdbEventOperationImpl
::
receive_event
()
NdbEventOperationImpl
::
receive_event
()
{
{
Uint32
operation
=
(
Uint32
)
m_data_item
->
sdata
->
operation
;
Uint32
operation
=
SubTableData
::
getOperation
(
m_data_item
->
sdata
->
requestInfo
);
if
(
unlikely
(
operation
>=
NdbDictionary
::
Event
::
_TE_FIRST_NON_DATA_EVENT
))
if
(
unlikely
(
operation
>=
NdbDictionary
::
Event
::
_TE_FIRST_NON_DATA_EVENT
))
{
{
DBUG_ENTER
(
"NdbEventOperationImpl::receive_event"
);
DBUG_ENTER
(
"NdbEventOperationImpl::receive_event"
);
...
@@ -869,7 +871,7 @@ NdbDictionary::Event::TableEvent
...
@@ -869,7 +871,7 @@ NdbDictionary::Event::TableEvent
NdbEventOperationImpl
::
getEventType
()
NdbEventOperationImpl
::
getEventType
()
{
{
return
(
NdbDictionary
::
Event
::
TableEvent
)
return
(
NdbDictionary
::
Event
::
TableEvent
)
(
1
<<
(
unsigned
)
m_data_item
->
sdata
->
operation
);
(
1
<<
SubTableData
::
getOperation
(
m_data_item
->
sdata
->
requestInfo
)
);
}
}
...
@@ -1207,7 +1209,8 @@ NdbEventBuffer::nextEvent()
...
@@ -1207,7 +1209,8 @@ NdbEventBuffer::nextEvent()
}
}
assert
(
gci_ops
&&
(
op
->
getGCI
()
==
gci_ops
->
m_gci
));
assert
(
gci_ops
&&
(
op
->
getGCI
()
==
gci_ops
->
m_gci
));
// to return TE_NUL it should be made into data event
// to return TE_NUL it should be made into data event
if
(
data
->
sdata
->
operation
==
NdbDictionary
::
Event
::
_TE_NUL
)
if
(
SubTableData
::
getOperation
(
data
->
sdata
->
requestInfo
)
==
NdbDictionary
::
Event
::
_TE_NUL
)
{
{
DBUG_PRINT_EVENT
(
"info"
,
(
"skip _TE_NUL"
));
DBUG_PRINT_EVENT
(
"info"
,
(
"skip _TE_NUL"
));
continue
;
continue
;
...
@@ -1574,9 +1577,11 @@ NdbEventBuffer::report_node_connected(Uint32 node_id)
...
@@ -1574,9 +1577,11 @@ NdbEventBuffer::report_node_connected(Uint32 node_id)
bzero
(
ptr
,
sizeof
(
ptr
));
bzero
(
ptr
,
sizeof
(
ptr
));
data
.
tableId
=
~
0
;
data
.
tableId
=
~
0
;
data
.
operation
=
NdbDictionary
::
Event
::
_TE_ACTIVE
;
data
.
requestInfo
=
0
;
data
.
req_nodeid
=
(
Uint8
)
node_id
;
SubTableData
::
setOperation
(
data
.
requestInfo
,
data
.
ndbd_nodeid
=
(
Uint8
)
node_id
;
NdbDictionary
::
Event
::
_TE_ACTIVE
);
SubTableData
::
setReqNodeId
(
data
.
requestInfo
,
node_id
);
SubTableData
::
setNdbdNodeId
(
data
.
requestInfo
,
node_id
);
data
.
logType
=
SubTableData
::
LOG
;
data
.
logType
=
SubTableData
::
LOG
;
data
.
gci
=
m_latestGCI
+
1
;
data
.
gci
=
m_latestGCI
+
1
;
/**
/**
...
@@ -1614,9 +1619,11 @@ NdbEventBuffer::report_node_failure(Uint32 node_id)
...
@@ -1614,9 +1619,11 @@ NdbEventBuffer::report_node_failure(Uint32 node_id)
bzero
(
ptr
,
sizeof
(
ptr
));
bzero
(
ptr
,
sizeof
(
ptr
));
data
.
tableId
=
~
0
;
data
.
tableId
=
~
0
;
data
.
operation
=
NdbDictionary
::
Event
::
_TE_NODE_FAILURE
;
data
.
requestInfo
=
0
;
data
.
req_nodeid
=
(
Uint8
)
node_id
;
SubTableData
::
setOperation
(
data
.
requestInfo
,
data
.
ndbd_nodeid
=
(
Uint8
)
node_id
;
NdbDictionary
::
Event
::
_TE_NODE_FAILURE
);
SubTableData
::
setReqNodeId
(
data
.
requestInfo
,
node_id
);
SubTableData
::
setNdbdNodeId
(
data
.
requestInfo
,
node_id
);
data
.
logType
=
SubTableData
::
LOG
;
data
.
logType
=
SubTableData
::
LOG
;
data
.
gci
=
m_latestGCI
+
1
;
data
.
gci
=
m_latestGCI
+
1
;
/**
/**
...
@@ -1654,7 +1661,9 @@ NdbEventBuffer::completeClusterFailed()
...
@@ -1654,7 +1661,9 @@ NdbEventBuffer::completeClusterFailed()
bzero
(
ptr
,
sizeof
(
ptr
));
bzero
(
ptr
,
sizeof
(
ptr
));
data
.
tableId
=
~
0
;
data
.
tableId
=
~
0
;
data
.
operation
=
NdbDictionary
::
Event
::
_TE_CLUSTER_FAILURE
;
data
.
requestInfo
=
0
;
SubTableData
::
setOperation
(
data
.
requestInfo
,
NdbDictionary
::
Event
::
_TE_CLUSTER_FAILURE
);
data
.
logType
=
SubTableData
::
LOG
;
data
.
logType
=
SubTableData
::
LOG
;
data
.
gci
=
m_latestGCI
+
1
;
data
.
gci
=
m_latestGCI
+
1
;
...
@@ -1757,19 +1766,21 @@ NdbEventBuffer::insertDataL(NdbEventOperationImpl *op,
...
@@ -1757,19 +1766,21 @@ NdbEventBuffer::insertDataL(NdbEventOperationImpl *op,
LinearSectionPtr
ptr
[
3
])
LinearSectionPtr
ptr
[
3
])
{
{
DBUG_ENTER_EVENT
(
"NdbEventBuffer::insertDataL"
);
DBUG_ENTER_EVENT
(
"NdbEventBuffer::insertDataL"
);
const
Uint32
ri
=
sdata
->
requestInfo
;
const
Uint32
operation
=
SubTableData
::
getOperation
(
ri
);
Uint64
gci
=
sdata
->
gci
;
Uint64
gci
=
sdata
->
gci
;
const
bool
is_data_event
=
const
bool
is_data_event
=
sdata
->
operation
<
NdbDictionary
::
Event
::
_TE_FIRST_NON_DATA_EVENT
;
operation
<
NdbDictionary
::
Event
::
_TE_FIRST_NON_DATA_EVENT
;
if
(
!
is_data_event
)
if
(
!
is_data_event
)
{
{
switch
(
sdata
->
operation
)
switch
(
operation
)
{
{
case
NdbDictionary
:
:
Event
::
_TE_NODE_FAILURE
:
case
NdbDictionary
:
:
Event
::
_TE_NODE_FAILURE
:
op
->
m_node_bit_mask
.
clear
(
sdata
->
ndbd_nodeid
);
op
->
m_node_bit_mask
.
clear
(
SubTableData
::
getNdbdNodeId
(
ri
)
);
break
;
break
;
case
NdbDictionary
:
:
Event
::
_TE_ACTIVE
:
case
NdbDictionary
:
:
Event
::
_TE_ACTIVE
:
op
->
m_node_bit_mask
.
set
(
sdata
->
ndbd_nodeid
);
op
->
m_node_bit_mask
.
set
(
SubTableData
::
getNdbdNodeId
(
ri
)
);
// internal event, do not relay to user
// internal event, do not relay to user
DBUG_RETURN_EVENT
(
0
);
DBUG_RETURN_EVENT
(
0
);
break
;
break
;
...
@@ -1780,7 +1791,8 @@ NdbEventBuffer::insertDataL(NdbEventOperationImpl *op,
...
@@ -1780,7 +1791,8 @@ NdbEventBuffer::insertDataL(NdbEventOperationImpl *op,
DBUG_PRINT
(
"info"
,
(
"m_ref_count: %u for op: %p"
,
op
->
m_ref_count
,
op
));
DBUG_PRINT
(
"info"
,
(
"m_ref_count: %u for op: %p"
,
op
->
m_ref_count
,
op
));
break
;
break
;
case
NdbDictionary
:
:
Event
::
_TE_STOP
:
case
NdbDictionary
:
:
Event
::
_TE_STOP
:
op
->
m_node_bit_mask
.
clear
(
sdata
->
ndbd_nodeid
);
ndbout_c
(
"sdata->ndbd_nodeid: %d"
,
SubTableData
::
getNdbdNodeId
(
ri
));
op
->
m_node_bit_mask
.
clear
(
SubTableData
::
getNdbdNodeId
(
ri
));
if
(
op
->
m_node_bit_mask
.
isclear
())
if
(
op
->
m_node_bit_mask
.
isclear
())
{
{
DBUG_ASSERT
(
op
->
m_ref_count
>
0
);
DBUG_ASSERT
(
op
->
m_ref_count
>
0
);
...
@@ -1792,19 +1804,20 @@ NdbEventBuffer::insertDataL(NdbEventOperationImpl *op,
...
@@ -1792,19 +1804,20 @@ NdbEventBuffer::insertDataL(NdbEventOperationImpl *op,
break
;
break
;
}
}
}
}
if
(
likely
((
Uint32
)
op
->
mi_type
&
(
1
<<
(
Uint32
)
sdata
->
operation
))
)
if
(
likely
((
Uint32
)
op
->
mi_type
&
(
1
<<
operation
))
)
{
{
Gci_container
*
bucket
=
find_bucket
(
&
m_active_gci
,
gci
Gci_container
*
bucket
=
find_bucket
(
&
m_active_gci
,
gci
#ifdef VM_TRACE
#ifdef VM_TRACE
,
m_flush_gci
,
m_flush_gci
#endif
#endif
);
);
DBUG_PRINT_EVENT
(
"info"
,
(
"data insertion in eventId %d"
,
op
->
m_eventId
));
DBUG_PRINT_EVENT
(
"info"
,
(
"data insertion in eventId %d"
,
op
->
m_eventId
));
DBUG_PRINT_EVENT
(
"info"
,
(
"gci=%d tab=%d op=%d node=%d"
,
DBUG_PRINT_EVENT
(
"info"
,
(
"gci=%d tab=%d op=%d node=%d"
,
sdata
->
gci
,
sdata
->
tableId
,
sdata
->
operation
,
sdata
->
gci
,
sdata
->
tableId
,
sdata
->
req_nodeid
));
SubTableData
::
getOperation
(
sdata
->
requestInfo
),
SubTableData
::
getReqNodeId
(
sdata
->
requestInfo
)));
if
(
unlikely
(
bucket
==
0
))
if
(
unlikely
(
bucket
==
0
))
{
{
...
@@ -1824,7 +1837,7 @@ NdbEventBuffer::insertDataL(NdbEventOperationImpl *op,
...
@@ -1824,7 +1837,7 @@ NdbEventBuffer::insertDataL(NdbEventOperationImpl *op,
DBUG_PRINT_EVENT
(
"info"
,
(
"ignore non-data event on blob table"
));
DBUG_PRINT_EVENT
(
"info"
,
(
"ignore non-data event on blob table"
));
DBUG_RETURN_EVENT
(
0
);
DBUG_RETURN_EVENT
(
0
);
}
}
// find position in bucket hash table
// find position in bucket hash table
EventBufData
*
data
=
0
;
EventBufData
*
data
=
0
;
EventBufData_hash
::
Pos
hpos
;
EventBufData_hash
::
Pos
hpos
;
...
@@ -1833,7 +1846,7 @@ NdbEventBuffer::insertDataL(NdbEventOperationImpl *op,
...
@@ -1833,7 +1846,7 @@ NdbEventBuffer::insertDataL(NdbEventOperationImpl *op,
bucket
->
m_data_hash
.
search
(
hpos
,
op
,
ptr
);
bucket
->
m_data_hash
.
search
(
hpos
,
op
,
ptr
);
data
=
hpos
.
data
;
data
=
hpos
.
data
;
}
}
if
(
data
==
0
)
if
(
data
==
0
)
{
{
// allocate new result buffer
// allocate new result buffer
...
@@ -1901,20 +1914,22 @@ NdbEventBuffer::insertDataL(NdbEventOperationImpl *op,
...
@@ -1901,20 +1914,22 @@ NdbEventBuffer::insertDataL(NdbEventOperationImpl *op,
// since the flags represent multiple ops on multiple PKs
// since the flags represent multiple ops on multiple PKs
// XXX fix by doing merge at end of epoch (extra mem cost)
// XXX fix by doing merge at end of epoch (extra mem cost)
{
{
EventBufData_list
::
Gci_op
g
=
{
op
,
(
1
<<
sdata
->
operation
)
};
EventBufData_list
::
Gci_op
g
=
{
op
,
(
1
<<
operation
)
};
bucket
->
m_data
.
add_gci_op
(
g
);
bucket
->
m_data
.
add_gci_op
(
g
);
}
}
{
{
EventBufData_list
::
Gci_op
g
=
{
op
,
(
1
<<
data
->
sdata
->
operation
)
};
EventBufData_list
::
Gci_op
g
=
{
op
,
(
1
<<
SubTableData
::
getOperation
(
data
->
sdata
->
requestInfo
))};
bucket
->
m_data
.
add_gci_op
(
g
);
bucket
->
m_data
.
add_gci_op
(
g
);
}
}
}
}
}
}
DBUG_RETURN_EVENT
(
0
);
DBUG_RETURN_EVENT
(
0
);
}
}
#ifdef VM_TRACE
#ifdef VM_TRACE
if
((
Uint32
)
op
->
m_eventImpl
->
mi_type
&
(
1
<<
(
Uint32
)
sdata
->
operation
))
if
((
Uint32
)
op
->
m_eventImpl
->
mi_type
&
(
1
<<
operation
))
{
{
DBUG_PRINT_EVENT
(
"info"
,(
"Data arrived before ready eventId"
,
op
->
m_eventId
));
DBUG_PRINT_EVENT
(
"info"
,(
"Data arrived before ready eventId"
,
op
->
m_eventId
));
DBUG_RETURN_EVENT
(
0
);
DBUG_RETURN_EVENT
(
0
);
...
@@ -2100,8 +2115,8 @@ NdbEventBuffer::merge_data(const SubTableData * const sdata,
...
@@ -2100,8 +2115,8 @@ NdbEventBuffer::merge_data(const SubTableData * const sdata,
Uint32
nkey
=
data
->
m_event_op
->
m_eventImpl
->
m_tableImpl
->
m_noOfKeys
;
Uint32
nkey
=
data
->
m_event_op
->
m_eventImpl
->
m_tableImpl
->
m_noOfKeys
;
int
t1
=
data
->
sdata
->
operation
;
int
t1
=
SubTableData
::
getOperation
(
data
->
sdata
->
requestInfo
)
;
int
t2
=
sdata
->
operation
;
int
t2
=
SubTableData
::
getOperation
(
sdata
->
requestInfo
)
;
if
(
t1
==
Ev_t
::
enum_NUL
)
if
(
t1
==
Ev_t
::
enum_NUL
)
DBUG_RETURN_EVENT
(
copy_data
(
sdata
,
ptr2
,
data
));
DBUG_RETURN_EVENT
(
copy_data
(
sdata
,
ptr2
,
data
));
...
@@ -2165,7 +2180,7 @@ NdbEventBuffer::merge_data(const SubTableData * const sdata,
...
@@ -2165,7 +2180,7 @@ NdbEventBuffer::merge_data(const SubTableData * const sdata,
goto
end
;
goto
end
;
}
}
*
data
->
sdata
=
*
sdata
;
*
data
->
sdata
=
*
sdata
;
data
->
sdata
->
operation
=
tp
->
t3
;
SubTableData
::
setOperation
(
data
->
sdata
->
requestInfo
,
tp
->
t3
)
;
}
}
ptr
[
0
].
sz
=
ptr
[
1
].
sz
=
ptr
[
2
].
sz
=
0
;
ptr
[
0
].
sz
=
ptr
[
1
].
sz
=
ptr
[
2
].
sz
=
0
;
...
@@ -2357,7 +2372,7 @@ NdbEventBuffer::get_main_data(Gci_container* bucket,
...
@@ -2357,7 +2372,7 @@ NdbEventBuffer::get_main_data(Gci_container* bucket,
DBUG_RETURN_EVENT
(
-
1
);
DBUG_RETURN_EVENT
(
-
1
);
SubTableData
sdata
=
*
blob_data
->
sdata
;
SubTableData
sdata
=
*
blob_data
->
sdata
;
sdata
.
tableId
=
main_op
->
m_eventImpl
->
m_tableImpl
->
m_id
;
sdata
.
tableId
=
main_op
->
m_eventImpl
->
m_tableImpl
->
m_id
;
sdata
.
operation
=
NdbDictionary
::
Event
::
_TE_NUL
;
SubTableData
::
setOperation
(
sdata
.
requestInfo
,
NdbDictionary
::
Event
::
_TE_NUL
)
;
if
(
copy_data
(
&
sdata
,
ptr
,
main_data
)
!=
0
)
if
(
copy_data
(
&
sdata
,
ptr
,
main_data
)
!=
0
)
DBUG_RETURN_EVENT
(
-
1
);
DBUG_RETURN_EVENT
(
-
1
);
hpos
.
data
=
main_data
;
hpos
.
data
=
main_data
;
...
...
storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp
View file @
74defc57
...
@@ -225,7 +225,8 @@ void EventBufData_list::append_used_data(EventBufData *data)
...
@@ -225,7 +225,8 @@ void EventBufData_list::append_used_data(EventBufData *data)
inline
inline
void
EventBufData_list
::
append_data
(
EventBufData
*
data
)
void
EventBufData_list
::
append_data
(
EventBufData
*
data
)
{
{
Gci_op
g
=
{
data
->
m_event_op
,
1
<<
(
Uint32
)
data
->
sdata
->
operation
};
Gci_op
g
=
{
data
->
m_event_op
,
1
<<
SubTableData
::
getOperation
(
data
->
sdata
->
requestInfo
)
};
add_gci_op
(
g
);
add_gci_op
(
g
);
append_used_data
(
data
);
append_used_data
(
data
);
...
...
storage/ndb/src/ndbapi/Ndbif.cpp
View file @
74defc57
...
@@ -750,17 +750,19 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
...
@@ -750,17 +750,19 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
}
}
// Accumulate DIC_TAB_INFO for TE_ALTER events
// Accumulate DIC_TAB_INFO for TE_ALTER events
if
(
sdata
->
operation
==
NdbDictionary
::
Event
::
_TE_ALTER
&&
if
(
SubTableData
::
getOperation
(
sdata
->
requestInfo
)
==
NdbDictionary
::
Event
::
_TE_ALTER
&&
!
op
->
execSUB_TABLE_DATA
(
aSignal
,
ptr
))
!
op
->
execSUB_TABLE_DATA
(
aSignal
,
ptr
))
return
;
return
;
for
(
int
i
=
aSignal
->
m_noOfSections
;
i
<
3
;
i
++
)
{
for
(
int
i
=
aSignal
->
m_noOfSections
;
i
<
3
;
i
++
)
{
ptr
[
i
].
p
=
NULL
;
ptr
[
i
].
p
=
NULL
;
ptr
[
i
].
sz
=
0
;
ptr
[
i
].
sz
=
0
;
}
}
DBUG_PRINT
(
"info"
,(
"oid=senderData: %d, gci: %d, operation: %d, "
DBUG_PRINT
(
"info"
,(
"oid=senderData: %d, gci: %d, operation: %d, "
"tableId: %d"
,
"tableId: %d"
,
sdata
->
senderData
,
sdata
->
gci
,
sdata
->
operation
,
sdata
->
senderData
,
sdata
->
gci
,
SubTableData
::
getOperation
(
sdata
->
requestInfo
),
sdata
->
tableId
));
sdata
->
tableId
));
theEventBuffer
->
insertDataL
(
op
,
sdata
,
ptr
);
theEventBuffer
->
insertDataL
(
op
,
sdata
,
ptr
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment