Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-40760

Lift the runtime dependency on the current Format Description event

    XMLWordPrintable

Details

    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:

      1. format version (always 4; hopefully won't increment anymore)
      2. server version (for compatibility modes in replication - but seemingly just rpl_master_has_bug() nowadays)
      3. 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.
      4. 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).

      Attachments

        Issue Links

          Activity

            People

              ParadoxV5 Jimmy Hú
              ParadoxV5 Jimmy Hú
              Kristian Nielsen Kristian Nielsen
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - Not Specified
                  Not Specified
                  Logged:
                  Time Spent - 1h
                  1h

                  Git Integration

                    Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.