Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PS-9244 fix: binlog_server fails to resume copying binlog file after server restart #50

Merged
merged 1 commit into from
Jun 4, 2024

Conversation

percona-ysorokin
Copy link
Collaborator

@percona-ysorokin percona-ysorokin commented Jun 3, 2024

https://perconadev.atlassian.net/browse/PS-9244

Binlog Server Utility now properly handles 'STOP' events which may be
written to the binlog when MySQL server shuts down.

Added specializations of the 'binsrv::event::generic_body_impl<>' and
'binsrv::event::generic_post_header_impl<>' for 'code_type::stop'
(both implemented via 'redirect_type' to 'empty_body' /
'empty_post_header'). 'STOP' is now a known event type for the
'binsrv::event::event' class and its inner body / post-header variants.

Updated 'binsrv::reader_context'- it is now based on the following state
machine:
(ROTATE(artificial) FORMAT_DESCRIPTION * (ROTATE|STOP))*

'process_binlog_event()' in the main application now calls
'close_binlog()' not only on real (non-artificial) 'ROTATE' events but
on 'STOP' events as well.

Introduced new 'binlog_streaming.pull_mode' MTR test case which checks
if the Binlog Server Utility properly handles reconnects and resuming
operation in background ('pull') mode.
Common functionality from the 'binlog_streaming.binsrv' and
'binlog_streaming.pull_mode' extracted into the following include files:

  • 'identify_storage_backend.inc' - for identifying whether a local
    filesystem ('file') or a AWS S3 ('s3') storage backend should be used.
  • 'set_up_binsrv_environment.inc' - for creating storage directory,
    configuring log file and generating JSON configuration.
  • 'tear_down_binsrv_environment.inc' - for cleaning up data directory
    and removing log file along with JSON configuration file.

Temporarily disabled running MTR under "Clang 17 ASan" in GitHub
Workflows because of the "-stdlib=libc++ -fsanitize=address"
alloc-dealloc-mismatch issue
(llvm/llvm-project#59432).
Hopefully, the problem will be fixed in clang-18.

…server restart

https://perconadev.atlassian.net/browse/PS-9244

Binlog Server Utility now properly handles 'STOP' events which may be
written to the binlog when MySQL server shuts down.

Added specializations of the 'binsrv::event::generic_body_impl<>'  and
'binsrv::event::generic_post_header_impl<>' for 'code_type::stop'
(both implemented via 'redirect_type' to 'empty_body' /
'empty_post_header'). 'STOP' is now a known event type for the
'binsrv::event::event' class and its inner body / post-header variants.

Updated 'binsrv::reader_context'- it is now based on the following state
machine:
(ROTATE(artificial) FORMAT_DESCRIPTION <ANY>* (ROTATE|STOP))*

'process_binlog_event()' in the main application now calls
'close_binlog()' not only on real (non-artificial) 'ROTATE' events but
on 'STOP' events as well.

Introduced new 'binlog_streaming.pull_mode' MTR test case which checks
if the Binlog Server Utility properly handles reconnects and resuming
operation in background ('pull') mode.
Common functionality from the 'binlog_streaming.binsrv' and
'binlog_streaming.pull_mode' extracted into the following include files:
* 'identify_storage_backend.inc' - for identifying whether a local
  filesystem ('file') or a AWS S3 ('s3') storage backend should be used.
* 'set_up_binsrv_environment.inc' - for creating storage directory,
  configuring log file and generating JSON configuration.
* 'tear_down_binsrv_environment.inc' - for cleaning up data directory
  and removing log file along with JSON configuration file.

Temporarily disabled running MTR under "Clang 17 ASan" in GitHub
Workflows because of the "-stdlib=libc++ -fsanitize=address"
alloc-dealloc-mismatch issue
(llvm/llvm-project#59432).
Hopefully, the problem will be fixed in clang-18.
@percona-ysorokin percona-ysorokin merged commit 713fd54 into Percona-Lab:main Jun 4, 2024
7 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.

1 participant