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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
e9cbae32
Commit
e9cbae32
authored
Jun 26, 2006
by
jonas@perch.ndb.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ndb - bug#20683
part 2 - handle safecounter.init() failing in all parts of event code
parent
87460788
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
99 additions
and
11 deletions
+99
-11
storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
+40
-10
storage/ndb/src/kernel/blocks/suma/Suma.cpp
storage/ndb/src/kernel/blocks/suma/Suma.cpp
+2
-1
storage/ndb/test/ndbapi/test_event.cpp
storage/ndb/test/ndbapi/test_event.cpp
+57
-0
No files found.
storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
View file @
e9cbae32
...
@@ -9476,7 +9476,14 @@ Dbdict::createEventComplete_RT_USER_GET(Signal* signal,
...
@@ -9476,7 +9476,14 @@ Dbdict::createEventComplete_RT_USER_GET(Signal* signal,
NodeReceiverGroup
rg
(
DBDICT
,
c_aliveNodes
);
NodeReceiverGroup
rg
(
DBDICT
,
c_aliveNodes
);
RequestTracker
&
p
=
evntRecPtr
.
p
->
m_reqTracker
;
RequestTracker
&
p
=
evntRecPtr
.
p
->
m_reqTracker
;
p
.
init
<
CreateEvntRef
>
(
c_counterMgr
,
rg
,
GSN_CREATE_EVNT_REF
,
evntRecPtr
.
i
);
if
(
!
p
.
init
<
CreateEvntRef
>
(
c_counterMgr
,
rg
,
GSN_CREATE_EVNT_REF
,
evntRecPtr
.
i
))
{
jam
();
evntRecPtr
.
p
->
m_errorCode
=
701
;
createEvent_sendReply
(
signal
,
evntRecPtr
);
return
;
}
sendSignal
(
rg
,
GSN_CREATE_EVNT_REQ
,
signal
,
CreateEvntReq
::
SignalLength
,
JBB
);
sendSignal
(
rg
,
GSN_CREATE_EVNT_REQ
,
signal
,
CreateEvntReq
::
SignalLength
,
JBB
);
}
}
...
@@ -9764,8 +9771,12 @@ void Dbdict::execSUB_START_REQ(Signal* signal)
...
@@ -9764,8 +9771,12 @@ void Dbdict::execSUB_START_REQ(Signal* signal)
return
;
return
;
}
}
OpSubEventPtr
subbPtr
;
OpSubEventPtr
subbPtr
;
Uint32
errCode
=
0
;
if
(
!
c_opSubEvent
.
seize
(
subbPtr
))
{
if
(
!
c_opSubEvent
.
seize
(
subbPtr
))
{
errCode
=
SubStartRef
::
Busy
;
busy:
SubStartRef
*
ref
=
(
SubStartRef
*
)
signal
->
getDataPtrSend
();
SubStartRef
*
ref
=
(
SubStartRef
*
)
signal
->
getDataPtrSend
();
{
// fix
{
// fix
Uint32
subcriberRef
=
((
SubStartReq
*
)
signal
->
getDataPtr
())
->
subscriberRef
;
Uint32
subcriberRef
=
((
SubStartReq
*
)
signal
->
getDataPtr
())
->
subscriberRef
;
ref
->
subscriberRef
=
subcriberRef
;
ref
->
subscriberRef
=
subcriberRef
;
...
@@ -9775,7 +9786,7 @@ void Dbdict::execSUB_START_REQ(Signal* signal)
...
@@ -9775,7 +9786,7 @@ void Dbdict::execSUB_START_REQ(Signal* signal)
// ret->setErrorLine(__LINE__);
// ret->setErrorLine(__LINE__);
// ret->setErrorNode(reference());
// ret->setErrorNode(reference());
ref
->
senderRef
=
reference
();
ref
->
senderRef
=
reference
();
ref
->
errorCode
=
SubStartRef
::
Busy
;
ref
->
errorCode
=
errCode
;
sendSignal
(
origSenderRef
,
GSN_SUB_START_REF
,
signal
,
sendSignal
(
origSenderRef
,
GSN_SUB_START_REF
,
signal
,
SubStartRef
::
SignalLength2
,
JBB
);
SubStartRef
::
SignalLength2
,
JBB
);
...
@@ -9798,7 +9809,12 @@ void Dbdict::execSUB_START_REQ(Signal* signal)
...
@@ -9798,7 +9809,12 @@ void Dbdict::execSUB_START_REQ(Signal* signal)
subbPtr
.
p
->
m_senderRef
=
origSenderRef
;
// not sure if API sets correctly
subbPtr
.
p
->
m_senderRef
=
origSenderRef
;
// not sure if API sets correctly
NodeReceiverGroup
rg
(
DBDICT
,
c_aliveNodes
);
NodeReceiverGroup
rg
(
DBDICT
,
c_aliveNodes
);
RequestTracker
&
p
=
subbPtr
.
p
->
m_reqTracker
;
RequestTracker
&
p
=
subbPtr
.
p
->
m_reqTracker
;
p
.
init
<
SubStartRef
>
(
c_counterMgr
,
rg
,
GSN_SUB_START_REF
,
subbPtr
.
i
);
if
(
!
p
.
init
<
SubStartRef
>
(
c_counterMgr
,
rg
,
GSN_SUB_START_REF
,
subbPtr
.
i
))
{
c_opSubEvent
.
release
(
subbPtr
);
errCode
=
SubStartRef
::
Busy
;
goto
busy
;
}
SubStartReq
*
req
=
(
SubStartReq
*
)
signal
->
getDataPtrSend
();
SubStartReq
*
req
=
(
SubStartReq
*
)
signal
->
getDataPtrSend
();
...
@@ -9988,14 +10004,17 @@ void Dbdict::execSUB_STOP_REQ(Signal* signal)
...
@@ -9988,14 +10004,17 @@ void Dbdict::execSUB_STOP_REQ(Signal* signal)
return
;
return
;
}
}
OpSubEventPtr
subbPtr
;
OpSubEventPtr
subbPtr
;
Uint32
errCode
=
0
;
if
(
!
c_opSubEvent
.
seize
(
subbPtr
))
{
if
(
!
c_opSubEvent
.
seize
(
subbPtr
))
{
errCode
=
SubStopRef
::
Busy
;
busy:
SubStopRef
*
ref
=
(
SubStopRef
*
)
signal
->
getDataPtrSend
();
SubStopRef
*
ref
=
(
SubStopRef
*
)
signal
->
getDataPtrSend
();
jam
();
jam
();
// ret->setErrorCode(SubStartRef::SeizeError);
// ret->setErrorCode(SubStartRef::SeizeError);
// ret->setErrorLine(__LINE__);
// ret->setErrorLine(__LINE__);
// ret->setErrorNode(reference());
// ret->setErrorNode(reference());
ref
->
senderRef
=
reference
();
ref
->
senderRef
=
reference
();
ref
->
errorCode
=
SubStopRef
::
Busy
;
ref
->
errorCode
=
errCode
;
sendSignal
(
origSenderRef
,
GSN_SUB_STOP_REF
,
signal
,
sendSignal
(
origSenderRef
,
GSN_SUB_STOP_REF
,
signal
,
SubStopRef
::
SignalLength
,
JBB
);
SubStopRef
::
SignalLength
,
JBB
);
...
@@ -10020,7 +10039,13 @@ void Dbdict::execSUB_STOP_REQ(Signal* signal)
...
@@ -10020,7 +10039,13 @@ void Dbdict::execSUB_STOP_REQ(Signal* signal)
subbPtr
.
p
->
m_senderRef
=
origSenderRef
;
// not sure if API sets correctly
subbPtr
.
p
->
m_senderRef
=
origSenderRef
;
// not sure if API sets correctly
NodeReceiverGroup
rg
(
DBDICT
,
c_aliveNodes
);
NodeReceiverGroup
rg
(
DBDICT
,
c_aliveNodes
);
RequestTracker
&
p
=
subbPtr
.
p
->
m_reqTracker
;
RequestTracker
&
p
=
subbPtr
.
p
->
m_reqTracker
;
p
.
init
<
SubStopRef
>
(
c_counterMgr
,
rg
,
GSN_SUB_STOP_REF
,
subbPtr
.
i
);
if
(
!
p
.
init
<
SubStopRef
>
(
c_counterMgr
,
rg
,
GSN_SUB_STOP_REF
,
subbPtr
.
i
))
{
jam
();
c_opSubEvent
.
release
(
subbPtr
);
errCode
=
SubStopRef
::
Busy
;
goto
busy
;
}
SubStopReq
*
req
=
(
SubStopReq
*
)
signal
->
getDataPtrSend
();
SubStopReq
*
req
=
(
SubStopReq
*
)
signal
->
getDataPtrSend
();
...
@@ -10313,8 +10338,13 @@ Dbdict::dropEventUTIL_EXECUTE_READ(Signal* signal,
...
@@ -10313,8 +10338,13 @@ Dbdict::dropEventUTIL_EXECUTE_READ(Signal* signal,
NodeReceiverGroup
rg
(
DBDICT
,
c_aliveNodes
);
NodeReceiverGroup
rg
(
DBDICT
,
c_aliveNodes
);
RequestTracker
&
p
=
evntRecPtr
.
p
->
m_reqTracker
;
RequestTracker
&
p
=
evntRecPtr
.
p
->
m_reqTracker
;
p
.
init
<
SubRemoveRef
>
(
c_counterMgr
,
rg
,
GSN_SUB_REMOVE_REF
,
if
(
!
p
.
init
<
SubRemoveRef
>
(
c_counterMgr
,
rg
,
GSN_SUB_REMOVE_REF
,
evntRecPtr
.
i
);
evntRecPtr
.
i
))
{
evntRecPtr
.
p
->
m_errorCode
=
701
;
dropEvent_sendReply
(
signal
,
evntRecPtr
);
return
;
}
SubRemoveReq
*
req
=
(
SubRemoveReq
*
)
signal
->
getDataPtrSend
();
SubRemoveReq
*
req
=
(
SubRemoveReq
*
)
signal
->
getDataPtrSend
();
...
...
storage/ndb/src/kernel/blocks/suma/Suma.cpp
View file @
e9cbae32
...
@@ -2465,7 +2465,8 @@ Suma::execSUB_STOP_REQ(Signal* signal){
...
@@ -2465,7 +2465,8 @@ Suma::execSUB_STOP_REQ(Signal* signal){
TablePtr
tabPtr
;
TablePtr
tabPtr
;
tabPtr
.
i
=
subPtr
.
p
->
m_table_ptrI
;
tabPtr
.
i
=
subPtr
.
p
->
m_table_ptrI
;
if
(
!
(
tabPtr
.
p
=
c_tables
.
getPtr
(
tabPtr
.
i
))
||
if
(
tabPtr
.
i
==
RNIL
||
!
(
tabPtr
.
p
=
c_tables
.
getPtr
(
tabPtr
.
i
))
||
tabPtr
.
p
->
m_tableId
!=
subPtr
.
p
->
m_tableId
)
tabPtr
.
p
->
m_tableId
!=
subPtr
.
p
->
m_tableId
)
{
{
jam
();
jam
();
...
...
storage/ndb/test/ndbapi/test_event.cpp
View file @
e9cbae32
...
@@ -1559,6 +1559,56 @@ static int runCreateDropNR(NDBT_Context* ctx, NDBT_Step* step)
...
@@ -1559,6 +1559,56 @@ static int runCreateDropNR(NDBT_Context* ctx, NDBT_Step* step)
DBUG_RETURN
(
result
);
DBUG_RETURN
(
result
);
}
}
static
int
runSubscribeUnsubscribe
(
NDBT_Context
*
ctx
,
NDBT_Step
*
step
)
{
char
buf
[
1024
];
const
NdbDictionary
::
Table
&
tab
=
*
ctx
->
getTab
();
sprintf
(
buf
,
"%s_EVENT"
,
tab
.
getName
());
Ndb
*
ndb
=
GETNDB
(
step
);
int
loops
=
5
*
ctx
->
getNumLoops
();
while
(
--
loops
)
{
NdbEventOperation
*
pOp
=
ndb
->
createEventOperation
(
buf
);
if
(
pOp
==
0
)
{
g_err
<<
"createEventOperation: "
<<
ndb
->
getNdbError
().
code
<<
" "
<<
ndb
->
getNdbError
().
message
<<
endl
;
return
NDBT_FAILED
;
}
int
n_columns
=
tab
.
getNoOfColumns
();
for
(
int
j
=
0
;
j
<
n_columns
;
j
++
)
{
pOp
->
getValue
(
tab
.
getColumn
(
j
)
->
getName
());
pOp
->
getPreValue
(
tab
.
getColumn
(
j
)
->
getName
());
}
if
(
pOp
->
execute
()
)
{
g_err
<<
"pOp->execute(): "
<<
pOp
->
getNdbError
().
code
<<
" "
<<
pOp
->
getNdbError
().
message
<<
endl
;
ndb
->
dropEventOperation
(
pOp
);
return
NDBT_FAILED
;
}
if
(
ndb
->
dropEventOperation
(
pOp
))
{
g_err
<<
"pOp->execute(): "
<<
ndb
->
getNdbError
().
code
<<
" "
<<
ndb
->
getNdbError
().
message
<<
endl
;
return
NDBT_FAILED
;
}
}
return
NDBT_OK
;
}
NDBT_TESTSUITE
(
test_event
);
NDBT_TESTSUITE
(
test_event
);
TESTCASE
(
"BasicEventOperation"
,
TESTCASE
(
"BasicEventOperation"
,
"Verify that we can listen to Events"
"Verify that we can listen to Events"
...
@@ -1673,6 +1723,13 @@ TESTCASE("CreateDropNR",
...
@@ -1673,6 +1723,13 @@ TESTCASE("CreateDropNR",
"NOTE! No errors are allowed!"
){
"NOTE! No errors are allowed!"
){
FINALIZER
(
runCreateDropNR
);
FINALIZER
(
runCreateDropNR
);
}
}
TESTCASE
(
"SubscribeUnsubscribe"
,
"A bunch of threads doing subscribe/unsubscribe in loop"
"NOTE! No errors are allowed!"
){
INITIALIZER
(
runCreateEvent
);
STEPS
(
runSubscribeUnsubscribe
,
16
);
FINALIZER
(
runDropEvent
);
}
NDBT_TESTSUITE_END
(
test_event
);
NDBT_TESTSUITE_END
(
test_event
);
int
main
(
int
argc
,
const
char
**
argv
){
int
main
(
int
argc
,
const
char
**
argv
){
...
...
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