Repository navigation
PBS-53: Support for blocking mode for COM_BINLOG_DUMP - #199
Merged
Merged
Conversation
https://perconadev.atlassian.net/browse/PBS-53 When the client's COM_BINLOG_DUMP packet does not carry the BINLOG_DUMP_NON_BLOCK flag, the server now waits for new events to appear instead of disconnecting after serving the last available event. The current implementation uses a simple polling loop with a hardcoded 500 ms interval. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
percona-ysorokin
approved these changes
Oct 5, 2026
percona-ysorokin
left a comment
Collaborator
There was a problem hiding this comment.
LGTM with one minor MTR comment
| --echo *** must keep the connection open and deliver events as they become | ||
| --echo *** available instead of disconnecting on EOF. | ||
| --let $downstream1_dump = $MYSQL_TMP_DIR/rs_blocking_dump_1.sql | ||
| --let $proc_command_line = $MYSQL_BINLOG --read-from-remote-server --stop-never --host=127.0.0.1 --port=$binsrv_replication_source_port --user=rpl --password=password --default-auth=caching_sha2_password $first_binlog > $downstream1_dump 2>/dev/null |
Collaborator
There was a problem hiding this comment.
Suggested change
| --let $proc_command_line = $MYSQL_BINLOG --read-from-remote-server --stop-never --host=127.0.0.1 --port=$binsrv_replication_source_port --user=rpl --password=password --default-auth=caching_sha2_password $first_binlog > $downstream1_dump 2>/dev/null | |
| --let $proc_command_line = $MYSQL_BINLOG --read-from-remote-server --stop-never --host=127.0.0.1 --port=$binsrv_replication_source_port --user=$binsrv_auth_user --password=$binsrv_auth_password --default-auth=caching_sha2_password $first_binlog > $downstream1_dump 2>/dev/null |
| --echo *** that two concurrent blocking COM_BINLOG_DUMP sessions are | ||
| --echo *** exercised at the same time. | ||
| --let $downstream2_dump = $MYSQL_TMP_DIR/rs_blocking_dump_2.sql | ||
| --let $proc_command_line = $MYSQL_BINLOG --read-from-remote-server --stop-never --host=127.0.0.1 --port=$binsrv_replication_source_port --user=rpl --password=password --default-auth=caching_sha2_password $first_binlog > $downstream2_dump 2>/dev/null |
Collaborator
There was a problem hiding this comment.
Suggested change
| --let $proc_command_line = $MYSQL_BINLOG --read-from-remote-server --stop-never --host=127.0.0.1 --port=$binsrv_replication_source_port --user=rpl --password=password --default-auth=caching_sha2_password $first_binlog > $downstream2_dump 2>/dev/null | |
| --let $proc_command_line = $MYSQL_BINLOG --read-from-remote-server --stop-never --host=127.0.0.1 --port=$binsrv_replication_source_port --user=$binsrv_auth_user --password=$binsrv_auth_password --default-auth=caching_sha2_password $first_binlog > $downstream2_dump 2>/dev/null |
https://perconadev.atlassian.net/browse/PBS-53 Introduced 'binlog_streaming.rs_blocking_dump' which verifies that PBS keeps a COM_BINLOG_DUMP connection open and delivers newly produced events to downstream clients when the request does not carry the BINLOG_DUMP_NON_BLOCK flag. Flow: * Start 'binlog_server pull' in background with a 1-second checkpoint interval so small test transactions flush to storage quickly. * Spawn two concurrent 'mysqlbinlog --read-from-remote-server --stop-never' sessions against PBS. '--stop-never' clears BINLOG_DUMP_NON_BLOCK, so PBS must enter the blocking path. * Execute a first batch of transactions on the source and wait for the resulting DDL to appear in both downstream output files. * Sleep for 3 seconds with the source quiet to exercise the per-session idle-polling loop. * Execute a second batch and wait for its DDL to appear in both downstream output files. Without blocking-mode support, the sessions would have been closed on EOF after the first batch and the second wait would time out, failing the test. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…exity https://perconadev.atlassian.net/browse/PBS-53 The blocking-mode branches added to the 'binlog_dump' case in 'minimysql::session()' pushed the function over clang-tidy's 'readability-function-cognitive-complexity' threshold (30 vs 25) and broke the Clang 20 CI jobs. Moved the body of the 'binlog_dump' case into a new free coroutine 'handle_binlog_dump_command()' in the anonymous namespace. The case body now reduces to one 'co_await' plus setting 'terminated = true', which brings 'session()' back under the limit. Behavior is unchanged. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
kamil-holubicki
force-pushed
the
PBS-53
branch
from
October 6, 2026 06:51
03a1c2a to
675b1de
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.