Skip to content

PBS-37 feature: Combine binlog_server with minimysql_server into a single executable (part 5) - #182

Open
percona-ysorokin wants to merge 1 commit into
Percona-Lab:mainfrom
percona-ysorokin:combined_binary_assemble
Open

PBS-37 feature: Combine binlog_server with minimysql_server into a single executable (part 5)#182
percona-ysorokin wants to merge 1 commit into
Percona-Lab:mainfrom
percona-ysorokin:combined_binary_assemble

Conversation

@percona-ysorokin

Copy link
Copy Markdown
Collaborator

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

Combined functionality from 'binlog_server' and 'minimysql_server' binaries.

'binlog_server' in the 'pull' mode can now accept MySQL connections on a hardcoded port with predefined user credentials.

'operations::generic_operation<>' template specialization for the 'pull' operation extended with initializing an instance of the 'minimysql::network_service' class (a MySQL protocol-aware network listener).

Reworked the way how 'operations::generic_operation<>' template specializations for both 'fetch' and 'pull' operations set custom system signal handlers. Instead of 'operations::flag_signal_guard' which simply tests a global atomic flag and sets custom signal handlers (SIGINT and SIGTERM that set this flag), we now use 'boost::asio::io_context' and 'boost::asio::signal_set'. Custom signal handler simply calls 'io_context::stop()' that allows 'io_context::run()' running in the main thread to terminate. Also, we now run
'collector_ctx.receive_binlog_events()' in a separate thread (spawn via 'std::async()').

Removed 'operations::flag_signal_guard' class.
Removed 'minimysql_app.cpp' file.
Removed 'minimysql_server' executable from the 'CMakeLists.txt'.

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.

🟡 Changes recommended

The merged target is missing the direct OpenSSL dependency required to compile mini-MySQL sources portably.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Combines binlog collection and mini-MySQL serving in the binlog_server executable while modernizing signal handling.

Changes:

  • Adds the MySQL listener to pull mode.
  • Uses Boost.Asio and asynchronous collection for shutdown handling.
  • Removes the standalone mini-MySQL executable and legacy signal guard.
File summaries
File Description
CMakeLists.txt Merges executable sources and dependencies.
src/operations/pull_operation.cpp Adds listener and asynchronous collection.
src/operations/fetch_operation.cpp Migrates signal handling to Boost.Asio.
src/operations/collector_context.hpp Updates the collection API.
src/operations/collector_context.cpp Uses io_context for termination.
src/operations/flag_signal_guard.hpp Removes the legacy signal guard.
src/operations/flag_signal_guard.cpp Removes its implementation.
src/operations/flag_signal_guard_fwd.hpp Removes its forward declaration.
src/minimysql_app.cpp Removes the standalone server entry point.
Review details
  • Files reviewed: 9/9 changed files
  • Comments generated: 1
  • Review effort level: Balanced

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

Comment thread CMakeLists.txt
Comment on lines +702 to +703
Boost::headers Boost::json Boost::url Boost::asio
aws-cpp-sdk-s3-crt
…ngle executable (part 5)

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

Combined functionality from 'binlog_server' and 'minimysql_server'
binaries.

'binlog_server' in the 'pull' mode can now accept MySQL connections
on a hardcoded port with predefined user credentials.

'operations::generic_operation<>' template specialization for the
'pull' operation extended with initializing an instance of the 'minimysql::network_service' class (a MySQL protocol-aware
network listener).

Reworked the way how 'operations::generic_operation<>' template
specializations for both 'fetch' and 'pull' operations set custom system
signal handlers. Instead of 'operations::flag_signal_guard' which simply
tests a global atomic flag and sets custom signal handlers (SIGINT and
SIGTERM that set this flag), we now use 'boost::asio::io_context' and 'boost::asio::signal_set'. Custom signal handler simply calls
'io_context::stop()' that allows 'io_context::run()' running in the main
thread to terminate. Also, we now run
'collector_ctx.receive_binlog_events()' in a separate thread (spawn via
'std::async()').

Removed 'operations::flag_signal_guard' class.
Removed 'minimysql_app.cpp' file.
Removed 'minimysql_server' executable from the 'CMakeLists.txt'.

Temporarily marked 'binlog_streaming.binlog_flush' and
'binlog_streaming.pull_mode' MTR test cases as non-parallel as they run
'binlog_server' executable in the 'pull' mode that now accepts MySQL
connections on a hardcoded port. Without this change on of the
'binlog_server' instances wont be able to start listening on this
network port.
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.

2 participants