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

Flashback binlog code cleanup and refactoring

    XMLWordPrintable

    Details

      Description

      The current flashback code has the following logic embedded into print_row_event

      print_row_event(ev)
        if flashback_enabled
          Store each event in a global events array.
       
        if ev_type == event_stmt_end and flashback_enabled
           print_all_stored_events in reverse.
           delete all events from the events array except the last one.
      

      The caller of print_row_event(ev) has the following logic:

      if (flashback_on and event != event_stmt_end)
        do_not_perform_cleanup
      else
        cleanup_current_event normally
      

      This logic introduces side effects in print_row_event and also makes the flashback logic highly coupled to the printing logic. A better approach would be:

      1. If flashback is enabled, instead of printing events, store them in an array.
      2. When event_stmt_end is encountered, print out the contents of the array in reverse using print_row_event.
      3. Finally clean up all events.

        Attachments

          Activity

            People

            Assignee:
            cvicentiu Vicențiu Ciorbaru
            Reporter:
            cvicentiu Vicențiu Ciorbaru
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:

                Git Integration