Skip to content

MDEV-40903 galera.MDEV-38260 fails with ER_BINLOG_IN_USE on RESET MASTER - #5610

Open
sjaakola wants to merge 1 commit into
12.3from
12.3-MDEV-40903
Open

MDEV-40903 galera.MDEV-38260 fails with ER_BINLOG_IN_USE on RESET MASTER#5610
sjaakola wants to merge 1 commit into
12.3from
12.3-MDEV-40903

Conversation

@sjaakola

Copy link
Copy Markdown
Contributor

The test fails from 12.3 onwards on the final cleanup step:

mysqltest: At line 98: query 'reset master' failed: ER_BINLOG_IN_USE
(4243): Cannot execute RESET MASTER as the binlog is in use by a
connected slave or other RESET MASTER or binlog reader.

The binlog-in-engine work added a use-count guard around RESET MASTER in MYSQL_BIN_LOG::reset_logs(): every binlog reader, a slave dump thread included, registers itself through start_use_binlog(), and RESET MASTER now refuses with ER_BINLOG_IN_USE while the count is non-zero. Earlier versions reset the binlog even with a slave still attached, which is why the test passes on 11.8 and older.

The test's cleanup stops the async slave on node_2 and then immediately runs RESET MASTER on the master node_3. The dump thread on node_3 does not disappear at STOP SLAVE; it lingers until it next notices the closed connection, so it is often still registered when RESET MASTER arrives.

Fix here is to use include/reset_master.inc, which terminates dump threads and retries on ER_BINLOG_IN_USE.

The test fails from 12.3 onwards on the final cleanup step:

  mysqltest: At line 98: query 'reset master' failed: ER_BINLOG_IN_USE
  (4243): Cannot execute RESET MASTER as the binlog is in use by a
  connected slave or other RESET MASTER or binlog reader.

The binlog-in-engine work added a use-count guard around RESET MASTER
in MYSQL_BIN_LOG::reset_logs(): every binlog reader, a slave dump thread
included, registers itself through start_use_binlog(), and RESET MASTER
now refuses with ER_BINLOG_IN_USE while the count is non-zero. Earlier
versions reset the binlog even with a slave still attached, which is why
the test passes on 11.8 and older.

The test's cleanup stops the async slave on node_2 and then immediately
runs RESET MASTER on the master node_3. The dump thread on node_3 does
not disappear at STOP SLAVE; it lingers until it next notices the closed
connection, so it is often still registered when RESET MASTER arrives.

Fix here is to use include/reset_master.inc, which terminates dump
threads and retries on ER_BINLOG_IN_USE.
@sjaakola
sjaakola requested a review from janlindstrom August 27, 2026 18:49

@bnestere bnestere left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved, thanks @sjaakola !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants