Skip to content

Commit 53cf8e9

Browse files
Daogang Qubjornmu
authored andcommitted
Bug #26730000 SERVER_ID LOOKS SET TO VALID VALUE STILL START SLAVE FAILS WITH ER_BAD_SLAVE
Now, default server_id is set to 1 and user gets a warning if it is not set during server initialization. But, there is no WARNING and starting slave fails when server-id is not supplied by users during server starts. To fix the problem, remove the check on server_id_supplied on starting slave, and report a warning if the server-id is not supplied by users during server starts.
1 parent b8dcd63 commit 53cf8e9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

sql/mysqld.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5627,7 +5627,7 @@ int mysqld_main(int argc, char **argv)
56275627
unireg_abort(MYSQLD_ABORT_EXIT);
56285628
}
56295629

5630-
if (((opt_initialize || opt_initialize_insecure) && !server_id_supplied))
5630+
if (!server_id_supplied)
56315631
LogErr(WARNING_LEVEL, ER_WARN_NO_SERVERID_SPECIFIED);
56325632

56335633

sql/rpl_slave.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9477,7 +9477,7 @@ bool start_slave(THD* thd,
94779477
is_error= true;
94789478
my_error(ER_MASTER_INFO, MYF(0));
94799479
}
9480-
else if (server_id_supplied && (*mi->host || !(thread_mask & SLAVE_IO)))
9480+
else if (*mi->host || !(thread_mask & SLAVE_IO))
94819481
{
94829482
/*
94839483
If we will start IO thread we need to take care of possible

0 commit comments

Comments
 (0)