[MDEV-16355] Add option for mysqldump to read data as of specific timestamp from system-versioned tables Created: 2018-05-31 Updated: 2023-11-27 Due: 2021-09-14 Resolved: 2021-10-09 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Scripts & Clients, Versioned Tables |
| Fix Version/s: | 10.7.0 |
| Type: | Task | Priority: | Critical |
| Reporter: | Valerii Kravchuk | Assignee: | Sergei Golubchik |
| Resolution: | Fixed | Votes: | 3 |
| Labels: | mysqldump | ||
| Issue Links: |
|
||||||||||||||||||||||||||||
| Description |
|
It would be great to have an option for mysqldump to read data as of specific timestamp from system-versioned tables. One should just use:
Instead of simple SELECT for such tables if the option is provided. I think it makes sense to implement this separately from |
| Comments |
| Comment by Aleksey Midenkov [ 2018-06-01 ] | |||||||||||
|
There should be options for: 1. dump with history or current snapshot only ( 1. and 2. should be compatible, providing the ability to dump at specific point in time with all prior history. | |||||||||||
| Comment by Aleksey Midenkov [ 2018-07-17 ] | |||||||||||
Task statementNew mysqldump option: --asof-timestamp=T. If both --dump-history and --asof-timestamp=T are specified, then history is dumped from the beginning up to T. The query is executed roughly like this:
If only --asof-timestamp=T, then data is dumped without prior history. The query is executed roughly like this:
NoteThis option specifies only timestamp literal. It does not specify TRX_ID for precise-versioned tables (though specifying a timestamp is of course valid). This is the subject for further development (e.g. --asof-transaction). It does not specify any functional expressions. Security checkFail on single quote (') symbol to avoid forged queries. | |||||||||||
| Comment by Aleksey Midenkov [ 2018-07-27 ] | |||||||||||
|
| |||||||||||
| Comment by Robert Dyas [ 2018-09-12 ] | |||||||||||
|
Although we don't need this feature, we do need | |||||||||||
| Comment by Sergei Golubchik [ 2021-08-15 ] | |||||||||||
|
for the reference:
| |||||||||||
| Comment by Aleksey Midenkov [ 2021-08-19 ] | |||||||||||
|
I'd expect this pushed together with | |||||||||||
| Comment by Sergei Golubchik [ 2021-08-19 ] | |||||||||||
|
This is a very clear, independent, and rather small feature. Let's not delay it unnecessary by combining it with two larger and way more arguable features. It can get pushed much faster it it won't wait for two other MDEVs | |||||||||||
| Comment by Roel Van de Paar [ 2021-10-09 ] | |||||||||||
|
Not sure if I missing something here: TODO-3118 Lists this feature as present in 10.7 trunk, and this ticket is closed with a fix version of 10.7. However, neither 10.7 trunk, nor 10.5.11 (the github.com/tempesta-tech repo listed above) nor 10.5 trunk seems to have the feature implemented:
| |||||||||||
| Comment by Sergei Golubchik [ 2021-10-09 ] | |||||||||||
|
| |||||||||||
| Comment by Roel Van de Paar [ 2021-10-12 ] | |||||||||||
|
Lol. The comments above mentioned --asof... not --as-of.... Thanks! | |||||||||||
| Comment by Roel Van de Paar [ 2021-10-29 ] | |||||||||||
|
To clarify, --dump-history was (eventually) not added here, only --as-of. The --as-of option was documented. | |||||||||||
| Comment by Roel Van de Paar [ 2021-10-29 ] | |||||||||||
|
Logged | |||||||||||
| Comment by Roel Van de Paar [ 2021-10-31 ] | |||||||||||
|
For any customers/users reviewing the implementation of -as-of please note there is up-to microsecond precision:
| |||||||||||
| Comment by Roel Van de Paar [ 2021-10-31 ] | |||||||||||
|
Logged MDEV-26946 Various small mysqldump manual improvements for the --as-of and --tz-utc options |