Skip to content

PS-10321 fix: binlog-server fails to read the new events after upgrading server from 8.0 to 8.4#101

Merged
percona-ysorokin merged 1 commit intomainfrom
upgrade_8_0_to_8_4
Mar 11, 2026
Merged

PS-10321 fix: binlog-server fails to read the new events after upgrading server from 8.0 to 8.4#101
percona-ysorokin merged 1 commit intomainfrom
upgrade_8_0_to_8_4

Conversation

@percona-ysorokin
Copy link
Collaborator

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

Fixed an issue with Binlog Server utility not being able to process FORMAT_DESCRIPTION events generated by previous versions of MySQL Server (e.g. 8.0 FDEs coming from 8.4 server). This may happen when user performs an in-place upgrade of his data directory and has old binlog files with 8.0 FDEs along with new binlog files with 8.4 FDEs, which are 1 byte larger.

Reworked the way how 'binsrv::events::event_view' class determines the boundaries of event sections (common_header / post_header / body / footer) for FORMAT_DESCRIPTION event. Because of this, it is now possible to parse FDEs generated on different versions of the MySQL Server (which are different in size).

Simplified 'binsrv::events::event:' class byte span constructor - it no longer requires 'reader_context' as a parameter.

Reworked FORMAT_DESCRIPTION post header class constructor - it no longer expects a data span of pre-defined length. Instead it checks the length dynamically based on the 'server_version' extracted on the way.

In 'binsrv::events::reader_context' class we now differentiate between encoded server version specified during object construction and coming from the MySQL connection object ('get_connection_encoded_server_version()' method) and encoded server version encountered in the last processed FORMAT_DESCRIPTION event ('get_current_encoded_server_version()' method).

Added 'binlog_streaming.data_directory_8_0_to_8_4_upgrade' MTR test case that checks if the Binlog Server utility can properly download events from an instance of MySQL Server after 8.0 -> 8.4 upgrade. The following script was used to generate original 8.0 binlog files: CREATE TABLE t1(id SERIAL, PRIMARY KEY(id));
INSERT INTO t1 VALUES();
INSERT INTO t1 VALUES();

START TRANSACTION;
INSERT INTO t1 VALUES();
INSERT INTO t1 VALUES();
INSERT INTO t1 VALUES();
INSERT INTO t1 VALUES();
COMMIT;

FLUSH BINARY LOGS;

UPDATE t1 SET id = id + 100 WHERE id <= 3;
DELETE FROM t1 WHERE id < 100;
The test has 2 combinations: 'position' and 'gtid'. For each of them an individual data directory archive was created.

…ing server from 8.0 to 8.4

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

Fixed an issue with Binlog Server utility not being able to process FORMAT_DESCRIPTION
events generated by previous versions of MySQL Server (e.g. 8.0 FDEs coming from 8.4
server). This may happen when user performs an in-place upgrade of his data directory and
has old binlog files with 8.0 FDEs along with new binlog files with 8.4 FDEs, which are 1 byte
larger.

Reworked the way how 'binsrv::events::event_view' class determines the boundaries of event
sections (common_header / post_header / body / footer) for FORMAT_DESCRIPTION event.
Because of this, it is now possible to parse FDEs generated on different versions of the MySQL
Server (which are different in size).

Simplified 'binsrv::events::event:' class byte span constructor - it no longer requires
'reader_context' as a parameter.

Reworked FORMAT_DESCRIPTION post header class constructor - it no longer expects a data
span of pre-defined length. Instead it checks the length dynamically based on the
'server_version' extracted on the way.

In 'binsrv::events::reader_context' class we now differentiate between encoded server version
specified during object construction and coming from the MySQL connection object
('get_connection_encoded_server_version()' method) and encoded server version
encountered in the last processed FORMAT_DESCRIPTION event
('get_current_encoded_server_version()' method).

Added 'binlog_streaming.data_directory_8_0_to_8_4_upgrade' MTR test case that checks if
the Binlog Server utility can properly download events from an instance of MySQL Server after 8.0 -> 8.4 upgrade. The following script was used to generate original 8.0 binlog files:
CREATE TABLE t1(id SERIAL, PRIMARY KEY(id));
INSERT INTO t1 VALUES();
INSERT INTO t1 VALUES();

START TRANSACTION;
INSERT INTO t1 VALUES();
INSERT INTO t1 VALUES();
INSERT INTO t1 VALUES();
INSERT INTO t1 VALUES();
COMMIT;

FLUSH BINARY LOGS;

UPDATE t1 SET id = id + 100 WHERE id <= 3;
DELETE FROM t1 WHERE id < 100;
The test has 2 combinations: 'position' and 'gtid'. For each of them an individual data
directory archive was created.
@percona-ysorokin percona-ysorokin merged commit 8429ba2 into main Mar 11, 2026
7 checks passed
@percona-ysorokin percona-ysorokin deleted the upgrade_8_0_to_8_4 branch March 11, 2026 00:49
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