PS-11080 fix: Spoiled logical clock information in rewritten binlog (part 1)#124
Merged
Merged
Conversation
ba27dee to
d931fd2
Compare
…part 1) https://perconadev.atlassian.net/browse/PS-11080 This is a prerequisite commit required to implement rewriting 'sequence_number' / 'last_committed' / 'transaction_length' in GTID events. 'gtis_log' / 'anonymous_gtid_log' / 'gtid_tagged_log' event body and post-header classes from 'binsrv::events' extended with additional functionality that allows to perform the following operations: * manually construct * modify (currently only 'sequence_number' and 'last_committed' fields) * serialize * deserialize GTID_TAGGED_LOG event body deserialization (reading TLV pairs) extended with checking that all non-optional fields were deserialized. Currently only 'original_commit_timestamp', 'original_server_version' and 'commit_group_ticket' can be omitted. 'event_test.cpp' unit test extended with additional checks for encoding / parsing GTID_LOG, ANONYMOUS_GTID_LOG and GTID_TAGGED_LOG events. 'byte_span_encoding_test.cpp' unit test extended with a new test case that checks "packed int" conversion roundtrips. Introduced new "common_types.hpp" include file in the "binsrv::events" namespace that is supposed to define common types used between events. Currently only 'seq_no_t' is defined there. Added new "timestamp_helpers.hpp" helpers include file in the "util" namespace that provides functions to convert between std::chrono::high_resolution_clock::time_point' (aka 'high_resolution_time_point') and an unsigned integer representing microseconds. Fixed problem with 'immediate_server_version' / 'original_server_version' being serialized / deserialized in invalid order inside GTID events. Fixed problem in the 'util::insert_packed_int_to_byte_span_checked()' insertion function with missing early returns causing invalid encoded data. Fixed problem with invalid 'BOOST_TEST_MODULE' name in the 'uuid_test.cpp'. Fixed problem with invalid 'BOOST_TEST_MODULE' name in the 'byte_span_encoding_test.cpp'. Co-authored-by: Yura Sorokin <yura.sorokin@percona.com>
d931fd2 to
b7938b7
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.
https://perconadev.atlassian.net/browse/PS-11080
This is a prerequisite commit required to implement rewriting 'sequence_number' / 'last_committed' / 'transaction_length' in GTID events.
'gtis_log' / 'anonymous_gtid_log' / 'gtid_tagged_log' event body and post-header classes from 'binsrv::events' extended with additional functionality that allows to perform the following operations:
GTID_TAGGED_LOG event body deserialization (reading TLV pairs) extended with checking that all non-optional fields were deserialized. Currently only 'original_commit_timestamp', 'original_server_version' and 'commit_group_ticket' can be omitted.
'event_test.cpp' unit test extended with additional checks for encoding / parsing GTID_LOG, ANONYMOUS_GTID_LOG and GTID_TAGGED_LOG events.
'byte_span_encoding_test.cpp' unit test extended with a new test case that checks "packed int" conversion roundtrips.
Introduced new "common_types.hpp" include file in the "binsrv::events" namespace that is supposed to define common types used between events. Currently only 'seq_no_t' is defined there.
Added new "timestamp_helpers.hpp" helpers include file in the "util" namespace that provides functions to convert between
std::chrono::high_resolution_clock::time_point' (aka 'high_resolution_time_point') and an unsigned integer representing microseconds.
Fixed problem with 'immediate_server_version' / 'original_server_version' being serialized / deserialized in invalid order inside GTID events.
Fixed problem in the 'util::insert_packed_int_to_byte_span_checked()' insertion function with missing early returns causing invalid encoded data.
Fixed problem with invalid 'BOOST_TEST_MODULE' name in the 'uuid_test.cpp'. Fixed problem with invalid 'BOOST_TEST_MODULE' name in the 'byte_span_encoding_test.cpp'.