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
c273fda5
Commit
c273fda5
authored
Nov 18, 2004
by
pekka@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ndb: new arbitrator behaviour for >=3-way: < 1/2 nodes can survive
parent
22973f11
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
16 deletions
+33
-16
ndb/include/kernel/signaldata/ArbitSignalData.hpp
ndb/include/kernel/signaldata/ArbitSignalData.hpp
+8
-7
ndb/src/common/debugger/EventLogger.cpp
ndb/src/common/debugger/EventLogger.cpp
+5
-0
ndb/src/kernel/blocks/qmgr/QmgrMain.cpp
ndb/src/kernel/blocks/qmgr/QmgrMain.cpp
+20
-9
No files found.
ndb/include/kernel/signaldata/ArbitSignalData.hpp
View file @
c273fda5
...
@@ -94,13 +94,14 @@ public:
...
@@ -94,13 +94,14 @@ public:
// arbitration result
// arbitration result
LoseNodes
=
41
,
// lose on ndb node count
LoseNodes
=
41
,
// lose on ndb node count
WinGroups
=
42
,
// we win, no need for arbitration
WinNodes
=
42
,
// win on ndb node count
LoseGroups
=
43
,
// we lose, missing node group
WinGroups
=
43
,
// we win, no need for arbitration
Partitioning
=
44
,
// possible network partitioning
LoseGroups
=
44
,
// we lose, missing node group
WinChoose
=
45
,
// positive reply
Partitioning
=
45
,
// possible network partitioning
LoseChoose
=
46
,
// negative reply
WinChoose
=
46
,
// positive reply
LoseNorun
=
47
,
// arbitrator required but not running
LoseChoose
=
47
,
// negative reply
LoseNocfg
=
48
,
// arbitrator required but none configured
LoseNorun
=
48
,
// arbitrator required but not running
LoseNocfg
=
49
,
// arbitrator required but none configured
// general error codes
// general error codes
ErrTicket
=
91
,
// invalid arbitrator-ticket
ErrTicket
=
91
,
// invalid arbitrator-ticket
...
...
ndb/src/common/debugger/EventLogger.cpp
View file @
c273fda5
...
@@ -421,6 +421,11 @@ EventLogger::getText(char * m_text, size_t m_text_len,
...
@@ -421,6 +421,11 @@ EventLogger::getText(char * m_text, size_t m_text_len,
"%sArbitration check lost - less than 1/2 nodes left"
,
"%sArbitration check lost - less than 1/2 nodes left"
,
theNodeId
);
theNodeId
);
break
;
break
;
case
ArbitCode
:
:
WinNodes
:
BaseString
::
snprintf
(
m_text
,
m_text_len
,
"%sArbitration check won - all node groups and more than 1/2 nodes left"
,
theNodeId
);
break
;
case
ArbitCode
:
:
WinGroups
:
case
ArbitCode
:
:
WinGroups
:
BaseString
::
snprintf
(
m_text
,
m_text_len
,
BaseString
::
snprintf
(
m_text
,
m_text_len
,
"%sArbitration check won - node group majority"
,
"%sArbitration check won - node group majority"
,
...
...
ndb/src/kernel/blocks/qmgr/QmgrMain.cpp
View file @
c273fda5
...
@@ -2946,6 +2946,12 @@ void Qmgr::sendPrepFailReq(Signal* signal, Uint16 aNode)
...
@@ -2946,6 +2946,12 @@ void Qmgr::sendPrepFailReq(Signal* signal, Uint16 aNode)
* the "handle" routines.
* the "handle" routines.
*/
*/
/**
* Should < 1/2 nodes die unconditionally. Affects only >= 3-way
* replication.
*/
static
const
bool
g_ndb_arbit_one_half_rule
=
false
;
/**
/**
* Config signals are logically part of CM_INIT.
* Config signals are logically part of CM_INIT.
*/
*/
...
@@ -3157,7 +3163,8 @@ Qmgr::handleArbitCheck(Signal* signal)
...
@@ -3157,7 +3163,8 @@ Qmgr::handleArbitCheck(Signal* signal)
ndbrequire
(
cpresident
==
getOwnNodeId
());
ndbrequire
(
cpresident
==
getOwnNodeId
());
NodeBitmask
ndbMask
;
NodeBitmask
ndbMask
;
computeArbitNdbMask
(
ndbMask
);
computeArbitNdbMask
(
ndbMask
);
if
(
2
*
ndbMask
.
count
()
<
cnoOfNodes
)
{
if
(
g_ndb_arbit_one_half_rule
&&
2
*
ndbMask
.
count
()
<
cnoOfNodes
)
{
jam
();
jam
();
arbitRec
.
code
=
ArbitCode
::
LoseNodes
;
arbitRec
.
code
=
ArbitCode
::
LoseNodes
;
}
else
{
}
else
{
...
@@ -3181,6 +3188,11 @@ Qmgr::handleArbitCheck(Signal* signal)
...
@@ -3181,6 +3188,11 @@ Qmgr::handleArbitCheck(Signal* signal)
case
CheckNodeGroups
:
:
Partitioning
:
case
CheckNodeGroups
:
:
Partitioning
:
jam
();
jam
();
arbitRec
.
code
=
ArbitCode
::
Partitioning
;
arbitRec
.
code
=
ArbitCode
::
Partitioning
;
if
(
g_ndb_arbit_one_half_rule
&&
2
*
ndbMask
.
count
()
>
cnoOfNodes
)
{
jam
();
arbitRec
.
code
=
ArbitCode
::
WinNodes
;
}
break
;
break
;
default:
default:
ndbrequire
(
false
);
ndbrequire
(
false
);
...
@@ -3190,8 +3202,12 @@ Qmgr::handleArbitCheck(Signal* signal)
...
@@ -3190,8 +3202,12 @@ Qmgr::handleArbitCheck(Signal* signal)
switch
(
arbitRec
.
code
)
{
switch
(
arbitRec
.
code
)
{
case
ArbitCode
:
:
LoseNodes
:
case
ArbitCode
:
:
LoseNodes
:
jam
();
jam
();
case
ArbitCode
:
:
LoseGroups
:
jam
();
goto
crashme
;
goto
crashme
;
case
ArbitCode
:
:
WinGroups
:
case
ArbitCode
:
:
WinNodes
:
jam
();
case
ArbitCode
:
:
WinGroups
:
jam
();
jam
();
if
(
arbitRec
.
state
==
ARBIT_RUN
)
{
if
(
arbitRec
.
state
==
ARBIT_RUN
)
{
jam
();
jam
();
...
@@ -3200,9 +3216,6 @@ Qmgr::handleArbitCheck(Signal* signal)
...
@@ -3200,9 +3216,6 @@ Qmgr::handleArbitCheck(Signal* signal)
arbitRec
.
state
=
ARBIT_INIT
;
arbitRec
.
state
=
ARBIT_INIT
;
arbitRec
.
newstate
=
true
;
arbitRec
.
newstate
=
true
;
break
;
break
;
case
ArbitCode
:
:
LoseGroups
:
jam
();
goto
crashme
;
case
ArbitCode
:
:
Partitioning
:
case
ArbitCode
:
:
Partitioning
:
if
(
arbitRec
.
state
==
ARBIT_RUN
)
{
if
(
arbitRec
.
state
==
ARBIT_RUN
)
{
jam
();
jam
();
...
@@ -3762,8 +3775,7 @@ Qmgr::execARBIT_CHOOSEREF(Signal* signal)
...
@@ -3762,8 +3775,7 @@ Qmgr::execARBIT_CHOOSEREF(Signal* signal)
}
}
/**
/**
* Handle CRASH state. We must crash immediately. But it
* Handle CRASH state. We must crash immediately.
* would be nice to wait until event reports have been sent.
* XXX tell other nodes in our party to crash too.
* XXX tell other nodes in our party to crash too.
*/
*/
void
void
...
@@ -3773,12 +3785,11 @@ Qmgr::stateArbitCrash(Signal* signal)
...
@@ -3773,12 +3785,11 @@ Qmgr::stateArbitCrash(Signal* signal)
if
(
arbitRec
.
newstate
)
{
if
(
arbitRec
.
newstate
)
{
jam
();
jam
();
CRASH_INSERTION
((
Uint32
)
910
+
arbitRec
.
state
);
CRASH_INSERTION
((
Uint32
)
910
+
arbitRec
.
state
);
arbitRec
.
setTimestamp
();
arbitRec
.
setTimestamp
();
arbitRec
.
code
=
0
;
arbitRec
.
code
=
0
;
arbitRec
.
newstate
=
false
;
arbitRec
.
newstate
=
false
;
}
}
#if
0
#if
def ndb_arbit_crash_wait_for_event_report_to_get_out
if
(
!
(
arbitRec
.
getTimediff
()
>
getArbitTimeout
()))
if
(
!
(
arbitRec
.
getTimediff
()
>
getArbitTimeout
()))
return
;
return
;
#endif
#endif
...
...
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