Skip to content

Commit 90bbeaf

Browse files
committed
Get rid of error when running mariadb-install-db with --log-bin
This removes the error: "Failed to load slave replication state from table mysql.gtid_slave_pos: 1017: Can't find file: './mysql/' (errno: 2 "No such file or directory")
1 parent 75c0f95 commit 90bbeaf

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

sql/mysqld.cc

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4710,9 +4710,9 @@ static int init_server_components()
47104710
proc_info_hook= set_thd_stage_info;
47114711

47124712
/*
4713-
Print source revision hash, as one of the first lines, if not the
4714-
first in error log, for troubleshooting and debugging purposes
4715-
*/
4713+
Print source revision hash, as one of the first lines, if not the
4714+
first in error log, for troubleshooting and debugging purposes
4715+
*/
47164716
if (!opt_help)
47174717
sql_print_information("Starting MariaDB %s source revision %s as process %lu",
47184718
server_version, SOURCE_REVISION, (ulong) getpid());
@@ -4740,6 +4740,19 @@ static int init_server_components()
47404740

47414741
xid_cache_init();
47424742

4743+
/*
4744+
Do not open binlong when doing bootstrap.
4745+
This ensures that rpl_load_gtid_slave_state() will not fail with an error
4746+
as the mysql schema does not yet exists.
4747+
This also ensures that we don't get an empty binlog file if the user has
4748+
log-bin in his config files.
4749+
*/
4750+
if (opt_bootstrap)
4751+
{
4752+
opt_bin_log= opt_bin_log_used= binlog_format_used= 0;
4753+
opt_log_slave_updates= 0;
4754+
}
4755+
47434756
/* need to configure logging before initializing storage engines */
47444757
if (!opt_bin_log_used && !WSREP_ON)
47454758
{

0 commit comments

Comments
 (0)