Skip to content

PBS-42 feature: Implement basic support for COM_BINLOG_DUMP packet handling (part 4) - #197

Merged
percona-ysorokin merged 1 commit into
Percona-Lab:mainfrom
percona-ysorokin:com_binlog_dump_mtr
Sep 30, 2026
Merged

percona-ysorokin merged 1 commit into
Percona-Lab:mainfrom
percona-ysorokin:com_binlog_dump_mtr

Conversation

@percona-ysorokin

@percona-ysorokin percona-ysorokin commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

https://perconadev.atlassian.net/browse/PBS-42

Added initial MTR coverage for the replication source functionality.

  • Added new 'binlog_streaming.rs_roundtrip' MTR test case which
    checks that data collected by PBS and then extracted from PBS via
    'mysqlbinlog --read-from-remote-server' is identical to what was
    originally added to MySQL Server.
  • Introduced 'start_proc_in_background.inc' and 'terminate_proc.inc'
    MTR include files which help with starting PBS in pull mode in the
    background and then gracefully terminating it.
  • Introduced new 'kill_binlog_dump_connection.inc' MTR include file
    which silently terminates the 'Binlog Dump' connection. It is
    recommended to include this file before
    'wait_until_count_sessions.inc' to ensure MTR test case stability.
  • Added new 'wait_for_listening_port.inc' MTR include file which waits
    until a specified network port is ready to accept connections. It is
    currently used to make sure that PBS is ready to accept connections on
    the '<replication_source.port>' port.
  • 'binlog_streaming.auth_method_switch',
    'binlog_streaming.binlog_flush' and 'binlog_streaming.pull_mode'
    reworked to use new '.inc' files.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

The new test does not explicitly close the lingering source-side Binlog Dump session before waiting for session cleanup.

Review effort: Balanced
Findings: 1 High severity

Open (1)
What changed in this PR

Adds MTR coverage for round-trip binlog streaming through PBS.

Changes:

  • Adds a replication-source round-trip test.
  • Introduces reusable process start/termination helpers.
  • Refactors existing pull-mode tests to use those helpers.
File Description
mtr/​binlog_streaming/​t/​rs_roundtrip.test Tests remote binlog extraction and restoration.
mtr/​binlog_streaming/​r/​rs_roundtrip.result Defines expected round-trip test output.
mtr/​binlog_streaming/​t/​pull_mode.test Uses shared process helpers.
mtr/​binlog_streaming/​t/​binlog_flush.test Uses shared process startup.
mtr/​binlog_streaming/​t/​auth_method_switch.test Uses shared process helpers.
mtr/​binlog_streaming/​include/​start_proc_in_background.inc Adds background process startup utility.
mtr/​binlog_streaming/​include/​terminate_proc.inc Adds graceful process termination utility.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.


--source ../include/tear_down_binsrv_environment.inc

--source include/wait_until_count_sessions.inc
--let $binsrv_pid_file = $MYSQL_TMP_DIR/auth_switch_binsrv.pid
--let $binsrv_spawn_cmd_line = $BINSRV pull $binsrv_config_file_path > /dev/null 2>&1 & echo \$! > $binsrv_pid_file

# We route the spawn through Perl's system() rather than --exec because

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.

It was moved to a dedicated inc file,which is fine, but the comment explaining the magic is worth keeping there

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

this comment moved to the .inc file as well

--source ../include/start_proc_in_background.inc

--echo
--echo *** Waiting for the replication source listener.

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.

The same block in auth_method_switch.test. Maybe extract to a dedicated inc file?

…ndling (part 4)

https://perconadev.atlassian.net/browse/PBS-42

Added initial MTR coverage for the replication source functionality.

* Added new 'binlog_streaming.rs_roundtrip' MTR test case which
  checks that data collected by PBS and then extracted from PBS via
  'mysqlbinlog --read-from-remote-server' is identical to what was
  originally added to MySQL Server.
* Introduced 'start_proc_in_background.inc' and 'terminate_proc.inc'
  MTR include files which help with starting PBS in pull mode in the
  background and then gracefully terminating it.
* Introduced new 'kill_binlog_dump_connection.inc' MTR include file
  which silently terminates the 'Binlog Dump' connection. It is
  recommended to include this file before
  'wait_until_count_sessions.inc' to ensure MTR test case stability.
* Added new 'wait_for_listening_port.inc' MTR include file which waits
  until a specified network port is ready to accept connections. It is
  currently used to make sure that PBS is ready to accept connections on
  the '<replication_source.port>' port.
* 'binlog_streaming.auth_method_switch',
  'binlog_streaming.binlog_flush' and 'binlog_streaming.pull_mode'
  reworked to use new '.inc' files.
@percona-ysorokin
percona-ysorokin merged commit caac2b8 into Percona-Lab:main Sep 30, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants