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

Port Time Machine/Flashback Feature to MariaDB

Details

    • 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

      Attachments

        Issue Links

          Activity

            danblack Daniel Black added a comment -

            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

            danblack Daniel Black added a comment - 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
            danblack Daniel Black added a comment -

            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
            

            danblack Daniel Black added a comment - 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

            People

              plinux Lixun Peng
              plinux Lixun Peng
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

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