[MDEV-23660] mysql_install_db complains about missed table mysql.gtid_slave_pos when started with option log-bin Created: 2020-09-03  Updated: 2021-04-26

Status: Open
Project: MariaDB Server
Component/s: Scripts & Clients
Affects Version/s: 10.5.4
Fix Version/s: 10.5

Type: Bug Priority: Minor
Reporter: Sveta Smirnova Assignee: Daniel Black
Resolution: Unresolved Votes: 0
Labels: None


 Description   

If someone has option log-bin in their default configuration file mysql_install_db prints warning "2020-09-03 16:37:13 1 [Warning] 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")", although having such a table is not expected before mysql_install_db run.

How to Repeat.

$ ./scripts/mysql_install_db --no-defaults --basedir=. --datadir=./data --log-bin=master 
Installing MariaDB/MySQL system tables in './data' ...
2020-09-03 16:37:13 1 [Warning] 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")
OK
...
Consider joining MariaDB's strong and vibrant community:
https://mariadb.org/get-involved/

Suggested Fix

Ignore log-bin option in --bootstrap mode.



 Comments   
Comment by Daniel Black [ 2020-09-04 ]

Thanks for the bug report and suggested fix. I'll take a look at it.

Comment by Elena Stepanova [ 2020-09-04 ]

Ignoring intentionally configured binary logging to avoid an apparently harmless warning seems to be quite a radical fix. We should assume that at least some users know what they are doing when they have binary logging enabled upon bootstrap, and this change would not leave them any option to do so.

Comment by pgnd [ 2021-04-25 ]

rm'ing

log-bin = /var/log/mariadb/mariadb-bin
log-bin-index = /var/log/mariadb/mariadb-bin.index
binlog_format = mixed

from my config does, in fact, remove the 'warning'.

> ... apparently harmless warning ...

so, what's the resolution here?

simply IGNORE the "[Warning]" if using log-bin in install/bootstrap mode?
or is the intent to fix the warning?

Comment by Sergei Golubchik [ 2021-04-26 ]

if adding --disable-log-bin to the mysqld command line in mysql_install_db will do the trick, then it could be a rather simple way to avoid the warning.

Comment by Elena Stepanova [ 2021-04-26 ]

Yes, it should do the trick, and it's better than unconditionally disabling it for any --bootstrap.
If somebody runs a custom bootstrap with log-bin enabled, and it indeed can't find the system table, I think warning is valid.
Also, if the --disable-log-bin is added to the mysqld command line in mysql_install_db before explicit command-line options provided by the user, it leaves the possibility to run the script with binary logging, should anyone want to do so (although I can't really imagine why, unlike running a custom bootstrap).

Generated at Thu Feb 08 09:24:05 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.