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
e8c9a137
Commit
e8c9a137
authored
Sep 17, 2004
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix backup event
parent
3323469d
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
90 additions
and
163 deletions
+90
-163
ndb/include/debugger/EventLogger.hpp
ndb/include/debugger/EventLogger.hpp
+2
-2
ndb/include/kernel/LogLevel.hpp
ndb/include/kernel/LogLevel.hpp
+18
-5
ndb/include/kernel/signaldata/EventSubscribeReq.hpp
ndb/include/kernel/signaldata/EventSubscribeReq.hpp
+6
-8
ndb/include/kernel/signaldata/SetLogLevelOrd.hpp
ndb/include/kernel/signaldata/SetLogLevelOrd.hpp
+8
-13
ndb/src/common/debugger/EventLogger.cpp
ndb/src/common/debugger/EventLogger.cpp
+21
-20
ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp
ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp
+10
-11
ndb/src/mgmsrv/MgmtSrvr.cpp
ndb/src/mgmsrv/MgmtSrvr.cpp
+22
-99
ndb/src/mgmsrv/Services.cpp
ndb/src/mgmsrv/Services.cpp
+3
-5
No files found.
ndb/include/debugger/EventLogger.hpp
View file @
e8c9a137
...
@@ -125,7 +125,7 @@ public:
...
@@ -125,7 +125,7 @@ public:
* @param theData the event data.
* @param theData the event data.
* @param nodeId the node id of event origin.
* @param nodeId the node id of event origin.
*/
*/
virtual
void
log
(
int
eventType
,
const
Uint32
*
theData
,
NodeId
nodeId
=
0
);
virtual
void
log
(
int
,
const
Uint32
*
,
NodeId
=
0
,
const
class
LogLevel
*
=
0
);
/**
/**
* Returns the event text for the specified event report type.
* Returns the event text for the specified event report type.
...
...
ndb/include/kernel/LogLevel.hpp
View file @
e8c9a137
...
@@ -88,6 +88,8 @@ public:
...
@@ -88,6 +88,8 @@ public:
return
memcmp
(
this
,
&
l
,
sizeof
(
*
this
))
==
0
;
return
memcmp
(
this
,
&
l
,
sizeof
(
*
this
))
==
0
;
}
}
LogLevel
&
operator
=
(
const
class
EventSubscribeReq
&
req
);
private:
private:
/**
/**
* The actual data
* The actual data
...
@@ -103,9 +105,7 @@ LogLevel::LogLevel(){
...
@@ -103,9 +105,7 @@ LogLevel::LogLevel(){
inline
inline
LogLevel
&
LogLevel
&
LogLevel
::
operator
=
(
const
LogLevel
&
org
){
LogLevel
::
operator
=
(
const
LogLevel
&
org
){
for
(
Uint32
i
=
0
;
i
<
LOGLEVEL_CATEGORIES
;
i
++
){
memcpy
(
logLevelData
,
org
.
logLevelData
,
sizeof
(
logLevelData
));
logLevelData
[
i
]
=
org
.
logLevelData
[
i
];
}
return
*
this
;
return
*
this
;
}
}
...
@@ -121,7 +121,7 @@ inline
...
@@ -121,7 +121,7 @@ inline
void
void
LogLevel
::
setLogLevel
(
EventCategory
ec
,
Uint32
level
){
LogLevel
::
setLogLevel
(
EventCategory
ec
,
Uint32
level
){
assert
(
ec
>=
0
&&
(
Uint32
)
ec
<
LOGLEVEL_CATEGORIES
);
assert
(
ec
>=
0
&&
(
Uint32
)
ec
<
LOGLEVEL_CATEGORIES
);
logLevelData
[
ec
]
=
level
;
logLevelData
[
ec
]
=
(
Uint8
)
level
;
}
}
inline
inline
...
@@ -129,7 +129,7 @@ Uint32
...
@@ -129,7 +129,7 @@ Uint32
LogLevel
::
getLogLevel
(
EventCategory
ec
)
const
{
LogLevel
::
getLogLevel
(
EventCategory
ec
)
const
{
assert
(
ec
>=
0
&&
(
Uint32
)
ec
<
LOGLEVEL_CATEGORIES
);
assert
(
ec
>=
0
&&
(
Uint32
)
ec
<
LOGLEVEL_CATEGORIES
);
return
logLevelData
[
ec
];
return
(
Uint32
)
logLevelData
[
ec
];
}
}
inline
inline
...
@@ -142,4 +142,17 @@ LogLevel::set_max(const LogLevel & org){
...
@@ -142,4 +142,17 @@ LogLevel::set_max(const LogLevel & org){
return
*
this
;
return
*
this
;
}
}
#include <signaldata/EventSubscribeReq.hpp>
inline
LogLevel
&
LogLevel
::
operator
=
(
const
EventSubscribeReq
&
req
)
{
clear
();
for
(
size_t
i
=
0
;
i
<
req
.
noOfEntries
;
i
++
){
logLevelData
[(
req
.
theData
[
i
]
>>
16
)]
=
req
.
theData
[
i
]
&
0xFFFF
;
}
return
*
this
;
}
#endif
#endif
ndb/include/kernel/signaldata/EventSubscribeReq.hpp
View file @
e8c9a137
...
@@ -38,7 +38,7 @@ struct EventSubscribeReq {
...
@@ -38,7 +38,7 @@ struct EventSubscribeReq {
*/
*/
friend
class
MgmtSrvr
;
friend
class
MgmtSrvr
;
STATIC_CONST
(
SignalLength
=
2
2
);
STATIC_CONST
(
SignalLength
=
2
+
LogLevel
::
LOGLEVEL_CATEGORIES
);
/**
/**
* Note: If you use the same blockRef as you have used earlier,
* Note: If you use the same blockRef as you have used earlier,
...
@@ -52,14 +52,12 @@ struct EventSubscribeReq {
...
@@ -52,14 +52,12 @@ struct EventSubscribeReq {
*/
*/
Uint32
noOfEntries
;
Uint32
noOfEntries
;
Uint32
theCategories
[
10
];
Uint32
theData
[
LogLevel
::
LOGLEVEL_CATEGORIES
];
Uint32
theLevels
[
10
];
EventSubscribeReq
&
operator
=
(
const
LogLevel
&
ll
){
EventSubscribeReq
&
operator
=
(
const
LogLevel
&
ll
){
noOfEntries
=
_
LOGLEVEL_CATEGORIES
;
noOfEntries
=
LogLevel
::
LOGLEVEL_CATEGORIES
;
for
(
size_t
i
=
0
;
i
<
noOfEntries
;
i
++
){
for
(
size_t
i
=
0
;
i
<
noOfEntries
;
i
++
){
theCategories
[
i
]
=
i
;
theData
[
i
]
=
(
i
<<
16
)
|
ll
.
getLogLevel
((
LogLevel
::
EventCategory
)
i
);
theLevels
[
i
]
=
ll
.
getLogLevel
((
LogLevel
::
EventCategory
)
i
);
}
}
return
*
this
;
return
*
this
;
}
}
...
...
ndb/include/kernel/signaldata/SetLogLevelOrd.hpp
View file @
e8c9a137
...
@@ -40,11 +40,10 @@ class SetLogLevelOrd {
...
@@ -40,11 +40,10 @@ class SetLogLevelOrd {
friend
class
NodeLogLevel
;
friend
class
NodeLogLevel
;
private:
private:
STATIC_CONST
(
SignalLength
=
25
);
STATIC_CONST
(
SignalLength
=
1
+
LogLevel
::
LOGLEVEL_CATEGORIES
);
Uint32
noOfEntries
;
Uint32
noOfEntries
;
Uint32
theCategories
[
12
];
Uint32
theData
[
LogLevel
::
LOGLEVEL_CATEGORIES
];
Uint32
theLevels
[
12
];
void
clear
();
void
clear
();
...
@@ -54,10 +53,9 @@ private:
...
@@ -54,10 +53,9 @@ private:
void
setLogLevel
(
LogLevel
::
EventCategory
ec
,
int
level
=
7
);
void
setLogLevel
(
LogLevel
::
EventCategory
ec
,
int
level
=
7
);
SetLogLevelOrd
&
operator
=
(
const
LogLevel
&
ll
){
SetLogLevelOrd
&
operator
=
(
const
LogLevel
&
ll
){
noOfEntries
=
_
LOGLEVEL_CATEGORIES
;
noOfEntries
=
LogLevel
::
LOGLEVEL_CATEGORIES
;
for
(
size_t
i
=
0
;
i
<
noOfEntries
;
i
++
){
for
(
size_t
i
=
0
;
i
<
noOfEntries
;
i
++
){
theCategories
[
i
]
=
i
;
theData
[
i
]
=
(
i
<<
16
)
|
ll
.
getLogLevel
((
LogLevel
::
EventCategory
)
i
);
theLevels
[
i
]
=
ll
.
getLogLevel
((
LogLevel
::
EventCategory
)
i
);
}
}
return
*
this
;
return
*
this
;
}
}
...
@@ -65,8 +63,7 @@ private:
...
@@ -65,8 +63,7 @@ private:
SetLogLevelOrd
&
operator
=
(
const
EventSubscribeReq
&
ll
){
SetLogLevelOrd
&
operator
=
(
const
EventSubscribeReq
&
ll
){
noOfEntries
=
ll
.
noOfEntries
;
noOfEntries
=
ll
.
noOfEntries
;
for
(
size_t
i
=
0
;
i
<
noOfEntries
;
i
++
){
for
(
size_t
i
=
0
;
i
<
noOfEntries
;
i
++
){
theCategories
[
i
]
=
ll
.
theCategories
[
i
];
theData
[
i
]
=
ll
.
theData
[
i
];
theLevels
[
i
]
=
ll
.
theLevels
[
i
];
}
}
return
*
this
;
return
*
this
;
}
}
...
@@ -81,9 +78,7 @@ SetLogLevelOrd::clear(){
...
@@ -81,9 +78,7 @@ SetLogLevelOrd::clear(){
inline
inline
void
void
SetLogLevelOrd
::
setLogLevel
(
LogLevel
::
EventCategory
ec
,
int
level
){
SetLogLevelOrd
::
setLogLevel
(
LogLevel
::
EventCategory
ec
,
int
level
){
assert
(
noOfEntries
<
12
);
theData
[
noOfEntries
]
=
(
ec
<<
16
)
|
level
;
theCategories
[
noOfEntries
]
=
ec
;
theLevels
[
noOfEntries
]
=
level
;
noOfEntries
++
;
noOfEntries
++
;
}
}
...
...
ndb/src/common/debugger/EventLogger.cpp
View file @
e8c9a137
...
@@ -793,8 +793,6 @@ EventLogger::getText(char * m_text, size_t m_text_len,
...
@@ -793,8 +793,6 @@ EventLogger::getText(char * m_text, size_t m_text_len,
);
);
break
;
break
;
}
}
case
EventReport
:
:
GrepSubscriptionInfo
:
case
EventReport
:
:
GrepSubscriptionInfo
:
{
{
GrepEvent
::
Subscription
event
=
(
GrepEvent
::
Subscription
)
theData
[
1
];
GrepEvent
::
Subscription
event
=
(
GrepEvent
::
Subscription
)
theData
[
1
];
...
@@ -1308,16 +1306,7 @@ EventLogger::getText(char * m_text, size_t m_text_len,
...
@@ -1308,16 +1306,7 @@ EventLogger::getText(char * m_text, size_t m_text_len,
EventLogger
::
EventLogger
()
:
m_filterLevel
(
15
)
EventLogger
::
EventLogger
()
:
m_filterLevel
(
15
)
{
{
setCategory
(
"EventLogger"
);
setCategory
(
"EventLogger"
);
m_logLevel
.
setLogLevel
(
LogLevel
::
llStartUp
,
m_filterLevel
);
enable
(
Logger
::
Logger
::
LL_INFO
,
Logger
::
Logger
::
LL_ALERT
);
m_logLevel
.
setLogLevel
(
LogLevel
::
llShutdown
,
m_filterLevel
);
m_logLevel
.
setLogLevel
(
LogLevel
::
llStatistic
,
m_filterLevel
);
m_logLevel
.
setLogLevel
(
LogLevel
::
llCheckpoint
,
m_filterLevel
);
m_logLevel
.
setLogLevel
(
LogLevel
::
llNodeRestart
,
m_filterLevel
);
m_logLevel
.
setLogLevel
(
LogLevel
::
llConnection
,
m_filterLevel
);
m_logLevel
.
setLogLevel
(
LogLevel
::
llError
,
m_filterLevel
);
m_logLevel
.
setLogLevel
(
LogLevel
::
llInfo
,
m_filterLevel
);
enable
(
Logger
::
Logger
::
LL_INFO
,
Logger
::
Logger
::
LL_ALERT
);
// Log INFO to ALERT
}
}
EventLogger
::~
EventLogger
()
EventLogger
::~
EventLogger
()
...
@@ -1338,23 +1327,35 @@ EventLogger::close()
...
@@ -1338,23 +1327,35 @@ EventLogger::close()
removeAllHandlers
();
removeAllHandlers
();
}
}
static
NdbOut
&
operator
<<
(
NdbOut
&
out
,
const
LogLevel
&
ll
)
{
out
<<
"[LogLevel: "
;
for
(
size_t
i
=
0
;
i
<
LogLevel
::
LOGLEVEL_CATEGORIES
;
i
++
)
out
<<
ll
.
getLogLevel
((
LogLevel
::
EventCategory
)
i
)
<<
" "
;
out
<<
"]"
;
return
out
;
}
void
void
EventLogger
::
log
(
int
eventType
,
const
Uint32
*
theData
,
NodeId
nodeId
)
EventLogger
::
log
(
int
eventType
,
const
Uint32
*
theData
,
NodeId
nodeId
,
const
LogLevel
*
ll
)
{
{
Uint32
threshold
=
0
;
Uint32
threshold
=
0
;
Logger
::
LoggerLevel
severity
=
Logger
::
LL_WARNING
;
Logger
::
LoggerLevel
severity
=
Logger
::
LL_WARNING
;
LogLevel
::
EventCategory
cat
;
LogLevel
::
EventCategory
cat
;
for
(
unsigned
i
=
0
;
i
<
EventLogger
::
matrixSize
;
i
++
){
for
(
unsigned
i
=
0
;
i
<
EventLogger
Base
::
matrixSize
;
i
++
){
if
(
EventLogger
::
matrix
[
i
].
eventType
==
eventType
){
if
(
EventLogger
Base
::
matrix
[
i
].
eventType
==
eventType
){
cat
=
EventLogger
::
matrix
[
i
].
eventCategory
;
cat
=
EventLogger
Base
::
matrix
[
i
].
eventCategory
;
threshold
=
EventLogger
::
matrix
[
i
].
threshold
;
threshold
=
EventLogger
Base
::
matrix
[
i
].
threshold
;
severity
=
EventLogger
::
matrix
[
i
].
severity
;
severity
=
EventLogger
Base
::
matrix
[
i
].
severity
;
break
;
break
;
}
}
}
}
if
(
threshold
<=
m_logLevel
.
getLogLevel
(
cat
)){
Uint32
set
=
ll
?
ll
->
getLogLevel
(
cat
)
:
m_logLevel
.
getLogLevel
(
cat
);
if
(
threshold
<=
set
){
switch
(
severity
){
switch
(
severity
){
case
Logger
:
:
LL_ALERT
:
case
Logger
:
:
LL_ALERT
:
alert
(
EventLogger
::
getText
(
m_text
,
sizeof
(
m_text
),
alert
(
EventLogger
::
getText
(
m_text
,
sizeof
(
m_text
),
...
...
ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp
View file @
e8c9a137
...
@@ -169,8 +169,8 @@ void Cmvmi::execSET_LOGLEVELORD(Signal* signal)
...
@@ -169,8 +169,8 @@ void Cmvmi::execSET_LOGLEVELORD(Signal* signal)
jamEntry
();
jamEntry
();
for
(
unsigned
int
i
=
0
;
i
<
llOrd
->
noOfEntries
;
i
++
){
for
(
unsigned
int
i
=
0
;
i
<
llOrd
->
noOfEntries
;
i
++
){
category
=
(
LogLevel
::
EventCategory
)
llOrd
->
theCategories
[
i
]
;
category
=
(
LogLevel
::
EventCategory
)
(
llOrd
->
theData
[
i
]
>>
16
)
;
level
=
llOrd
->
the
Levels
[
i
]
;
level
=
llOrd
->
the
Data
[
i
]
&
0xFFFF
;
clogLevel
.
setLogLevel
(
category
,
level
);
clogLevel
.
setLogLevel
(
category
,
level
);
}
}
...
@@ -196,10 +196,10 @@ void Cmvmi::execEVENT_REP(Signal* signal)
...
@@ -196,10 +196,10 @@ void Cmvmi::execEVENT_REP(Signal* signal)
Uint32
threshold
=
16
;
Uint32
threshold
=
16
;
LogLevel
::
EventCategory
eventCategory
=
(
LogLevel
::
EventCategory
)
0
;
LogLevel
::
EventCategory
eventCategory
=
(
LogLevel
::
EventCategory
)
0
;
for
(
unsigned
int
i
=
0
;
i
<
EventLogger
::
matrixSize
;
i
++
){
for
(
unsigned
int
i
=
0
;
i
<
EventLogger
Base
::
matrixSize
;
i
++
){
if
(
EventLogger
::
matrix
[
i
].
eventType
==
eventType
){
if
(
EventLogger
Base
::
matrix
[
i
].
eventType
==
eventType
){
eventCategory
=
EventLogger
::
matrix
[
i
].
eventCategory
;
eventCategory
=
EventLogger
Base
::
matrix
[
i
].
eventCategory
;
threshold
=
EventLogger
::
matrix
[
i
].
threshold
;
threshold
=
EventLogger
Base
::
matrix
[
i
].
threshold
;
break
;
break
;
}
}
}
}
...
@@ -266,10 +266,9 @@ Cmvmi::execEVENT_SUBSCRIBE_REQ(Signal * signal){
...
@@ -266,10 +266,9 @@ Cmvmi::execEVENT_SUBSCRIBE_REQ(Signal * signal){
LogLevel
::
EventCategory
category
;
LogLevel
::
EventCategory
category
;
Uint32
level
=
0
;
Uint32
level
=
0
;
for
(
Uint32
i
=
0
;
i
<
subReq
->
noOfEntries
;
i
++
){
for
(
Uint32
i
=
0
;
i
<
subReq
->
noOfEntries
;
i
++
){
category
=
(
LogLevel
::
EventCategory
)
subReq
->
theCategories
[
i
];
category
=
(
LogLevel
::
EventCategory
)(
subReq
->
theData
[
i
]
>>
16
);
level
=
subReq
->
theLevels
[
i
];
level
=
subReq
->
theData
[
i
]
&
0xFFFF
;
ptr
.
p
->
logLevel
.
setLogLevel
(
category
,
ptr
.
p
->
logLevel
.
setLogLevel
(
category
,
level
);
level
);
}
}
}
}
...
...
ndb/src/mgmsrv/MgmtSrvr.cpp
View file @
e8c9a137
...
@@ -133,6 +133,16 @@ MgmtSrvr::signalRecvThreadRun()
...
@@ -133,6 +133,16 @@ MgmtSrvr::signalRecvThreadRun()
EventLogger
g_EventLogger
;
EventLogger
g_EventLogger
;
static
NdbOut
&
operator
<<
(
NdbOut
&
out
,
const
LogLevel
&
ll
)
{
out
<<
"[LogLevel: "
;
for
(
size_t
i
=
0
;
i
<
LogLevel
::
LOGLEVEL_CATEGORIES
;
i
++
)
out
<<
ll
.
getLogLevel
((
LogLevel
::
EventCategory
)
i
)
<<
" "
;
out
<<
"]"
;
return
out
;
}
void
void
MgmtSrvr
::
logLevelThreadRun
()
MgmtSrvr
::
logLevelThreadRun
()
{
{
...
@@ -167,6 +177,10 @@ MgmtSrvr::logLevelThreadRun()
...
@@ -167,6 +177,10 @@ MgmtSrvr::logLevelThreadRun()
m_log_level_requests
.
erase
(
0
,
false
);
m_log_level_requests
.
erase
(
0
,
false
);
m_log_level_requests
.
unlock
();
m_log_level_requests
.
unlock
();
LogLevel
tmp
;
tmp
=
req
;
ndbout
<<
"req3: "
<<
tmp
<<
endl
;
if
(
req
.
blockRef
==
0
){
if
(
req
.
blockRef
==
0
){
req
.
blockRef
=
_ownReference
;
req
.
blockRef
=
_ownReference
;
setEventReportingLevelImpl
(
0
,
req
);
setEventReportingLevelImpl
(
0
,
req
);
...
@@ -564,9 +578,11 @@ MgmtSrvr::MgmtSrvr(NodeId nodeId,
...
@@ -564,9 +578,11 @@ MgmtSrvr::MgmtSrvr(NodeId nodeId,
{
{
MgmStatService
::
StatListener
se
;
MgmStatService
::
StatListener
se
;
se
.
m_socket
=
-
1
;
se
.
m_socket
=
-
1
;
for
(
size_t
t
=
0
;
t
<
LogLevel
::
LOGLEVEL_CATEGORIES
;
t
++
)
for
(
size_t
t
=
0
;
t
<
LogLevel
::
LOGLEVEL_CATEGORIES
;
t
++
)
{
se
.
m_logLevel
.
setLogLevel
((
LogLevel
::
EventCategory
)
t
,
7
);
se
.
m_logLevel
.
setLogLevel
((
LogLevel
::
EventCategory
)
t
,
7
);
}
se
.
m_logLevel
.
setLogLevel
(
LogLevel
::
llError
,
15
);
se
.
m_logLevel
.
setLogLevel
(
LogLevel
::
llError
,
15
);
se
.
m_logLevel
.
setLogLevel
(
LogLevel
::
llBackup
,
15
);
m_statisticsListner
.
m_clients
.
push_back
(
se
);
m_statisticsListner
.
m_clients
.
push_back
(
se
);
m_statisticsListner
.
m_logLevel
=
se
.
m_logLevel
;
m_statisticsListner
.
m_logLevel
=
se
.
m_logLevel
;
}
}
...
@@ -1557,8 +1573,8 @@ MgmtSrvr::send(NdbApiSignal* signal, Uint32 node, Uint32 node_type){
...
@@ -1557,8 +1573,8 @@ MgmtSrvr::send(NdbApiSignal* signal, Uint32 node, Uint32 node_type){
Uint32
max
=
(
node
==
0
)
?
MAX_NODES
:
node
+
1
;
Uint32
max
=
(
node
==
0
)
?
MAX_NODES
:
node
+
1
;
for
(;
node
<
max
;
node
++
){
for
(;
node
<
max
;
node
++
){
while
(
nodeTypes
[
node
]
!=
node_type
&&
node
<
max
)
node
++
;
while
(
nodeTypes
[
node
]
!=
(
int
)
node_type
&&
node
<
max
)
node
++
;
if
(
nodeTypes
[
node
]
!=
node_type
)
if
(
nodeTypes
[
node
]
!=
(
int
)
node_type
)
break
;
break
;
theFacade
->
sendSignalUnCond
(
signal
,
node
);
theFacade
->
sendSignalUnCond
(
signal
,
node
);
}
}
...
@@ -1969,7 +1985,6 @@ MgmtSrvr::handleReceivedSignal(NdbApiSignal* signal)
...
@@ -1969,7 +1985,6 @@ MgmtSrvr::handleReceivedSignal(NdbApiSignal* signal)
event
.
Completed
.
NoOfLogBytes
=
rep
->
noOfLogBytes
;
event
.
Completed
.
NoOfLogBytes
=
rep
->
noOfLogBytes
;
event
.
Completed
.
NoOfRecords
=
rep
->
noOfRecords
;
event
.
Completed
.
NoOfRecords
=
rep
->
noOfRecords
;
event
.
Completed
.
NoOfLogRecords
=
rep
->
noOfLogRecords
;
event
.
Completed
.
NoOfLogRecords
=
rep
->
noOfLogRecords
;
event
.
Completed
.
stopGCP
=
rep
->
stopGCP
;
event
.
Completed
.
stopGCP
=
rep
->
stopGCP
;
event
.
Completed
.
startGCP
=
rep
->
startGCP
;
event
.
Completed
.
startGCP
=
rep
->
startGCP
;
event
.
Nodes
=
rep
->
nodes
;
event
.
Nodes
=
rep
->
nodes
;
...
@@ -2352,9 +2367,9 @@ MgmtSrvr::eventReport(NodeId nodeId, const Uint32 * theData)
...
@@ -2352,9 +2367,9 @@ MgmtSrvr::eventReport(NodeId nodeId, const Uint32 * theData)
const
EventReport
*
const
eventReport
=
(
EventReport
*
)
&
theData
[
0
];
const
EventReport
*
const
eventReport
=
(
EventReport
*
)
&
theData
[
0
];
EventReport
::
EventType
type
=
eventReport
->
getEventType
();
EventReport
::
EventType
type
=
eventReport
->
getEventType
();
// Log event
// Log event
g_EventLogger
.
log
(
type
,
theData
,
nodeId
);
g_EventLogger
.
log
(
type
,
theData
,
nodeId
,
&
m_statisticsListner
.
m_clients
[
0
].
m_logLevel
);
m_statisticsListner
.
log
(
type
,
theData
,
nodeId
);
m_statisticsListner
.
log
(
type
,
theData
,
nodeId
);
}
}
...
@@ -2467,98 +2482,6 @@ MgmtSrvr::abortBackup(Uint32 backupId)
...
@@ -2467,98 +2482,6 @@ MgmtSrvr::abortBackup(Uint32 backupId)
void
void
MgmtSrvr
::
backupCallback
(
BackupEvent
&
event
)
MgmtSrvr
::
backupCallback
(
BackupEvent
&
event
)
{
{
char
str
[
255
];
bool
ok
=
false
;
switch
(
event
.
Event
){
case
BackupEvent
:
:
BackupStarted
:
ok
=
true
;
snprintf
(
str
,
sizeof
(
str
),
"Backup %d started"
,
event
.
Started
.
BackupId
);
break
;
case
BackupEvent
:
:
BackupFailedToStart
:
ok
=
true
;
snprintf
(
str
,
sizeof
(
str
),
"Backup failed to start (Backup error %d)"
,
event
.
FailedToStart
.
ErrorCode
);
break
;
case
BackupEvent
:
:
BackupCompleted
:
ok
=
true
;
snprintf
(
str
,
sizeof
(
str
),
"Backup %d completed"
,
event
.
Completed
.
BackupId
);
g_EventLogger
.
info
(
str
);
snprintf
(
str
,
sizeof
(
str
),
" StartGCP: %d StopGCP: %d"
,
event
.
Completed
.
startGCP
,
event
.
Completed
.
stopGCP
);
g_EventLogger
.
info
(
str
);
snprintf
(
str
,
sizeof
(
str
),
" #Records: %d #LogRecords: %d"
,
event
.
Completed
.
NoOfRecords
,
event
.
Completed
.
NoOfLogRecords
);
g_EventLogger
.
info
(
str
);
snprintf
(
str
,
sizeof
(
str
),
" Data: %d bytes Log: %d bytes"
,
event
.
Completed
.
NoOfBytes
,
event
.
Completed
.
NoOfLogBytes
);
break
;
case
BackupEvent
:
:
BackupAborted
:
ok
=
true
;
snprintf
(
str
,
sizeof
(
str
),
"Backup %d has been aborted reason %d"
,
event
.
Aborted
.
BackupId
,
event
.
Aborted
.
Reason
);
break
;
}
if
(
!
ok
){
snprintf
(
str
,
sizeof
(
str
),
"Unknown backup event: %d"
,
event
.
Event
);
}
g_EventLogger
.
info
(
str
);
switch
(
theWaitState
){
case
WAIT_BACKUP_STARTED
:
switch
(
event
.
Event
){
case
BackupEvent
:
:
BackupStarted
:
case
BackupEvent
:
:
BackupFailedToStart
:
m_lastBackupEvent
=
event
;
theWaitState
=
NO_WAIT
;
break
;
default:
snprintf
(
str
,
sizeof
(
str
),
"Received event %d in unexpected state WAIT_BACKUP_STARTED"
,
event
.
Event
);
g_EventLogger
.
info
(
str
);
return
;
}
break
;
case
WAIT_BACKUP_COMPLETED
:
switch
(
event
.
Event
){
case
BackupEvent
:
:
BackupCompleted
:
case
BackupEvent
:
:
BackupAborted
:
case
BackupEvent
:
:
BackupFailedToStart
:
m_lastBackupEvent
=
event
;
theWaitState
=
NO_WAIT
;
break
;
default:
snprintf
(
str
,
sizeof
(
str
),
"Received event %d in unexpected state WAIT_BACKUP_COMPLETED"
,
event
.
Event
);
g_EventLogger
.
info
(
str
);
return
;
}
break
;
default:
snprintf
(
str
,
sizeof
(
str
),
"Received event %d in unexpected state = %d"
,
event
.
Event
,
theWaitState
);
g_EventLogger
.
info
(
str
);
return
;
}
}
}
...
...
ndb/src/mgmsrv/Services.cpp
View file @
e8c9a137
...
@@ -780,8 +780,7 @@ MgmApiSession::setClusterLogLevel(Parser<MgmApiSession>::Context &,
...
@@ -780,8 +780,7 @@ MgmApiSession::setClusterLogLevel(Parser<MgmApiSession>::Context &,
EventSubscribeReq
req
;
EventSubscribeReq
req
;
req
.
blockRef
=
0
;
req
.
blockRef
=
0
;
req
.
noOfEntries
=
1
;
req
.
noOfEntries
=
1
;
req
.
theCategories
[
0
]
=
category
;
req
.
theData
[
0
]
=
(
category
<<
16
)
|
level
;
req
.
theLevels
[
0
]
=
level
;
m_mgmsrv
.
m_log_level_requests
.
push_back
(
req
);
m_mgmsrv
.
m_log_level_requests
.
push_back
(
req
);
m_output
->
println
(
"set cluster loglevel reply"
);
m_output
->
println
(
"set cluster loglevel reply"
);
...
@@ -815,8 +814,7 @@ MgmApiSession::setLogLevel(Parser<MgmApiSession>::Context &,
...
@@ -815,8 +814,7 @@ MgmApiSession::setLogLevel(Parser<MgmApiSession>::Context &,
EventSubscribeReq
req
;
EventSubscribeReq
req
;
req
.
blockRef
=
node
;
req
.
blockRef
=
node
;
req
.
noOfEntries
=
1
;
req
.
noOfEntries
=
1
;
req
.
theCategories
[
0
]
=
category
;
req
.
theData
[
0
]
=
(
category
<<
16
)
|
level
;
req
.
theLevels
[
0
]
=
level
;
m_mgmsrv
.
m_log_level_requests
.
push_back
(
req
);
m_mgmsrv
.
m_log_level_requests
.
push_back
(
req
);
m_output
->
println
(
"set loglevel reply"
);
m_output
->
println
(
"set loglevel reply"
);
...
@@ -1239,7 +1237,7 @@ MgmApiSession::configChange(Parser_t::Context &,
...
@@ -1239,7 +1237,7 @@ MgmApiSession::configChange(Parser_t::Context &,
m_output
->
println
(
""
);
m_output
->
println
(
""
);
}
}
NdbOut
&
static
NdbOut
&
operator
<<
(
NdbOut
&
out
,
const
LogLevel
&
ll
)
operator
<<
(
NdbOut
&
out
,
const
LogLevel
&
ll
)
{
{
out
<<
"[LogLevel: "
;
out
<<
"[LogLevel: "
;
...
...
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