Details
-
Task
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
None
Description
I consider the whole idea of the format description event containing the
post-header length a misdesign. It goes way back, and I suppose there was
some intention to use this for backwards-compatible extensions, but I do not
think it works well for this.The way the format description event is used to interpret the bytes of other
events causes a lot of complexity and trickery in the code, always this need
to try to have the correct format description event available at all times.
There have been lots of bugs from this.Going forward, my preference is to stop relying on these post-header lenghts
in the FDE and even start removing references to it, in new development. My
intention is that we will not change these lengths ever again going forward,
instead of relying eg. on flag bits in the individual event to mark if
certain fields are available (or just the length stored in the event
itself). This is how most of extensions to event formats have been done in
MariaDB.⸺ knielsen, [Re. PR 5505](https://github.com/MariaDB/server/pull/5505#issuecomment-5240584927
We can possibly eliminate the common header length, too, since the base event header already has a flags field with unassigned bits.
New event types are always an option if extensions don't fit the current mould (think MySQL's V2 Rows events).
The remaining Format Description event fields are:
- format version (always 4; hopefully won't increment anymore)
- server version (for compatibility modes in replication - but seemingly just rpl_master_has_bug() nowadays)
- a timestamp that is either 0, or the same as the timestamp in the base header if this FDE is the start of the entire log.
- checksum algorithm for the events that follow
- The dream is to get rid of per-event checksumming entirely, as already done in the InnoDB Binlog (
MDEV-34705).
- The dream is to get rid of per-event checksumming entirely, as already done in the InnoDB Binlog (
Attachments
Issue Links
- includes
-
MDEV-40759 `mariadb-binlog --force-read --start-position` crashes on Unknown event
-
- Open
-
- relates to
-
MDEV-4698 With GTID replication, relay logs cannot be relied upon while purging binary logs on master
-
- Stalled
-