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
37d97b58
Commit
37d97b58
authored
Jun 12, 2006
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.1
into poseidon.ndb.mysql.com:/home/tomas/mysql-5.1-new-ndb
parents
9f9d7e0a
059d28f7
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
90 additions
and
73 deletions
+90
-73
storage/ndb/include/kernel/signaldata/AllocNodeId.hpp
storage/ndb/include/kernel/signaldata/AllocNodeId.hpp
+4
-2
storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp
storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp
+3
-2
storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp
storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp
+4
-1
storage/ndb/src/mgmsrv/MgmtSrvr.cpp
storage/ndb/src/mgmsrv/MgmtSrvr.cpp
+64
-53
storage/ndb/src/mgmsrv/MgmtSrvr.hpp
storage/ndb/src/mgmsrv/MgmtSrvr.hpp
+1
-3
storage/ndb/src/mgmsrv/Services.cpp
storage/ndb/src/mgmsrv/Services.cpp
+13
-12
storage/ndb/src/ndbapi/ndberror.c
storage/ndb/src/ndbapi/ndberror.c
+1
-0
No files found.
storage/ndb/include/kernel/signaldata/AllocNodeId.hpp
View file @
37d97b58
...
...
@@ -25,11 +25,12 @@
*/
class
AllocNodeIdReq
{
public:
STATIC_CONST
(
SignalLength
=
3
);
STATIC_CONST
(
SignalLength
=
4
);
Uint32
senderRef
;
Uint32
senderData
;
Uint32
nodeId
;
Uint32
nodeType
;
};
class
AllocNodeIdConf
{
...
...
@@ -53,7 +54,8 @@ public:
NotMaster
=
702
,
NodeReserved
=
1701
,
NodeConnected
=
1702
,
NodeFailureHandlingNotCompleted
=
1703
NodeFailureHandlingNotCompleted
=
1703
,
NodeTypeMismatch
=
1704
};
Uint32
senderRef
;
...
...
storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp
View file @
37d97b58
...
...
@@ -234,6 +234,7 @@ void Cmvmi::execEVENT_REP(Signal* signal)
void
Cmvmi
::
execEVENT_SUBSCRIBE_REQ
(
Signal
*
signal
){
EventSubscribeReq
*
subReq
=
(
EventSubscribeReq
*
)
&
signal
->
theData
[
0
];
Uint32
senderRef
=
signal
->
getSendersBlockRef
();
SubscriberPtr
ptr
;
jamEntry
();
DBUG_ENTER
(
"Cmvmi::execEVENT_SUBSCRIBE_REQ"
);
...
...
@@ -251,7 +252,7 @@ Cmvmi::execEVENT_SUBSCRIBE_REQ(Signal * signal){
* Create a new one
*/
if
(
subscribers
.
seize
(
ptr
)
==
false
){
sendSignal
(
s
ubReq
->
block
Ref
,
GSN_EVENT_SUBSCRIBE_REF
,
signal
,
1
,
JBB
);
sendSignal
(
s
ender
Ref
,
GSN_EVENT_SUBSCRIBE_REF
,
signal
,
1
,
JBB
);
return
;
}
ptr
.
p
->
logLevel
.
clear
();
...
...
@@ -278,7 +279,7 @@ Cmvmi::execEVENT_SUBSCRIBE_REQ(Signal * signal){
}
signal
->
theData
[
0
]
=
ptr
.
i
;
sendSignal
(
ptr
.
p
->
block
Ref
,
GSN_EVENT_SUBSCRIBE_CONF
,
signal
,
1
,
JBB
);
sendSignal
(
sender
Ref
,
GSN_EVENT_SUBSCRIBE_CONF
,
signal
,
1
,
JBB
);
DBUG_VOID_RETURN
;
}
...
...
storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp
View file @
37d97b58
...
...
@@ -4736,6 +4736,7 @@ Qmgr::execALLOC_NODEID_REQ(Signal * signal)
const
AllocNodeIdReq
*
req
=
(
AllocNodeIdReq
*
)
signal
->
getDataPtr
();
Uint32
senderRef
=
req
->
senderRef
;
Uint32
nodeId
=
req
->
nodeId
;
Uint32
nodeType
=
req
->
nodeType
;
Uint32
error
=
0
;
if
(
refToBlock
(
senderRef
)
!=
QMGR
)
// request from management server
...
...
@@ -4786,7 +4787,9 @@ Qmgr::execALLOC_NODEID_REQ(Signal * signal)
NodeRecPtr
nodePtr
;
nodePtr
.
i
=
nodeId
;
ptrAss
(
nodePtr
,
nodeRec
);
if
(
nodePtr
.
p
->
failState
!=
NORMAL
)
if
(
nodeType
!=
getNodeInfo
(
nodeId
).
m_type
)
error
=
AllocNodeIdRef
::
NodeTypeMismatch
;
else
if
(
nodePtr
.
p
->
failState
!=
NORMAL
)
error
=
AllocNodeIdRef
::
NodeFailureHandlingNotCompleted
;
}
...
...
storage/ndb/src/mgmsrv/MgmtSrvr.cpp
View file @
37d97b58
...
...
@@ -122,41 +122,50 @@ MgmtSrvr::logLevelThreadRun()
/**
* Handle started nodes
*/
EventSubscribeReq
req
;
req
=
m_event_listner
[
0
].
m_logLevel
;
req
.
blockRef
=
_ownReference
;
SetLogLevelOrd
ord
;
m_started_nodes
.
lock
();
while
(
m_started_nodes
.
size
()
>
0
){
Uint32
node
=
m_started_nodes
[
0
];
m_started_nodes
.
erase
(
0
,
false
);
m_started_nodes
.
unlock
();
if
(
m_started_nodes
.
size
()
>
0
)
{
// calculate max log level
EventSubscribeReq
req
;
{
LogLevel
tmp
;
m_event_listner
.
lock
();
for
(
int
i
=
m_event_listner
.
m_clients
.
size
()
-
1
;
i
>=
0
;
i
--
)
tmp
.
set_max
(
m_event_listner
[
i
].
m_logLevel
);
m_event_listner
.
unlock
();
req
=
tmp
;
}
req
.
blockRef
=
_ownReference
;
while
(
m_started_nodes
.
size
()
>
0
)
{
Uint32
node
=
m_started_nodes
[
0
];
m_started_nodes
.
erase
(
0
,
false
);
m_started_nodes
.
unlock
();
setEventReportingLevelImpl
(
node
,
req
);
ord
=
m_nodeLogLevel
[
node
];
setNodeLogLevelImpl
(
node
,
ord
);
m_started_nodes
.
lock
();
}
setEventReportingLevelImpl
(
node
,
req
);
SetLogLevelOrd
ord
;
ord
=
m_nodeLogLevel
[
node
];
setNodeLogLevelImpl
(
node
,
ord
);
m_started_nodes
.
lock
();
}
}
m_started_nodes
.
unlock
();
m_log_level_requests
.
lock
();
while
(
m_log_level_requests
.
size
()
>
0
){
req
=
m_log_level_requests
[
0
];
while
(
m_log_level_requests
.
size
()
>
0
)
{
EventSubscribeReq
req
=
m_log_level_requests
[
0
];
m_log_level_requests
.
erase
(
0
,
false
);
m_log_level_requests
.
unlock
();
LogLevel
tmp
;
tmp
=
req
;
if
(
req
.
blockRef
==
0
){
req
.
blockRef
=
_ownReference
;
setEventReportingLevelImpl
(
0
,
req
);
}
else
{
ord
=
req
;
SetLogLevelOrd
ord
;
ord
=
req
;
setNodeLogLevelImpl
(
req
.
blockRef
,
ord
);
}
m_log_level_requests
.
lock
();
...
...
@@ -1499,7 +1508,8 @@ int
MgmtSrvr
::
setEventReportingLevelImpl
(
int
nodeId
,
const
EventSubscribeReq
&
ll
)
{
INIT_SIGNAL_SENDER
(
ss
,
nodeId
);
SignalSender
ss
(
theFacade
);
ss
.
lock
();
SimpleSignal
ssig
;
EventSubscribeReq
*
dst
=
...
...
@@ -1508,41 +1518,54 @@ MgmtSrvr::setEventReportingLevelImpl(int nodeId,
EventSubscribeReq
::
SignalLength
);
*
dst
=
ll
;
send
(
ss
,
ssig
,
nodeId
,
NODE_TYPE_DB
);
NodeBitmask
nodes
;
nodes
.
clear
();
Uint32
max
=
(
nodeId
==
0
)
?
(
nodeId
=
1
,
MAX_NDB_NODES
)
:
nodeId
;
for
(;
nodeId
<=
max
;
nodeId
++
)
{
if
(
nodeTypes
[
nodeId
]
!=
NODE_TYPE_DB
)
continue
;
if
(
okToSendTo
(
nodeId
,
true
))
continue
;
if
(
ss
.
sendSignal
(
nodeId
,
&
ssig
)
==
SEND_OK
)
{
nodes
.
set
(
nodeId
);
}
}
#if 0
while (
1
)
int
error
=
0
;
while
(
!
nodes
.
isclear
()
)
{
SimpleSignal
*
signal
=
ss
.
waitFor
();
int
gsn
=
signal
->
readSignalNumber
();
switch (gsn) {
nodeId
=
refToNode
(
signal
->
header
.
theSendersBlockRef
);
switch
(
gsn
)
{
case
GSN_EVENT_SUBSCRIBE_CONF
:{
nodes
.
clear
(
nodeId
);
break
;
}
case
GSN_EVENT_SUBSCRIBE_REF
:{
return SEND_OR_RECEIVE_FAILED;
nodes
.
clear
(
nodeId
);
error
=
1
;
break
;
}
case
GSN_NF_COMPLETEREP
:{
const
NFCompleteRep
*
const
rep
=
CAST_CONSTPTR
(
NFCompleteRep
,
signal
->
getDataPtr
());
if (rep->failedNodeId == nodeId)
return SEND_OR_RECEIVE_FAILED;
nodes
.
clear
(
rep
->
failedNodeId
);
break
;
}
case
GSN_NODE_FAILREP
:{
const NodeFailRep * const rep =
CAST_CONSTPTR(NodeFailRep, signal->getDataPtr());
if (NodeBitmask::get(rep->theNodes,nodeId))
return SEND_OR_RECEIVE_FAILED;
// ignore, NF_COMPLETEREP will arrive later
break
;
}
default:
report_unknown_signal
(
signal
);
return
SEND_OR_RECEIVE_FAILED
;
}
}
#endif
if
(
error
)
return
SEND_OR_RECEIVE_FAILED
;
return
0
;
}
...
...
@@ -1562,19 +1585,6 @@ MgmtSrvr::setNodeLogLevelImpl(int nodeId, const SetLogLevelOrd & ll)
return
ss
.
sendSignal
(
nodeId
,
&
ssig
)
==
SEND_OK
?
0
:
SEND_OR_RECEIVE_FAILED
;
}
int
MgmtSrvr
::
send
(
SignalSender
&
ss
,
SimpleSignal
&
ssig
,
Uint32
node
,
Uint32
node_type
){
Uint32
max
=
(
node
==
0
)
?
MAX_NODES
:
node
+
1
;
for
(;
node
<
max
;
node
++
){
while
(
nodeTypes
[
node
]
!=
(
int
)
node_type
&&
node
<
max
)
node
++
;
if
(
nodeTypes
[
node
]
!=
(
int
)
node_type
)
break
;
ss
.
sendSignal
(
node
,
&
ssig
);
}
return
0
;
}
//****************************************************************************
//****************************************************************************
...
...
@@ -1927,7 +1937,7 @@ MgmtSrvr::get_connected_nodes(NodeBitmask &connected_nodes) const
}
int
MgmtSrvr
::
alloc_node_id_req
(
Uint32
free_node_id
)
MgmtSrvr
::
alloc_node_id_req
(
NodeId
free_node_id
,
enum
ndb_mgm_node_type
type
)
{
SignalSender
ss
(
theFacade
);
ss
.
lock
();
// lock will be released on exit
...
...
@@ -1940,6 +1950,7 @@ MgmtSrvr::alloc_node_id_req(Uint32 free_node_id)
req
->
senderRef
=
ss
.
getOwnRef
();
req
->
senderData
=
19
;
req
->
nodeId
=
free_node_id
;
req
->
nodeType
=
type
;
int
do_send
=
1
;
NodeId
nodeId
=
0
;
...
...
@@ -2140,7 +2151,7 @@ MgmtSrvr::alloc_node_id(NodeId * nodeId,
if
(
id_found
&&
client_addr
!=
0
)
{
int
res
=
alloc_node_id_req
(
id_found
);
int
res
=
alloc_node_id_req
(
id_found
,
type
);
unsigned
save_id_found
=
id_found
;
switch
(
res
)
{
...
...
storage/ndb/src/mgmsrv/MgmtSrvr.hpp
View file @
37d97b58
...
...
@@ -486,8 +486,6 @@ public:
private
:
//**************************************************************************
int
send
(
SignalSender
&
ss
,
SimpleSignal
&
ssig
,
Uint32
node
,
Uint32
node_type
);
int
sendStopMgmd
(
NodeId
nodeId
,
bool
abort
,
bool
stop
,
...
...
@@ -520,7 +518,7 @@ private:
*/
int
getBlockNumber
(
const
BaseString
&
blockName
);
int
alloc_node_id_req
(
Uint32
free_node_id
);
int
alloc_node_id_req
(
NodeId
free_node_id
,
enum
ndb_mgm_node_type
type
);
//**************************************************************************
int
_blockNumber
;
...
...
storage/ndb/src/mgmsrv/Services.cpp
View file @
37d97b58
...
...
@@ -813,9 +813,8 @@ MgmApiSession::setClusterLogLevel(Parser<MgmApiSession>::Context &,
m_mgmsrv
.
m_event_listner
.
unlock
();
{
LogLevel
ll
;
ll
.
setLogLevel
(
category
,
level
);
m_mgmsrv
.
m_event_listner
.
update_max_log_level
(
ll
);
LogLevel
tmp
;
m_mgmsrv
.
m_event_listner
.
update_max_log_level
(
tmp
);
}
m_output
->
println
(
reply
);
...
...
@@ -1302,21 +1301,23 @@ Ndb_mgmd_event_service::log(int eventType, const Uint32* theData, NodeId nodeId)
void
Ndb_mgmd_event_service
::
update_max_log_level
(
const
LogLevel
&
log_level
)
{
LogLevel
tmp
=
m_logLevel
;
tmp
.
set_max
(
log_level
);
LogLevel
tmp
=
log_level
;
m_clients
.
lock
();
for
(
int
i
=
m_clients
.
size
()
-
1
;
i
>=
0
;
i
--
)
tmp
.
set_max
(
m_clients
[
i
].
m_logLevel
);
m_clients
.
unlock
();
update_log_level
(
tmp
);
}
void
Ndb_mgmd_event_service
::
update_log_level
(
const
LogLevel
&
tmp
)
{
if
(
!
(
tmp
==
m_logLevel
)){
m_logLevel
=
tmp
;
EventSubscribeReq
req
;
req
=
tmp
;
req
.
blockRef
=
0
;
m_mgmsrv
->
m_log_level_requests
.
push_back
(
req
);
}
m_logLevel
=
tmp
;
EventSubscribeReq
req
;
req
=
tmp
;
// send update to all nodes
req
.
blockRef
=
0
;
m_mgmsrv
->
m_log_level_requests
.
push_back
(
req
);
}
void
...
...
storage/ndb/src/ndbapi/ndberror.c
View file @
37d97b58
...
...
@@ -462,6 +462,7 @@ ErrorBundle ErrorCodes[] = {
{
1701
,
DMEC
,
AE
,
"Node already reserved"
},
{
1702
,
DMEC
,
AE
,
"Node already connected"
},
{
1703
,
DMEC
,
AE
,
"Node failure handling not completed"
},
{
1704
,
DMEC
,
AE
,
"Node type mismatch"
},
/**
* Still uncategorized
...
...
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