[MDEV-10570] Integrate existing DML only “Flashback” for MariaDB Server 10.2 Created: 2016-08-17 Updated: 2020-03-17 Resolved: 2017-01-22 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Replication |
| Fix Version/s: | 10.2.4 |
| Type: | Task | Priority: | Major |
| Reporter: | Ralf Gebhardt | Assignee: | Sergei Golubchik |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Epic Link: | Flashback | ||||||||
| Sprint: | 10.2.2-4 | ||||||||
| Description |
|
An implementation exists which needs to be
This Sub-Tasks does not cover new implementations to be able to "undo" DDL based changes. ==== Description ==== Flashback can rollback the instances/databases/tables to an old snapshot. Because the flashback binlog events will store in the memory, you should check if there is enough memory in your machine. ==== New Arguments ==== --flashback (-B) ==== Example ==== I have a table "t" in database "test", we can compare the output with "--flashback" and without.
Then, importing the output flashback file (/tmp/2.log), it can flashback your database/table to the special time (--start-datetime). ==== Implement ==== 1. As we know, if binlog_format is ROW (binlog-row-image=FULL in 10.1 and later), all columns value are store in the row event, so we can get the data before mis-operation. 2. Just do following things: 2.1 Change Event Type, INSERT->DELETE, DELETE->INSERT. 2.2 For Update_Event, swapping the SET part and WHERE part. 2.3 For Multi-Rows Event, reverse the rows sequence, from the last row to the first row. 2.4 Output those events from the last one to the first one which mis-operation happened. 2.5 Import the output file, then all the data will be recovered by inverse operations of mis-oprerations. |
| Comments |
| Comment by Lixun Peng [ 2016-09-14 ] |
|
Hi Sergei, I have sent an email to you, please review it. Thank you very much! |