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
d24040a6
Commit
d24040a6
authored
18 years ago
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.1-new-ndb
into poseidon.mysql.com:/home/tomas/mysql-5.1-new-ndb
parents
4a910413
d5fa4ffe
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
293 additions
and
90 deletions
+293
-90
mysql-test/r/ndb_read_multi_range.result
mysql-test/r/ndb_read_multi_range.result
+17
-0
mysql-test/t/ndb_read_multi_range.test
mysql-test/t/ndb_read_multi_range.test
+29
-0
sql/ha_ndbcluster.cc
sql/ha_ndbcluster.cc
+3
-2
sql/ha_ndbcluster_binlog.cc
sql/ha_ndbcluster_binlog.cc
+2
-2
sql/log_event.cc
sql/log_event.cc
+20
-3
sql/protocol.h
sql/protocol.h
+2
-0
sql/slave.cc
sql/slave.cc
+1
-1
storage/ndb/src/common/debugger/EventLogger.cpp
storage/ndb/src/common/debugger/EventLogger.cpp
+94
-4
storage/ndb/src/kernel/blocks/backup/Backup.cpp
storage/ndb/src/kernel/blocks/backup/Backup.cpp
+12
-0
storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
+22
-1
storage/ndb/src/mgmclient/CommandInterpreter.cpp
storage/ndb/src/mgmclient/CommandInterpreter.cpp
+12
-0
storage/ndb/src/mgmsrv/ConfigInfo.cpp
storage/ndb/src/mgmsrv/ConfigInfo.cpp
+78
-70
storage/ndb/src/mgmsrv/main.cpp
storage/ndb/src/mgmsrv/main.cpp
+0
-4
storage/ndb/src/ndbapi/ClusterMgr.cpp
storage/ndb/src/ndbapi/ClusterMgr.cpp
+1
-3
No files found.
mysql-test/r/ndb_read_multi_range.result
View file @
d24040a6
...
...
@@ -442,3 +442,20 @@ SELECT id, tag, doc, type FROM t1 WHERE id IN ('flipper','sakila');
id tag doc type
sakila 1 Some text goes here text
DROP TABLE t1;
CREATE TABLE t1 (
var1 int(2) NOT NULL,
var2 int(2) NOT NULL,
PRIMARY KEY (var1)
) ENGINE=ndbcluster DEFAULT CHARSET=ascii CHECKSUM=1;
CREATE TABLE t2 (
var1 int(2) NOT NULL,
var2 int(2) NOT NULL,
PRIMARY KEY (var1)
) ENGINE=MyISAM DEFAULT CHARSET=ascii CHECKSUM=1;
CREATE TRIGGER testtrigger
AFTER UPDATE ON t1 FOR EACH ROW BEGIN
REPLACE INTO t2 SELECT * FROM t1 WHERE t1.var1 = NEW.var1;END|
INSERT INTO t1 VALUES (1,1),(2,2),(3,3);
UPDATE t1 SET var2 = 9 WHERE var1 IN(1,2,3);
DROP TRIGGER testtrigger;
DROP TABLE t1, t2;
This diff is collapsed.
Click to expand it.
mysql-test/t/ndb_read_multi_range.test
View file @
d24040a6
...
...
@@ -272,3 +272,32 @@ SELECT id, tag, doc, type FROM t1 WHERE id IN ('flipper','orka');
SELECT
id
,
tag
,
doc
,
type
FROM
t1
WHERE
id
IN
(
'flipper'
,
'sakila'
);
DROP
TABLE
t1
;
#bug#25522
CREATE
TABLE
t1
(
var1
int
(
2
)
NOT
NULL
,
var2
int
(
2
)
NOT
NULL
,
PRIMARY
KEY
(
var1
)
)
ENGINE
=
ndbcluster
DEFAULT
CHARSET
=
ascii
CHECKSUM
=
1
;
CREATE
TABLE
t2
(
var1
int
(
2
)
NOT
NULL
,
var2
int
(
2
)
NOT
NULL
,
PRIMARY
KEY
(
var1
)
)
ENGINE
=
MyISAM
DEFAULT
CHARSET
=
ascii
CHECKSUM
=
1
;
DELIMITER
|
;
CREATE
TRIGGER
testtrigger
AFTER
UPDATE
ON
t1
FOR
EACH
ROW
BEGIN
REPLACE
INTO
t2
SELECT
*
FROM
t1
WHERE
t1
.
var1
=
NEW
.
var1
;
END
|
DELIMITER
;
|
INSERT
INTO
t1
VALUES
(
1
,
1
),(
2
,
2
),(
3
,
3
);
UPDATE
t1
SET
var2
=
9
WHERE
var1
IN
(
1
,
2
,
3
);
DROP
TRIGGER
testtrigger
;
DROP
TABLE
t1
,
t2
;
This diff is collapsed.
Click to expand it.
sql/ha_ndbcluster.cc
View file @
d24040a6
...
...
@@ -4347,11 +4347,10 @@ int ha_ndbcluster::start_stmt(THD *thd, thr_lock_type lock_type)
ERR_RETURN
(
ndb
->
getNdbError
());
no_uncommitted_rows_reset
(
thd
);
thd_ndb
->
stmt
=
trans
;
thd_ndb
->
query_state
&=
NDB_QUERY_NORMAL
;
trans_register_ha
(
thd
,
FALSE
,
ndbcluster_hton
);
}
thd_ndb
->
query_state
&=
NDB_QUERY_NORMAL
;
m_active_trans
=
trans
;
// Start of statement
m_ops_pending
=
0
;
thd
->
set_current_stmt_binlog_row_based_if_mixed
();
...
...
@@ -8292,6 +8291,8 @@ ha_ndbcluster::read_multi_range_next(KEY_MULTI_RANGE ** multi_range_found_p)
if
(
multi_range_curr
==
multi_range_end
)
{
DBUG_MULTI_RANGE
(
16
);
Thd_ndb
*
thd_ndb
=
get_thd_ndb
(
current_thd
);
thd_ndb
->
query_state
&=
NDB_QUERY_NORMAL
;
DBUG_RETURN
(
HA_ERR_END_OF_FILE
);
}
...
...
This diff is collapsed.
Click to expand it.
sql/ha_ndbcluster_binlog.cc
View file @
d24040a6
...
...
@@ -3924,9 +3924,9 @@ pthread_handler_t ndb_binlog_thread_func(void *arg)
"%ld(%d e/s), total time %ld(%d e/s)"
,
(
ulong
)
gci
,
event_count
,
write_timer
.
elapsed_ms
(),
event_count
/
write_timer
.
elapsed_ms
(),
(
1000
*
event_count
)
/
write_timer
.
elapsed_ms
(),
gci_timer
.
elapsed_ms
(),
event_count
/
gci_timer
.
elapsed_ms
());
(
1000
*
event_count
)
/
gci_timer
.
elapsed_ms
());
#endif
}
}
...
...
This diff is collapsed.
Click to expand it.
sql/log_event.cc
View file @
d24040a6
...
...
@@ -5717,9 +5717,26 @@ int Rows_log_event::exec_event(st_relay_log_info *rli)
{
if
(
!
need_reopen
)
{
slave_print_msg
(
ERROR_LEVEL
,
rli
,
error
,
"Error in %s event: when locking tables"
,
get_type_str
());
if
(
thd
->
query_error
||
thd
->
is_fatal_error
)
{
/*
Error reporting borrowed from Query_log_event with many excessive
simplifications (we don't honour --slave-skip-errors)
*/
uint
actual_error
=
thd
->
net
.
last_errno
;
slave_print_msg
(
ERROR_LEVEL
,
rli
,
actual_error
,
"Error '%s' in %s event: when locking tables"
,
(
actual_error
?
thd
->
net
.
last_error
:
"unexpected success or fatal error"
),
get_type_str
());
thd
->
is_fatal_error
=
1
;
}
else
{
slave_print_msg
(
ERROR_LEVEL
,
rli
,
error
,
"Error in %s event: when locking tables"
,
get_type_str
());
}
rli
->
clear_tables_to_lock
();
DBUG_RETURN
(
error
);
}
...
...
This diff is collapsed.
Click to expand it.
sql/protocol.h
View file @
d24040a6
...
...
@@ -58,6 +58,8 @@ class Protocol
String
*
storage_packet
()
{
return
packet
;
}
inline
void
free
()
{
packet
->
free
();
}
virtual
bool
write
();
inline
bool
store
(
int
from
)
{
return
store_long
((
longlong
)
from
);
}
inline
bool
store
(
uint32
from
)
{
return
store_long
((
longlong
)
from
);
}
inline
bool
store
(
longlong
from
)
...
...
This diff is collapsed.
Click to expand it.
sql/slave.cc
View file @
d24040a6
...
...
@@ -1295,7 +1295,7 @@ bool show_master_info(THD* thd, MASTER_INFO* mi)
rpl_filter
->
get_wild_ignore_table
(
&
tmp
);
protocol
->
store
(
&
tmp
);
protocol
->
store
(
(
uint32
)
mi
->
rli
.
last_slave_errno
);
protocol
->
store
(
mi
->
rli
.
last_slave_errno
);
protocol
->
store
(
mi
->
rli
.
last_slave_error
,
&
my_charset_bin
);
protocol
->
store
((
uint32
)
mi
->
rli
.
slave_skip_counter
);
protocol
->
store
((
ulonglong
)
mi
->
rli
.
group_master_log_pos
);
...
...
This diff is collapsed.
Click to expand it.
storage/ndb/src/common/debugger/EventLogger.cpp
View file @
d24040a6
...
...
@@ -16,6 +16,7 @@
#include <ndb_global.h>
#include <EventLogger.hpp>
#include <TransporterCallback.hpp>
#include <NdbConfig.h>
#include <kernel/BlockNumbers.h>
...
...
@@ -526,11 +527,100 @@ void getTextUndoLogBlocked(QQQQ) {
theData
[
1
],
theData
[
2
]);
}
void
getTextTransporterError
(
QQQQ
)
{
BaseString
::
snprintf
(
m_text
,
m_text_len
,
"Transporter to node %d reported error 0x%x"
,
theData
[
1
],
theData
[
2
]);
struct
myTransporterError
{
int
errorNum
;
char
errorString
[
256
];
};
int
i
=
0
;
int
lenth
=
0
;
static
const
struct
myTransporterError
TransporterErrorString
[]
=
{
//TE_NO_ERROR = 0
{
TE_NO_ERROR
,
"No error"
},
//TE_ERROR_CLOSING_SOCKET = 0x1
{
TE_ERROR_CLOSING_SOCKET
,
"Error found during closing of socket"
},
//TE_ERROR_IN_SELECT_BEFORE_ACCEPT = 0x2
{
TE_ERROR_IN_SELECT_BEFORE_ACCEPT
,
"Error found before accept. The transporter will retry"
},
//TE_INVALID_MESSAGE_LENGTH = 0x3 | TE_DO_DISCONNECT
{
TE_INVALID_MESSAGE_LENGTH
,
"Error found in message (invalid message length)"
},
//TE_INVALID_CHECKSUM = 0x4 | TE_DO_DISCONNECT
{
TE_INVALID_CHECKSUM
,
"Error found in message (checksum)"
},
//TE_COULD_NOT_CREATE_SOCKET = 0x5
{
TE_COULD_NOT_CREATE_SOCKET
,
"Error found while creating socket(can't create socket)"
},
//TE_COULD_NOT_BIND_SOCKET = 0x6
{
TE_COULD_NOT_BIND_SOCKET
,
"Error found while binding server socket"
},
//TE_LISTEN_FAILED = 0x7
{
TE_LISTEN_FAILED
,
"Error found while listening to server socket"
},
//TE_ACCEPT_RETURN_ERROR = 0x8
{
TE_ACCEPT_RETURN_ERROR
,
"Error found during accept(accept return error)"
},
//TE_SHM_DISCONNECT = 0xb | TE_DO_DISCONNECT
{
TE_SHM_DISCONNECT
,
"The remote node has disconnected"
},
//TE_SHM_IPC_STAT = 0xc | TE_DO_DISCONNECT
{
TE_SHM_IPC_STAT
,
"Unable to check shm segment"
},
//TE_SHM_UNABLE_TO_CREATE_SEGMENT = 0xd
{
TE_SHM_UNABLE_TO_CREATE_SEGMENT
,
"Unable to create shm segment"
},
//TE_SHM_UNABLE_TO_ATTACH_SEGMENT = 0xe
{
TE_SHM_UNABLE_TO_ATTACH_SEGMENT
,
"Unable to attach shm segment"
},
//TE_SHM_UNABLE_TO_REMOVE_SEGMENT = 0xf
{
TE_SHM_UNABLE_TO_REMOVE_SEGMENT
,
"Unable to remove shm segment"
},
//TE_TOO_SMALL_SIGID = 0x10
{
TE_TOO_SMALL_SIGID
,
"Sig ID too small"
},
//TE_TOO_LARGE_SIGID = 0x11
{
TE_TOO_LARGE_SIGID
,
"Sig ID too large"
},
//TE_WAIT_STACK_FULL = 0x12 | TE_DO_DISCONNECT
{
TE_WAIT_STACK_FULL
,
"Wait stack was full"
},
//TE_RECEIVE_BUFFER_FULL = 0x13 | TE_DO_DISCONNECT
{
TE_RECEIVE_BUFFER_FULL
,
"Receive buffer was full"
},
//TE_SIGNAL_LOST_SEND_BUFFER_FULL = 0x14 | TE_DO_DISCONNECT
{
TE_SIGNAL_LOST_SEND_BUFFER_FULL
,
"Send buffer was full,and trying to force send fails"
},
//TE_SIGNAL_LOST = 0x15
{
TE_SIGNAL_LOST
,
"Send failed for unknown reason(signal lost)"
},
//TE_SEND_BUFFER_FULL = 0x16
{
TE_SEND_BUFFER_FULL
,
"The send buffer was full, but sleeping for a while solved"
},
//TE_SCI_LINK_ERROR = 0x0017
{
TE_SCI_LINK_ERROR
,
"There is no link from this node to the switch"
},
//TE_SCI_UNABLE_TO_START_SEQUENCE = 0x18 | TE_DO_DISCONNECT
{
TE_SCI_UNABLE_TO_START_SEQUENCE
,
"Could not start a sequence, because system resources are exumed or no sequence has been created"
},
//TE_SCI_UNABLE_TO_REMOVE_SEQUENCE = 0x19 | TE_DO_DISCONNECT
{
TE_SCI_UNABLE_TO_REMOVE_SEQUENCE
,
"Could not remove a sequence"
},
//TE_SCI_UNABLE_TO_CREATE_SEQUENCE = 0x1a | TE_DO_DISCONNECT
{
TE_SCI_UNABLE_TO_CREATE_SEQUENCE
,
"Could not create a sequence, because system resources are exempted. Must reboot"
},
//TE_SCI_UNRECOVERABLE_DATA_TFX_ERROR = 0x1b | TE_DO_DISCONNECT
{
TE_SCI_UNRECOVERABLE_DATA_TFX_ERROR
,
"Tried to send data on redundant link but failed"
},
//TE_SCI_CANNOT_INIT_LOCALSEGMENT = 0x1c | TE_DO_DISCONNECT
{
TE_SCI_CANNOT_INIT_LOCALSEGMENT
,
"Cannot initialize local segment"
},
//TE_SCI_CANNOT_MAP_REMOTESEGMENT = 0x1d | TE_DO_DISCONNEC
{
TE_SCI_CANNOT_MAP_REMOTESEGMENT
,
"Cannot map remote segment"
},
//TE_SCI_UNABLE_TO_UNMAP_SEGMENT = 0x1e | TE_DO_DISCONNECT
{
TE_SCI_UNABLE_TO_UNMAP_SEGMENT
,
"Cannot free the resources used by this segment (step 1)"
},
//TE_SCI_UNABLE_TO_REMOVE_SEGMENT = 0x1f | TE_DO_DISCONNEC
{
TE_SCI_UNABLE_TO_REMOVE_SEGMENT
,
"Cannot free the resources used by this segment (step 2)"
},
//TE_SCI_UNABLE_TO_DISCONNECT_SEGMENT = 0x20 | TE_DO_DISCONNECT
{
TE_SCI_UNABLE_TO_DISCONNECT_SEGMENT
,
"Cannot disconnect from a remote segment"
},
//TE_SHM_IPC_PERMANENT = 0x21
{
TE_SHM_IPC_PERMANENT
,
"Shm ipc Permanent error"
},
//TE_SCI_UNABLE_TO_CLOSE_CHANNEL = 0x22
{
TE_SCI_UNABLE_TO_CLOSE_CHANNEL
,
"Unable to close the sci channel and the resources allocated"
}
};
lenth
=
sizeof
(
TransporterErrorString
)
/
sizeof
(
struct
myTransporterError
);
for
(
i
=
0
;
i
<
lenth
;
i
++
)
{
if
(
theData
[
2
]
==
TransporterErrorString
[
i
].
errorNum
)
{
BaseString
::
snprintf
(
m_text
,
m_text_len
,
"Transporter to node %d reported error: %s"
,
theData
[
1
],
TransporterErrorString
[
i
].
errorString
);
break
;
}
}
if
(
i
==
lenth
)
BaseString
::
snprintf
(
m_text
,
m_text_len
,
"Transporter to node %d reported error: no such error"
,
theData
[
1
]);
}
void
getTextTransporterWarning
(
QQQQ
)
{
getTextTransporterError
(
m_text
,
m_text_len
,
theData
);
...
...
This diff is collapsed.
Click to expand it.
storage/ndb/src/kernel/blocks/backup/Backup.cpp
View file @
d24040a6
...
...
@@ -2405,6 +2405,18 @@ Backup::defineBackupRef(Signal* signal, BackupRecordPtr ptr, Uint32 errCode)
if
(
ptr
.
p
->
is_lcp
())
{
jam
();
if
(
ptr
.
p
->
ctlFilePtr
==
RNIL
)
{
ptr
.
p
->
m_gsn
=
GSN_DEFINE_BACKUP_REF
;
ndbrequire
(
ptr
.
p
->
errorCode
!=
0
);
DefineBackupRef
*
ref
=
(
DefineBackupRef
*
)
signal
->
getDataPtrSend
();
ref
->
backupId
=
ptr
.
p
->
backupId
;
ref
->
backupPtr
=
ptr
.
i
;
ref
->
errorCode
=
ptr
.
p
->
errorCode
;
ref
->
nodeId
=
getOwnNodeId
();
sendSignal
(
ptr
.
p
->
masterRef
,
GSN_DEFINE_BACKUP_REF
,
signal
,
DefineBackupRef
::
SignalLength
,
JBB
);
return
;
}
BackupFilePtr
filePtr
LINT_SET_PTR
;
ptr
.
p
->
files
.
getPtr
(
filePtr
,
ptr
.
p
->
ctlFilePtr
);
...
...
This diff is collapsed.
Click to expand it.
storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
View file @
d24040a6
...
...
@@ -582,6 +582,26 @@ Dblqh::execDEFINE_BACKUP_REF(Signal* signal)
{
jamEntry
();
m_backup_ptr
=
RNIL
;
DefineBackupRef
*
ref
=
(
DefineBackupRef
*
)
signal
->
getDataPtrSend
();
int
err_code
=
0
;
char
*
extra_msg
=
NULL
;
switch
(
ref
->
errorCode
){
case
DefineBackupRef
:
:
Undefined
:
case
DefineBackupRef
:
:
FailedToSetupFsBuffers
:
case
DefineBackupRef
:
:
FailedToAllocateBuffers
:
case
DefineBackupRef
:
:
FailedToAllocateTables
:
case
DefineBackupRef
:
:
FailedAllocateTableMem
:
case
DefineBackupRef
:
:
FailedToAllocateFileRecord
:
case
DefineBackupRef
:
:
FailedToAllocateAttributeRecord
:
case
DefineBackupRef
:
:
FailedInsertFileHeader
:
case
DefineBackupRef
:
:
FailedInsertTableList
:
jam
();
err_code
=
NDBD_EXIT_INVALID_CONFIG
;
extra_msg
=
"Probably Backup parameters configuration error, Please consult the manual"
;
progError
(
__LINE__
,
err_code
,
extra_msg
);
}
sendsttorryLab
(
signal
);
}
...
...
@@ -7208,7 +7228,8 @@ void Dblqh::execACC_ABORTCONF(Signal* signal)
TRACE_OP
(
regTcPtr
,
"ACC_ABORTCONF"
);
signal
->
theData
[
0
]
=
regTcPtr
->
tupConnectrec
;
EXECUTE_DIRECT
(
DBTUP
,
GSN_TUP_ABORTREQ
,
signal
,
1
);
jamEntry
();
continueAbortLab
(
signal
);
return
;
}
//Dblqh::execACC_ABORTCONF()
...
...
This diff is collapsed.
Click to expand it.
storage/ndb/src/mgmclient/CommandInterpreter.cpp
View file @
d24040a6
...
...
@@ -2057,6 +2057,18 @@ CommandInterpreter::executeStatus(int processId,
ndbout
<<
processId
<<
": Node not found"
<<
endl
;
return
-
1
;
}
if
(
cl
->
node_states
[
i
].
node_type
!=
NDB_MGM_NODE_TYPE_NDB
){
if
(
cl
->
node_states
[
i
].
version
!=
0
){
ndbout
<<
"Node "
<<
cl
->
node_states
[
i
].
node_id
<<
": connected"
;
ndbout_c
(
" (Version %d.%d.%d)"
,
getMajor
(
version
)
,
getMinor
(
version
),
getBuild
(
version
));
}
else
ndbout
<<
"Node "
<<
cl
->
node_states
[
i
].
node_id
<<
": not connected"
<<
endl
;
return
0
;
}
status
=
cl
->
node_states
[
i
].
node_status
;
startPhase
=
cl
->
node_states
[
i
].
start_phase
;
version
=
cl
->
node_states
[
i
].
version
;
...
...
This diff is collapsed.
Click to expand it.
storage/ndb/src/mgmsrv/ConfigInfo.cpp
View file @
d24040a6
...
...
@@ -3615,6 +3615,7 @@ check_node_vs_replicas(Vector<ConfigInfo::ConfigRuleSection>§ions,
Uint32
db_nodes
=
0
;
Uint32
replicas
=
0
;
Uint32
db_host_count
=
0
;
bool
with_arbitration_rank
=
false
;
ctx
.
m_userProperties
.
get
(
DB_TOKEN
,
&
db_nodes
);
ctx
.
m_userProperties
.
get
(
"NoOfReplicas"
,
&
replicas
);
if
((
db_nodes
%
replicas
)
!=
0
){
...
...
@@ -3650,83 +3651,90 @@ check_node_vs_replicas(Vector<ConfigInfo::ConfigRuleSection>§ions,
tmp
->
get
(
"HostName"
,
&
host
);
if
(
strcmp
(
type
,
DB_TOKEN
)
==
0
)
{
{
Uint32
ii
;
if
(
!
p_db_hosts
.
get
(
host
,
&
ii
))
db_host_count
++
;
p_db_hosts
.
put
(
host
,
i
);
if
(
p_arbitrators
.
get
(
host
,
&
ii
))
{
arbitration_warning
.
appfmt
(
arbit_warn_fmt
,
ii
,
i
,
host
);
p_arbitrators
.
remove
(
host
);
// only one warning per db node
}
}
{
unsigned
j
;
BaseString
str
,
str2
;
str
.
assfmt
(
"#group%d_"
,
group
);
p_db_hosts
.
put
(
str
.
c_str
(),
i_group
,
host
);
str2
.
assfmt
(
"##group%d_"
,
group
);
p_db_hosts
.
put
(
str2
.
c_str
(),
i_group
,
i
);
for
(
j
=
0
;
j
<
i_group
;
j
++
)
{
const
char
*
other_host
;
p_db_hosts
.
get
(
str
.
c_str
(),
j
,
&
other_host
);
if
(
strcmp
(
host
,
other_host
)
==
0
)
{
unsigned
int
other_i
,
c
=
0
;
p_db_hosts
.
get
(
str2
.
c_str
(),
j
,
&
other_i
);
p_db_hosts
.
get
(
str
.
c_str
(),
&
c
);
if
(
c
==
0
)
// first warning in this node group
node_group_warning
.
appfmt
(
" Node group %d"
,
group
);
c
|=
1
<<
j
;
p_db_hosts
.
put
(
str
.
c_str
(),
c
);
node_group_warning
.
appfmt
(
",
\n
db node with id %d and id %d "
"on same host %s"
,
other_i
,
i
,
host
);
}
}
i_group
++
;
DBUG_ASSERT
(
i_group
<=
replicas
);
if
(
i_group
==
replicas
)
{
unsigned
c
=
0
;
p_db_hosts
.
get
(
str
.
c_str
(),
&
c
);
if
(
c
+
1
==
(
1u
<<
(
replicas
-
1
)))
// all nodes on same machine
node_group_warning
.
append
(
".
\n
Host failure will "
"cause complete cluster shutdown."
);
else
if
(
c
>
0
)
node_group_warning
.
append
(
".
\n
Host failure may "
"cause complete cluster shutdown."
);
group
++
;
i_group
=
0
;
}
}
{
{
Uint32
ii
;
if
(
!
p_db_hosts
.
get
(
host
,
&
ii
))
db_host_count
++
;
p_db_hosts
.
put
(
host
,
i
);
if
(
p_arbitrators
.
get
(
host
,
&
ii
))
{
arbitration_warning
.
appfmt
(
arbit_warn_fmt
,
ii
,
i
,
host
);
p_arbitrators
.
remove
(
host
);
// only one warning per db node
}
}
{
unsigned
j
;
BaseString
str
,
str2
;
str
.
assfmt
(
"#group%d_"
,
group
);
p_db_hosts
.
put
(
str
.
c_str
(),
i_group
,
host
);
str2
.
assfmt
(
"##group%d_"
,
group
);
p_db_hosts
.
put
(
str2
.
c_str
(),
i_group
,
i
);
for
(
j
=
0
;
j
<
i_group
;
j
++
)
{
const
char
*
other_host
;
p_db_hosts
.
get
(
str
.
c_str
(),
j
,
&
other_host
);
if
(
strcmp
(
host
,
other_host
)
==
0
)
{
unsigned
int
other_i
,
c
=
0
;
p_db_hosts
.
get
(
str2
.
c_str
(),
j
,
&
other_i
);
p_db_hosts
.
get
(
str
.
c_str
(),
&
c
);
if
(
c
==
0
)
// first warning in this node group
node_group_warning
.
appfmt
(
" Node group %d"
,
group
);
c
|=
1
<<
j
;
p_db_hosts
.
put
(
str
.
c_str
(),
c
);
node_group_warning
.
appfmt
(
",
\n
db node with id %d and id %d "
"on same host %s"
,
other_i
,
i
,
host
);
}
}
i_group
++
;
DBUG_ASSERT
(
i_group
<=
replicas
);
if
(
i_group
==
replicas
)
{
unsigned
c
=
0
;
p_db_hosts
.
get
(
str
.
c_str
(),
&
c
);
if
(
c
+
1
==
(
1u
<<
(
replicas
-
1
)))
// all nodes on same machine
node_group_warning
.
append
(
".
\n
Host failure will "
"cause complete cluster shutdown."
);
else
if
(
c
>
0
)
node_group_warning
.
append
(
".
\n
Host failure may "
"cause complete cluster shutdown."
);
group
++
;
i_group
=
0
;
}
}
}
else
if
(
strcmp
(
type
,
API_TOKEN
)
==
0
||
strcmp
(
type
,
MGM_TOKEN
)
==
0
)
{
Uint32
rank
;
if
(
tmp
->
get
(
"ArbitrationRank"
,
&
rank
)
&&
rank
>
0
)
{
if
(
host
&&
host
[
0
]
!=
0
)
{
Uint32
ii
;
p_arbitrators
.
put
(
host
,
i
);
if
(
p_db_hosts
.
get
(
host
,
&
ii
))
{
arbitration_warning
.
appfmt
(
arbit_warn_fmt
,
i
,
ii
,
host
);
}
}
else
{
arbitration_warning
.
appfmt
(
arbit_warn_fmt2
,
i
);
}
}
{
Uint32
rank
;
if
(
tmp
->
get
(
"ArbitrationRank"
,
&
rank
)
&&
rank
>
0
)
{
with_arbitration_rank
=
true
;
//check whether MGM or API node configured with rank >0
if
(
host
&&
host
[
0
]
!=
0
)
{
Uint32
ii
;
p_arbitrators
.
put
(
host
,
i
);
if
(
p_db_hosts
.
get
(
host
,
&
ii
))
{
arbitration_warning
.
appfmt
(
arbit_warn_fmt
,
i
,
ii
,
host
);
}
}
else
{
arbitration_warning
.
appfmt
(
arbit_warn_fmt2
,
i
);
}
}
}
}
if
(
db_host_count
>
1
&&
node_group_warning
.
length
()
>
0
)
ndbout_c
(
"Cluster configuration warning:
\n
%s"
,
node_group_warning
.
c_str
());
if
(
!
with_arbitration_rank
)
{
ndbout_c
(
"Cluster configuration warning:"
"
\n
Neither %s nor %s nodes are configured with arbitrator,"
"
\n
may cause complete cluster shutdown in case of host failure."
,
MGM_TOKEN
,
API_TOKEN
);
}
if
(
db_host_count
>
1
&&
arbitration_warning
.
length
()
>
0
)
ndbout_c
(
"Cluster configuration warning:%s%s"
,
arbitration_warning
.
c_str
(),
"
\n
Running arbitrator on the same host as a database node may"
...
...
This diff is collapsed.
Click to expand it.
storage/ndb/src/mgmsrv/main.cpp
View file @
d24040a6
...
...
@@ -131,8 +131,6 @@ bool g_StopServer;
bool
g_RestartServer
;
extern
EventLogger
g_eventLogger
;
extern
int
global_mgmt_server_check
;
enum
ndb_mgmd_options
{
OPT_INTERACTIVE
=
NDB_STD_OPTIONS_LAST
,
OPT_NO_NODEID_CHECKS
,
...
...
@@ -207,8 +205,6 @@ int main(int argc, char** argv)
start:
glob
=
new
MgmGlobals
;
global_mgmt_server_check
=
1
;
if
(
opt_interactive
||
opt_non_interactive
||
g_print_full_config
)
{
...
...
This diff is collapsed.
Click to expand it.
storage/ndb/src/ndbapi/ClusterMgr.cpp
View file @
d24040a6
...
...
@@ -360,8 +360,6 @@ ClusterMgr::execAPI_REGREQ(const Uint32 * theData){
theFacade
.
sendSignalUnCond
(
&
signal
,
nodeId
);
}
int
global_mgmt_server_check
=
0
;
// set to one in mgmtsrvr main;
void
ClusterMgr
::
execAPI_REGCONF
(
const
Uint32
*
theData
){
const
ApiRegConf
*
const
apiRegConf
=
(
ApiRegConf
*
)
&
theData
[
0
];
...
...
@@ -379,7 +377,7 @@ ClusterMgr::execAPI_REGCONF(const Uint32 * theData){
if
(
node
.
m_info
.
m_version
!=
apiRegConf
->
version
){
node
.
m_info
.
m_version
=
apiRegConf
->
version
;
if
(
global_mgmt_server_check
==
1
)
if
(
theNodes
[
theFacade
.
ownId
()].
m_info
.
m_type
==
NodeInfo
::
MGM
)
node
.
compatible
=
ndbCompatible_mgmt_ndb
(
NDB_VERSION
,
node
.
m_info
.
m_version
);
else
...
...
This diff is collapsed.
Click to expand it.
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