[MDEV-19732] Option binlog_ignore_db ignored on MemoryBuffer database Created: 2019-06-11  Updated: 2019-06-19

Status: Open
Project: MariaDB Server
Component/s: Replication
Affects Version/s: 10.2.21
Fix Version/s: 10.2

Type: Bug Priority: Minor
Reporter: Carlos Rubio Assignee: Andrei Elkin
Resolution: Unresolved Votes: 0
Labels: replication
Environment:

mariadb docker container 10.2.21



 Description   

We have a MemoryBuffer database setup and with the binlog_ignore_db parameter set to not replicate this database. However when we shutdown mariadb server with mysqladmin a transaction in MemoryBuffer shows in the binlogs of the server.

Server version: 10.2.21-MariaDB-1:10.2.21+maria~bionic-log on docker
mysql.cnf
binlog_ignore_db = MemoryBuffer

show master status;
+--------------------+-----------+--------------+------------------+
| File               | Position  | Binlog_Do_DB | Binlog_Ignore_DB |
+--------------------+-----------+--------------+------------------+
| mariadb-bin.000009 | 653488516 |              | MemoryBuffer     |
+--------------------+-----------+--------------+------------------+

after a mysqladmin shutdown the binlog show this

mysqlbinlog mariadb-bin.000002

	/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
	/*!40019 SET @@session.max_insert_delayed_threads=0*/;
	/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
	DELIMITER /*!*/;
	# at 4
	#190611 15:04:50 server id 2  end_log_pos 256 CRC32 0x5689d3e3 	Start: binlog v 4, server v 10.2.21-MariaDB-1:10.2.21+maria~bionic-log created 190611 15:04:50 at startup
	ROLLBACK/*!*/;
	BINLOG '
	Uvv/XA8CAAAA/AAAAAABAAAAAAQAMTAuMi4yMS1NYXJpYURCLTE6MTAuMi4yMSttYXJpYX5iaW9u
	aWMtbG9nAAAAAAAAAABS+/9cEzgNAAgAEgAEBAQEEgAA5AAEGggAAAAICAgCAAAACgoKAAAAAAAA
	AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
	AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
	AAAAAAAAAAAEEwQADQgICAoKCgHj04lW
	'/*!*/;
	# at 256
	#190611 15:04:50 server id 2  end_log_pos 285 CRC32 0xaf352ac0 	Gtid list []
	# at 285
	#190611 15:04:50 server id 2  end_log_pos 330 CRC32 0xa1fc98d8 	Binlog checkpoint mariadb-bin.000002
	# at 330
	#190611 15:05:44 server id 2  end_log_pos 372 CRC32 0xdc601a53 	GTID 2-2-441075611
	/*!100101 SET @@session.skip_parallel_replication=0*//*!*/;
	/*!100001 SET @@session.gtid_domain_id=2*//*!*/;
	/*!100001 SET @@session.server_id=2*//*!*/;
	/*!100001 SET @@session.gtid_seq_no=441075611*//*!*/;
	# at 372
	#190611 15:05:44 server id 2  end_log_pos 486 CRC32 0xbf97f72e 	Query	thread_id=33	exec_time=0	error_code=0
	SET TIMESTAMP=1560279944/*!*/;
	SET @@session.pseudo_thread_id=33/*!*/;
	SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/;
	SET @@session.sql_mode=1574961152/*!*/;
	SET @@session.auto_increment_increment=3, @@session.auto_increment_offset=2/*!*/;
	/*!\C utf8 *//*!*/;
	SET @@session.character_set_client=33,@@session.collation_connection=33,@@session.collation_server=8/*!*/;
	SET @@session.lc_time_names=0/*!*/;
	SET @@session.collation_database=DEFAULT/*!*/;
	DELETE FROM `MemoryBuffer`.`GrafanaStatistics`
	/*!*/;
	# at 486
	#190611 15:06:12 server id 2  end_log_pos 509 CRC32 0xc3ed51be 	Stop
	DELIMITER ;
	# End of log file
	ROLLBACK /* added by mysqlbinlog */;
	/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
	/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;

This doesn't happen if we simple stop the MariaDB process with a kill -9



 Comments   
Comment by Andrei Elkin [ 2019-06-18 ]

It's not clear what was the default db of the logged DELETE FROM `MemoryBuffer`.`GrafanaStatistics`.
If it was not one that being ignored the query would be logged. See more https://mariadb.com/kb/en/library/mysqld-options/#-binlog-ignore-db :
_This option will not work with cross-database updates with statement-based logging. See the Statement-Based Logging section for more information. _

Generated at Thu Feb 08 08:53:55 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.