[MDEV-16029] mysqldump: dump and restore historical data Created: 2018-04-25 Updated: 2023-10-06 Resolved: 2022-10-26 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Documentation, Scripts & Clients, Versioned Tables |
| Fix Version/s: | 10.11.1 |
| Type: | Task | Priority: | Major |
| Reporter: | Elena Stepanova | Assignee: | Elena Stepanova |
| Resolution: | Fixed | Votes: | 9 |
| Labels: | Preview_10.11 | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Description |
|
Backup through mysqldump loses historical data from versioned tables. mysqldump does not read historical rows from the versioned tables, it runs SELECT, not SELECT .. FOR SYSTEM_TIME ALL. But even if we fixed it, it would still be impossible to load this data back, since we are dealing either with invisible columns into which we can't insert at all, or with virtual columns for which values are ignored. So, for now it becomes a known limitation which needs to be documented. |
| Comments |
| Comment by Ian Gilfillan [ 2018-04-26 ] | |||||||||||||||||||||||
|
Documented at https://mariadb.com/kb/en/library/system-versioned-tables/#limitations - can close this report if this is sufficient, or reassign to look at the primary issue. | |||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2018-05-17 ] | |||||||||||||||||||||||
|
Now when
The second is simpler to implement and will create smaller dumps. The former will create huge but more readable dumps. Perhaps, doing BINLOG statements with decoded INSERT statements in comments would be the best combination? | |||||||||||||||||||||||
| Comment by Aleksey Midenkov [ 2018-06-18 ] | |||||||||||||||||||||||
|
The issue type is Task (if it influences anything). | |||||||||||||||||||||||
| Comment by Aleksey Midenkov [ 2018-06-21 ] | |||||||||||||||||||||||
|
Data is dumped as normal INSERT statements after allowing history modification ( | |||||||||||||||||||||||
| Comment by Aleksey Midenkov [ 2018-07-03 ] | |||||||||||||||||||||||
| Comment by Aleksey Midenkov [ 2018-07-04 ] | |||||||||||||||||||||||
|
--xml option should be supported as well. This imposes following requirements: 1. --xml option produces history. System fields contain Extra="ROW START/END GENERATED" option. If system fields are system-hidden they are included in <table_structure> anyway with Extra="SYSTEM INVISIBLE ROW START/END GENERATED" option. <table_structure> includes System_versioning="Y" option. Example:
2. LOAD XML loads such data in case system_versioning_modify_history is ON. When system_versioning_modify_history is OFF LOAD XML fails to set row_start, row_end fields. 3. mysqlimport imports such tables with history. | |||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2018-07-09 ] | |||||||||||||||||||||||
|
midenok, make them into separate bugs, please. Let's first just make dump/restore to work, this is what most people need. And they would appreciate a quick fix, instead of waiting for a big solution that covers every possible use case and dump format. | |||||||||||||||||||||||
| Comment by Aleksey Midenkov [ 2018-07-10 ] | |||||||||||||||||||||||
|
serg Sure, that what I thought. | |||||||||||||||||||||||
| Comment by Aleksey Midenkov [ 2018-07-16 ] | |||||||||||||||||||||||
| Comment by Robert Dyas [ 2018-07-30 ] | |||||||||||||||||||||||
|
Would it be possible to get | |||||||||||||||||||||||
| Comment by Robert Dyas [ 2018-08-22 ] | |||||||||||||||||||||||
|
Has testing finished on this? | |||||||||||||||||||||||
| Comment by Robert Dyas [ 2018-09-12 ] | |||||||||||||||||||||||
|
This has been InReview for quite a while... any idea if it will make the next 10.3 release? | |||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2018-09-19 ] | |||||||||||||||||||||||
|
I'm reviewing it right now, after that we'll know | |||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2018-09-21 ] | |||||||||||||||||||||||
|
Unfortunately, it's unlikely that this feature will get into 10.3.10. It depends on | |||||||||||||||||||||||
| Comment by Robert Dyas [ 2018-10-29 ] | |||||||||||||||||||||||
|
This looks like its been In Review for a long time - will this make the next release? | |||||||||||||||||||||||
| Comment by Robert Dyas [ 2018-11-18 ] | |||||||||||||||||||||||
|
Does it look like this will make it into 10.3.11 ? | |||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2018-11-18 ] | |||||||||||||||||||||||
|
Unfortunately, no, not in 10.3.11 | |||||||||||||||||||||||
| Comment by Silver Asu [ 2019-09-25 ] | |||||||||||||||||||||||
|
We are also waiting for this feature. | |||||||||||||||||||||||
| Comment by Robert Dyas [ 2019-12-18 ] | |||||||||||||||||||||||
|
Any idea of when/if this will be implemented? | |||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2019-12-18 ] | |||||||||||||||||||||||
|
Hopefully in 10.5. But generally you should be better off using mariabackup, it'll backup tables with all history just fine. | |||||||||||||||||||||||
| Comment by Robert Dyas [ 2019-12-18 ] | |||||||||||||||||||||||
|
I was not aware of that... how do you restore with history records? | |||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2022-09-17 ] | |||||||||||||||||||||||
|
in bb-10.11- | |||||||||||||||||||||||
| Comment by Elena Stepanova [ 2022-10-20 ] | |||||||||||||||||||||||
|
I have no objections against pushing bb-10.11- Some notes in no particular order (greenman FYI):
| |||||||||||||||||||||||
| Comment by Aliaksei [ 2023-10-04 ] | |||||||||||||||||||||||
|
Hello, any plans to support precision versioning as well (transaction based)? I'd very like to be able to get dumps with history from my AWS RDS instance, but it looks like it just not possible for now. | |||||||||||||||||||||||
| Comment by Aleksey Midenkov [ 2023-10-06 ] | |||||||||||||||||||||||
|
rembrandt I wouldn't recommend precise versioning until MDEV-16226 as it has many deficiencies/bugs. Please watch that ticket and add vote as this can influence task priority. |