PS-10244 feature: Add configuration options for specifying GTID-based / position-based replication mode #79
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.
https://perconadev.atlassian.net/browse/PS-10244
'replication' section of the main configuration file extended with one more required string 'mode' configuration parameter, which can be either 'position' or 'gtid'. At this moment only 'position' is supported.
'replication_config' class moved from the 'easymysql' namespace to 'binsrv'.
Added 'binbsrv::storage_metadata' class that is intended to keep persistent info for binlog storages. Currently it has only one attribute 'mode' (either 'position' or 'gtid') that indicates in which replication mode this storage was created. This metadata is stored in the storage folder (along with binlog index and binlog data files) under the 'metadata.json' name. In addition, for forward compatibility, this metadata file also includes the 'version' parameter that currently is alwas set to / expected to be '1'.
'binsrv::storage' constructor extended with additional logic to read / write and validate the content of the metadata file.
Similarly to 'util/nv_tuple_from_json.hpp' file that reads from JSON to 'util::nv_tuple', added 'util/nv_tuple_to_json.hpp' that writes data from 'util::nv_tuple' to JSON.
Main application now prints to the log file replication mode from the configuration file along with the one extracted from the storage metadata.
Re-factored the way how classes report their string-convertibility: now each class interested in specializing 'util::is_string_convertable' template does this in its own header. In order to minimize dependencies, 'util::is_string_convertable' definition extracted into separate header 'util/nv_tuple_json_support.hpp'.
We no longer use 'boost::json' as a header only library (by including 'boost/json/src.hpp'). Instead, we now use 'libboost_json.a' static library.
Updated 'set_up_binsrv_environment.inc' MTR include file - we now explicitly set '<replication.mode>' to 'position' in the generated configuration file.
'main_config.json' sample configuration file updated with new '<replication.mode>' parameter.
Updated 'README.md' with the '<replication.mode>' parameter description.