[MDEV-10459] Port Time Machine/Flashback Feature to MariaDB Created: 2016-07-28  Updated: 2019-03-18

Status: Open
Project: MariaDB Server
Component/s: Replication
Fix Version/s: None

Type: Epic Priority: Major
Reporter: Lixun Peng Assignee: Lixun Peng
Resolution: Unresolved Votes: 0
Labels: replication

Attachments: PNG File flashback-name-graph.png     PNG File flashback-name-summary.png    
Issue Links:
Blocks
is blocked by MDEV-10571 Implement support to handle DDL State... Open
Epic Name: Flashback

 Description   

What’s Time Machine

  • Rolling back instances/databases/tables to a snapshot
  • Implement on Server-Level, so support all engines.
  • By full image format binary logs
  • Currently, it’s a feature inside mysqlbinlog tool (with --flashback option)

How Time Machine Works

  • As we know, if binlog_format is ROW, all columns’ values are store in the row event, so we can
    get the data before mis-operation.
  • Just do following things:
    • Change Event Type, INSERT->DELETE, DELETE->INSERT
    • For Update_Event, swapping the SET part and WHERE part
    • Applying those events from the last one to the first one which mis-operation happened.
    • All the data will be recovered by inverse operations of mis-oprerations

DDL supports are necessary

  • For ADD INDEX/COLUMN, or CREATE TABLE query, just drop the index, column, table when running Flashback.
  • For DROP INDEX/COLUMN, or DROP TABLE query, will copy or rename the old table to a reserved database. When Flashback is running, I can drop new table, and rename the saved old table to original database.
  • For TRUNCATE table, I just rename old table to reserved database and create a new empty table.

How to Use Time Machine

  • I will create a Time Machine script to package mysqlbinlog --flashback command


 Comments   
Comment by Daniel Black [ 2016-11-02 ]

Survey to choose a name. This was mentioned at the MariaDB developers meetup. Noone actioned it so I have. This is my first survey monkey attempt so criticisms accepted.

Survey:

https://www.surveymonkey.com/r/T8JVPR3

Results:

https://www.surveymonkey.com/results/SM-DPMRQV9N

Comment by Daniel Black [ 2016-12-05 ]

Final survey responses attached. Below are the results from "Other". I was adding the Other results to the main survery as they appears and as such some will be include both below and in the summary. I leave interpretation and final decision on names to serg.

 Showing 11 responses
 
LogBack
11/13/2016 6:02 AM
 
Binlog restore
11/10/2016 2:44 AM
 
Binlog restore
11/10/2016 2:43 AM
 
ThRowback
11/7/2016 6:00 PM
 
reLog
11/4/2016 12:15 AM
 
Replication rollback / Binlog rollback
11/3/2016 11:36 AM
 
Binlog Tardis
11/3/2016 7:19 AM
 
BinBack
11/3/2016 4:41 AM
 
Time back
11/2/2016 5:54 PM
 
Binlog retract (--retract)
11/2/2016 12:44 PM
 
Binlog revert
11/2/2016 11:32 AM
Total Respondents: 33

Generated at Thu Feb 08 07:42:23 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.