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
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
Hide 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,
NodeReceiverGroup
rg
(
DBDICT
,
c_aliveNodes
);
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
);
}
...
...
@@ -9764,8 +9771,12 @@ void Dbdict::execSUB_START_REQ(Signal* signal)
return
;
}
OpSubEventPtr
subbPtr
;
Uint32
errCode
=
0
;
if
(
!
c_opSubEvent
.
seize
(
subbPtr
))
{
errCode
=
SubStartRef
::
Busy
;
busy:
SubStartRef
*
ref
=
(
SubStartRef
*
)
signal
->
getDataPtrSend
();
{
// fix
Uint32
subcriberRef
=
((
SubStartReq
*
)
signal
->
getDataPtr
())
->
subscriberRef
;
ref
->
subscriberRef
=
subcriberRef
;
...
...
@@ -9775,7 +9786,7 @@ void Dbdict::execSUB_START_REQ(Signal* signal)
// ret->setErrorLine(__LINE__);
// ret->setErrorNode(reference());
ref
->
senderRef
=
reference
();
ref
->
errorCode
=
SubStartRef
::
Busy
;
ref
->
errorCode
=
errCode
;
sendSignal
(
origSenderRef
,
GSN_SUB_START_REF
,
signal
,
SubStartRef
::
SignalLength2
,
JBB
);
...
...
@@ -9798,7 +9809,12 @@ void Dbdict::execSUB_START_REQ(Signal* signal)
subbPtr
.
p
->
m_senderRef
=
origSenderRef
;
// not sure if API sets correctly
NodeReceiverGroup
rg
(
DBDICT
,
c_aliveNodes
);
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
();
...
...
@@ -9988,14 +10004,17 @@ void Dbdict::execSUB_STOP_REQ(Signal* signal)
return
;
}
OpSubEventPtr
subbPtr
;
Uint32
errCode
=
0
;
if
(
!
c_opSubEvent
.
seize
(
subbPtr
))
{
errCode
=
SubStopRef
::
Busy
;
busy:
SubStopRef
*
ref
=
(
SubStopRef
*
)
signal
->
getDataPtrSend
();
jam
();
// ret->setErrorCode(SubStartRef::SeizeError);
// ret->setErrorLine(__LINE__);
// ret->setErrorNode(reference());
ref
->
senderRef
=
reference
();
ref
->
errorCode
=
SubStopRef
::
Busy
;
ref
->
errorCode
=
errCode
;
sendSignal
(
origSenderRef
,
GSN_SUB_STOP_REF
,
signal
,
SubStopRef
::
SignalLength
,
JBB
);
...
...
@@ -10020,10 +10039,16 @@ void Dbdict::execSUB_STOP_REQ(Signal* signal)
subbPtr
.
p
->
m_senderRef
=
origSenderRef
;
// not sure if API sets correctly
NodeReceiverGroup
rg
(
DBDICT
,
c_aliveNodes
);
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
();
req
->
senderRef
=
reference
();
req
->
senderData
=
subbPtr
.
i
;
...
...
@@ -10313,9 +10338,14 @@ Dbdict::dropEventUTIL_EXECUTE_READ(Signal* signal,
NodeReceiverGroup
rg
(
DBDICT
,
c_aliveNodes
);
RequestTracker
&
p
=
evntRecPtr
.
p
->
m_reqTracker
;
p
.
init
<
SubRemoveRef
>
(
c_counterMgr
,
rg
,
GSN_SUB_REMOVE_REF
,
evntRecPtr
.
i
);
if
(
!
p
.
init
<
SubRemoveRef
>
(
c_counterMgr
,
rg
,
GSN_SUB_REMOVE_REF
,
evntRecPtr
.
i
))
{
evntRecPtr
.
p
->
m_errorCode
=
701
;
dropEvent_sendReply
(
signal
,
evntRecPtr
);
return
;
}
SubRemoveReq
*
req
=
(
SubRemoveReq
*
)
signal
->
getDataPtrSend
();
req
->
senderRef
=
reference
();
...
...
storage/ndb/src/kernel/blocks/suma/Suma.cpp
View file @
e9cbae32
...
...
@@ -2465,7 +2465,8 @@ Suma::execSUB_STOP_REQ(Signal* signal){
TablePtr
tabPtr
;
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
)
{
jam
();
...
...
storage/ndb/test/ndbapi/test_event.cpp
View file @
e9cbae32
...
...
@@ -1559,6 +1559,56 @@ static int runCreateDropNR(NDBT_Context* ctx, NDBT_Step* step)
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
);
TESTCASE
(
"BasicEventOperation"
,
"Verify that we can listen to Events"
...
...
@@ -1673,6 +1723,13 @@ TESTCASE("CreateDropNR",
"NOTE! No errors are allowed!"
){
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
);
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