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
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.
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
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
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
Lixun Peng
Lixun Peng
Votes:
0Vote for this issue
Watchers:
7Start 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.
{"report":{"fcp":1382.7999999523163,"ttfb":678.6000001430511,"pageVisibility":"visible","entityId":57519,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"8cc2bb64-199e-41ab-a077-d0d941f7abb9","navigationType":0,"readyForUser":1466.7999999523163,"redirectCount":0,"resourceLoadedEnd":1067.2999999523163,"resourceLoadedStart":687,"resourceTiming":[{"duration":41.200000047683716,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":687,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":687,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":728.2000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":41.80000019073486,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/2bf333562ca6724060a9d5f1535471f6/_/download/contextbatch/css/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":687.2999999523163,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":687.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":729.1000001430511,"responseStart":0,"secureConnectionStart":0},{"duration":242.39999985694885,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":687.6000001430511,"connectEnd":730.7000000476837,"connectStart":730.7000000476837,"domainLookupEnd":730.7000000476837,"domainLookupStart":730.7000000476837,"fetchStart":687.6000001430511,"redirectEnd":0,"redirectStart":0,"requestStart":730.9000000953674,"responseEnd":930,"responseStart":744.2000000476837,"secureConnectionStart":730.7000000476837},{"duration":379.59999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/2bf333562ca6724060a9d5f1535471f6/_/download/contextbatch/js/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true","startTime":687.7000000476837,"connectEnd":687.7000000476837,"connectStart":687.7000000476837,"domainLookupEnd":687.7000000476837,"domainLookupStart":687.7000000476837,"fetchStart":687.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":735.4000000953674,"responseEnd":1067.2999999523163,"responseStart":751.9000000953674,"secureConnectionStart":687.7000000476837},{"duration":68.59999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/a9324d6758d385eb45c462685ad88f1d-CDN/lu2cib/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":687.9000000953674,"connectEnd":687.9000000953674,"connectStart":687.9000000953674,"domainLookupEnd":687.9000000953674,"domainLookupStart":687.9000000953674,"fetchStart":687.9000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":735.7000000476837,"responseEnd":756.5,"responseStart":755.1000001430511,"secureConnectionStart":687.9000000953674},{"duration":68.89999985694885,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":688.1000001430511,"connectEnd":688.1000001430511,"connectStart":688.1000001430511,"domainLookupEnd":688.1000001430511,"domainLookupStart":688.1000001430511,"fetchStart":688.1000001430511,"redirectEnd":0,"redirectStart":0,"requestStart":735.7999999523163,"responseEnd":757,"responseStart":755.7000000476837,"secureConnectionStart":688.1000001430511},{"duration":69.20000004768372,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":688.2000000476837,"connectEnd":688.2000000476837,"connectStart":688.2000000476837,"domainLookupEnd":688.2000000476837,"domainLookupStart":688.2000000476837,"fetchStart":688.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":735.7999999523163,"responseEnd":757.4000000953674,"responseStart":756.5,"secureConnectionStart":688.2000000476837},{"duration":46.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2cib/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":688.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":688.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":735,"responseStart":0,"secureConnectionStart":0},{"duration":75.09999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":688.6000001430511,"connectEnd":688.6000001430511,"connectStart":688.6000001430511,"domainLookupEnd":688.6000001430511,"domainLookupStart":688.6000001430511,"fetchStart":688.6000001430511,"redirectEnd":0,"redirectStart":0,"requestStart":738.2000000476837,"responseEnd":763.7000000476837,"responseStart":761.7999999523163,"secureConnectionStart":688.6000001430511},{"duration":47.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.css?jira.create.linked.issue=true","startTime":688.7999999523163,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":688.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":736.2999999523163,"responseStart":0,"secureConnectionStart":0},{"duration":75.89999985694885,"initiatorType":"script","name":"https://jira.mariadb.org/s/5d5e8fe91fbc506585e83ea3b62ccc4b-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.js?jira.create.linked.issue=true&locale=en","startTime":688.9000000953674,"connectEnd":688.9000000953674,"connectStart":688.9000000953674,"domainLookupEnd":688.9000000953674,"domainLookupStart":688.9000000953674,"fetchStart":688.9000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":738.5,"responseEnd":764.7999999523163,"responseStart":762.7000000476837,"secureConnectionStart":688.9000000953674},{"duration":361.30000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":694.2999999523163,"connectEnd":694.2999999523163,"connectStart":694.2999999523163,"domainLookupEnd":694.2999999523163,"domainLookupStart":694.2999999523163,"fetchStart":694.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":829.7999999523163,"responseEnd":1055.6000001430511,"responseStart":1050.6000001430511,"secureConnectionStart":694.2999999523163},{"duration":358.59999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":698.4000000953674,"connectEnd":698.4000000953674,"connectStart":698.4000000953674,"domainLookupEnd":698.4000000953674,"domainLookupStart":698.4000000953674,"fetchStart":698.4000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":891.4000000953674,"responseEnd":1057,"responseStart":1053.7000000476837,"secureConnectionStart":698.4000000953674},{"duration":94,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1084.2000000476837,"connectEnd":1084.2000000476837,"connectStart":1084.2000000476837,"domainLookupEnd":1084.2000000476837,"domainLookupStart":1084.2000000476837,"fetchStart":1084.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":1145.7999999523163,"responseEnd":1178.2000000476837,"responseStart":1177.2999999523163,"secureConnectionStart":1084.2000000476837}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":517,"responseStart":678,"responseEnd":698,"domLoading":683,"domInteractive":1543,"domContentLoadedEventStart":1543,"domContentLoadedEventEnd":1589,"domComplete":2088,"loadEventStart":2088,"loadEventEnd":2089,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1510.6000001430511},{"name":"bigPipe.sidebar-id.end","time":1511.4000000953674},{"name":"bigPipe.activity-panel-pipe-id.start","time":1511.6000001430511},{"name":"bigPipe.activity-panel-pipe-id.end","time":1513.7999999523163},{"name":"activityTabFullyLoaded","time":1605.5}],"measures":[],"correlationId":"afda305cf5f85b","effectiveType":"4g","downlink":9.3,"rtt":0,"serverDuration":95,"dbReadsTimeInMs":11,"dbConnsTimeInMs":19,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
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