Skip to content

PS-11080 fix: Spoiled logical clock information in rewritten binlog (part 1)#124

Merged
percona-ysorokin merged 1 commit into
0.2from
sequence_number_rewrite_serialization
May 17, 2026
Merged

PS-11080 fix: Spoiled logical clock information in rewritten binlog (part 1)#124
percona-ysorokin merged 1 commit into
0.2from
sequence_number_rewrite_serialization

Conversation

@percona-ysorokin
Copy link
Copy Markdown
Collaborator

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'.

@percona-ysorokin percona-ysorokin force-pushed the sequence_number_rewrite_serialization branch 3 times, most recently from ba27dee to d931fd2 Compare May 15, 2026 22:21
…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>
@percona-ysorokin percona-ysorokin force-pushed the sequence_number_rewrite_serialization branch from d931fd2 to b7938b7 Compare May 17, 2026 16:36
@percona-ysorokin percona-ysorokin merged commit 00daa7e into 0.2 May 17, 2026
7 checks passed
@percona-ysorokin percona-ysorokin deleted the sequence_number_rewrite_serialization branch May 17, 2026 17:05
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