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
8dfb6b3f
Commit
8dfb6b3f
authored
Sep 17, 2004
by
joreland@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added EventReport for backup
parent
31ba0b2b
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
537 additions
and
534 deletions
+537
-534
ndb/include/kernel/LogLevel.hpp
ndb/include/kernel/LogLevel.hpp
+2
-1
ndb/include/kernel/signaldata/EventReport.hpp
ndb/include/kernel/signaldata/EventReport.hpp
+8
-3
ndb/include/mgmapi/mgmapi.h
ndb/include/mgmapi/mgmapi.h
+1
-0
ndb/include/mgmapi/mgmapi_config_parameters.h
ndb/include/mgmapi/mgmapi_config_parameters.h
+2
-1
ndb/src/common/debugger/EventLogger.cpp
ndb/src/common/debugger/EventLogger.cpp
+492
-454
ndb/src/kernel/blocks/backup/Backup.cpp
ndb/src/kernel/blocks/backup/Backup.cpp
+31
-1
ndb/src/mgmapi/mgmapi.cpp
ndb/src/mgmapi/mgmapi.cpp
+1
-0
ndb/src/mgmsrv/MgmtSrvr.cpp
ndb/src/mgmsrv/MgmtSrvr.cpp
+0
-71
ndb/src/mgmsrv/MgmtSrvr.hpp
ndb/src/mgmsrv/MgmtSrvr.hpp
+0
-3
No files found.
ndb/include/kernel/LogLevel.hpp
View file @
8dfb6b3f
...
...
@@ -57,7 +57,8 @@ public:
llWarning
=
CFG_LOGLEVEL_WARNING
-
CFG_MIN_LOGLEVEL
,
llError
=
CFG_LOGLEVEL_ERROR
-
CFG_MIN_LOGLEVEL
,
llGrep
=
CFG_LOGLEVEL_GREP
-
CFG_MIN_LOGLEVEL
,
llDebug
=
CFG_LOGLEVEL_DEBUG
-
CFG_MIN_LOGLEVEL
,
llDebug
=
CFG_LOGLEVEL_DEBUG
-
CFG_MIN_LOGLEVEL
,
llBackup
=
CFG_LOGLEVEL_BACKUP
-
CFG_MIN_LOGLEVEL
};
/**
...
...
ndb/include/kernel/signaldata/EventReport.hpp
View file @
8dfb6b3f
...
...
@@ -135,12 +135,17 @@ public:
//GREP
GrepSubscriptionInfo
=
52
,
GrepSubscriptionAlert
=
53
};
GrepSubscriptionAlert
=
53
,
//BACKUP
BackupStarted
=
54
,
BackupFailedToStart
=
55
,
BackupCompleted
=
56
,
BackupAborted
=
57
};
void
setEventType
(
EventType
type
);
EventType
getEventType
()
const
;
private:
UintR
eventType
;
// DATA 0
};
...
...
ndb/include/mgmapi/mgmapi.h
View file @
8dfb6b3f
...
...
@@ -277,6 +277,7 @@ extern "C" {
NDB_MGM_EVENT_CATEGORY_WARNING
=
CFG_LOGLEVEL_WARNING
,
NDB_MGM_EVENT_CATEGORY_ERROR
=
CFG_LOGLEVEL_ERROR
,
NDB_MGM_EVENT_CATEGORY_GREP
=
CFG_LOGLEVEL_GREP
,
NDB_MGM_EVENT_CATEGORY_BACKUP
=
CFG_LOGLEVEL_BACKUP
,
NDB_MGM_MIN_EVENT_CATEGORY
=
CFG_MIN_LOGLEVEL
,
NDB_MGM_MAX_EVENT_CATEGORY
=
CFG_MAX_LOGLEVEL
...
...
ndb/include/mgmapi/mgmapi_config_parameters.h
View file @
8dfb6b3f
...
...
@@ -96,7 +96,8 @@
#define CFG_LOGLEVEL_ERROR 258
#define CFG_LOGLEVEL_GREP 259
#define CFG_LOGLEVEL_DEBUG 260
#define CFG_MAX_LOGLEVEL 260
#define CFG_LOGLEVEL_BACKUP 261
#define CFG_MAX_LOGLEVEL 261
#define CFG_MGM_PORT 300
...
...
ndb/src/common/debugger/EventLogger.cpp
View file @
8dfb6b3f
This diff is collapsed.
Click to expand it.
ndb/src/kernel/blocks/backup/Backup.cpp
View file @
8dfb6b3f
...
...
@@ -40,6 +40,7 @@
#include <signaldata/BackupImpl.hpp>
#include <signaldata/BackupSignalData.hpp>
#include <signaldata/BackupContinueB.hpp>
#include <signaldata/EventReport.hpp>
#include <signaldata/UtilSequence.hpp>
...
...
@@ -944,6 +945,11 @@ Backup::sendBackupRef(BlockReference senderRef, Signal *signal,
ref
->
errorCode
=
errorCode
;
ref
->
masterRef
=
numberToRef
(
BACKUP
,
getMasterNodeId
());
sendSignal
(
senderRef
,
GSN_BACKUP_REF
,
signal
,
BackupRef
::
SignalLength
,
JBB
);
signal
->
theData
[
0
]
=
EventReport
::
BackupFailedToStart
;
signal
->
theData
[
1
]
=
senderRef
;
signal
->
theData
[
2
]
=
errorCode
;
sendSignal
(
CMVMI_REF
,
GSN_EVENT_REP
,
signal
,
3
,
JBB
);
}
void
...
...
@@ -1226,7 +1232,13 @@ Backup::defineBackupReply(Signal* signal, BackupRecordPtr ptr, Uint32 nodeId)
conf
->
nodes
=
ptr
.
p
->
nodes
;
sendSignal
(
ptr
.
p
->
clientRef
,
GSN_BACKUP_CONF
,
signal
,
BackupConf
::
SignalLength
,
JBB
);
signal
->
theData
[
0
]
=
EventReport
::
BackupStarted
;
signal
->
theData
[
1
]
=
ptr
.
p
->
clientRef
;
signal
->
theData
[
2
]
=
ptr
.
p
->
backupId
;
ptr
.
p
->
nodes
.
copyto
(
NdbNodeBitmask
::
Size
,
signal
->
theData
+
3
);
sendSignal
(
CMVMI_REF
,
GSN_EVENT_REP
,
signal
,
3
+
NdbNodeBitmask
::
Size
,
JBB
);
ptr
.
p
->
masterData
.
state
.
setState
(
DEFINED
);
/**
* Prepare Trig
...
...
@@ -2069,6 +2081,18 @@ Backup::stopBackupReply(Signal* signal, BackupRecordPtr ptr, Uint32 nodeId)
rep
->
nodes
=
ptr
.
p
->
nodes
;
sendSignal
(
ptr
.
p
->
clientRef
,
GSN_BACKUP_COMPLETE_REP
,
signal
,
BackupCompleteRep
::
SignalLength
,
JBB
);
signal
->
theData
[
0
]
=
EventReport
::
BackupCompleted
;
signal
->
theData
[
1
]
=
ptr
.
p
->
clientRef
;
signal
->
theData
[
2
]
=
ptr
.
p
->
backupId
;
signal
->
theData
[
3
]
=
ptr
.
p
->
startGCP
;
signal
->
theData
[
4
]
=
ptr
.
p
->
stopGCP
;
signal
->
theData
[
5
]
=
ptr
.
p
->
noOfBytes
;
signal
->
theData
[
6
]
=
ptr
.
p
->
noOfRecords
;
signal
->
theData
[
7
]
=
ptr
.
p
->
noOfLogBytes
;
signal
->
theData
[
8
]
=
ptr
.
p
->
noOfLogRecords
;
ptr
.
p
->
nodes
.
copyto
(
NdbNodeBitmask
::
Size
,
signal
->
theData
+
9
);
sendSignal
(
CMVMI_REF
,
GSN_EVENT_REP
,
signal
,
9
+
NdbNodeBitmask
::
Size
,
JBB
);
}
/*****************************************************************************
...
...
@@ -2259,6 +2283,12 @@ Backup::masterSendAbortBackup(Signal* signal, BackupRecordPtr ptr)
rep
->
reason
=
ptr
.
p
->
errorCode
;
sendSignal
(
ptr
.
p
->
clientRef
,
GSN_BACKUP_ABORT_REP
,
signal
,
BackupAbortRep
::
SignalLength
,
JBB
);
signal
->
theData
[
0
]
=
EventReport
::
BackupAborted
;
signal
->
theData
[
1
]
=
ptr
.
p
->
clientRef
;
signal
->
theData
[
2
]
=
ptr
.
p
->
backupId
;
signal
->
theData
[
3
]
=
ptr
.
p
->
errorCode
;
sendSignal
(
CMVMI_REF
,
GSN_EVENT_REP
,
signal
,
4
,
JBB
);
}
//if
// ptr.p->masterData.state.setState(INITIAL);
...
...
ndb/src/mgmapi/mgmapi.cpp
View file @
8dfb6b3f
...
...
@@ -965,6 +965,7 @@ struct ndb_mgm_event_categories
{
"INFO"
,
NDB_MGM_EVENT_CATEGORY_INFO
},
{
"ERROR"
,
NDB_MGM_EVENT_CATEGORY_ERROR
},
{
"GREP"
,
NDB_MGM_EVENT_CATEGORY_GREP
},
{
"BACKUP"
,
NDB_MGM_EVENT_CATEGORY_BACKUP
},
{
0
,
NDB_MGM_ILLEGAL_EVENT_CATEGORY
}
};
...
...
ndb/src/mgmsrv/MgmtSrvr.cpp
View file @
8dfb6b3f
...
...
@@ -63,63 +63,6 @@
extern
int
global_flag_send_heartbeat_now
;
extern
int
g_no_nodeid_checks
;
static
void
CmdBackupCallback
(
const
MgmtSrvr
::
BackupEvent
&
event
)
{
char
str
[
255
];
ndbout
<<
endl
;
bool
ok
=
false
;
switch
(
event
.
Event
){
case
MgmtSrvr
:
:
BackupEvent
::
BackupStarted
:
ok
=
true
;
snprintf
(
str
,
sizeof
(
str
),
"Backup %d started"
,
event
.
Started
.
BackupId
);
break
;
case
MgmtSrvr
:
:
BackupEvent
::
BackupFailedToStart
:
ok
=
true
;
snprintf
(
str
,
sizeof
(
str
),
"Backup failed to start (Error %d)"
,
event
.
FailedToStart
.
ErrorCode
);
break
;
case
MgmtSrvr
:
:
BackupEvent
::
BackupCompleted
:
ok
=
true
;
snprintf
(
str
,
sizeof
(
str
),
"Backup %d completed"
,
event
.
Completed
.
BackupId
);
ndbout
<<
str
<<
endl
;
snprintf
(
str
,
sizeof
(
str
),
" StartGCP: %d StopGCP: %d"
,
event
.
Completed
.
startGCP
,
event
.
Completed
.
stopGCP
);
ndbout
<<
str
<<
endl
;
snprintf
(
str
,
sizeof
(
str
),
" #Records: %d #LogRecords: %d"
,
event
.
Completed
.
NoOfRecords
,
event
.
Completed
.
NoOfLogRecords
);
ndbout
<<
str
<<
endl
;
snprintf
(
str
,
sizeof
(
str
),
" Data: %d bytes Log: %d bytes"
,
event
.
Completed
.
NoOfBytes
,
event
.
Completed
.
NoOfLogBytes
);
break
;
case
MgmtSrvr
:
:
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
);
}
ndbout
<<
str
<<
endl
;
}
void
*
MgmtSrvr
::
logLevelThread_C
(
void
*
m
)
{
...
...
@@ -519,7 +462,6 @@ MgmtSrvr::MgmtSrvr(NodeId nodeId,
m_newConfig
=
NULL
;
m_configFilename
=
configFilename
;
setCallback
(
CmdBackupCallback
);
m_localNdbConfigFilename
=
ndb_config_filename
;
m_nextConfigGenerationNumber
=
0
;
...
...
@@ -2398,15 +2340,6 @@ MgmtSrvr::eventReport(NodeId nodeId, const Uint32 * theData)
/***************************************************************************
* Backup
***************************************************************************/
MgmtSrvr
::
BackupCallback
MgmtSrvr
::
setCallback
(
BackupCallback
aCall
)
{
BackupCallback
ret
=
m_backupCallback
;
m_backupCallback
=
aCall
;
return
ret
;
}
int
MgmtSrvr
::
startBackup
(
Uint32
&
backupId
,
bool
waitCompleted
)
{
...
...
@@ -2605,10 +2538,6 @@ MgmtSrvr::backupCallback(BackupEvent & event)
return
;
}
if
(
m_backupCallback
!=
0
){
(
*
m_backupCallback
)(
event
);
}
}
...
...
ndb/src/mgmsrv/MgmtSrvr.hpp
View file @
8dfb6b3f
...
...
@@ -353,8 +353,6 @@ public:
/**
* Backup functionallity
*/
typedef
void
(
*
BackupCallback
)(
const
BackupEvent
&
Event
);
BackupCallback
setCallback
(
BackupCallback
);
int
startBackup
(
Uint32
&
backupId
,
bool
waitCompleted
=
false
);
int
abortBackup
(
Uint32
backupId
);
int
performBackup
(
Uint32
*
backupId
);
...
...
@@ -743,7 +741,6 @@ private:
void
signalRecvThreadRun
();
void
backupCallback
(
BackupEvent
&
);
BackupCallback
m_backupCallback
;
BackupEvent
m_lastBackupEvent
;
Config
*
_props
;
...
...
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