[MDEV-26829] Flashback binlog code cleanup and refactoring Created: 2021-10-14  Updated: 2021-10-14

Status: Open
Project: MariaDB Server
Component/s: Replication, Scripts & Clients
Fix Version/s: None

Type: Task Priority: Major
Reporter: Vicențiu Ciorbaru Assignee: Vicențiu Ciorbaru
Resolution: Unresolved Votes: 0
Labels: None


 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.

Generated at Thu Feb 08 09:48:16 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.