[MCOL-931] Partition Backup / Restore Created: 2017-09-20 Updated: 2023-10-26 Resolved: 2021-01-17 |
|
| Status: | Closed |
| Project: | MariaDB ColumnStore |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | N/A |
| Type: | New Feature | Priority: | Major |
| Reporter: | hogeun cheong | Assignee: | Todd Stoffel (Inactive) |
| Resolution: | Won't Do | Votes: | 1 |
| Labels: | Backup | ||
| Epic Link: | ColumnStore Partitioning |
| Description |
|
ColumnStore does not support partition backup and restore. After several attempts, I found out how to back up and restore specific partitions. ▶ Informations.
1. backup MariaDB [(none)]> select calshowpartitions('test', 'security_tbl', 'stime');
2) make a script that backs up the* object_id files and the dictionary_object_id files* from 0th partition. >> ./backup_security_0.sh 3) Make a script that back up the below files. >> echo "tar cvzf security_0_meta.tgz /usr/local/mariadb/columnstore/mysql/db/test/ /usr/local/mariadb/columnstore/data1/000.dir/000.dir/003.dir/ /usr/local/mariadb/columnstore/data1/000.dir/000.dir/004.dir/ /usr/local/mariadb/columnstore/data1/000.dir/000.dir/007.dir/ /usr/local/mariadb/columnstore/data1/000.dir/000.dir/008.dir/ /usr/local/mariadb/columnstore/data1/systemFiles/" > backup_security_0_meta.sh >> ./backup_security_0_meta.sh 2. Restore 5) Show the Partitions.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 6) Disable all Partitions.
------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------ 7) enable the 0th Partition. MariaDB [(none)]> select calenablepartitions('test', 'security_tbl', '0.0.1');
------------------------------------------------------
------------------------------------------------------ MariaDB [(none)]> select calenablepartitions('test', 'security_tbl', '0.1.1');
------------------------------------------------------
------------------------------------------------------ MariaDB [(none)]> select calenablepartitions('test', 'security_tbl', '0.2.1');
------------------------------------------------------
------------------------------------------------------ MariaDB [(none)]> select calenablepartitions('test', 'security_tbl', '0.3.1');
------------------------------------------------------
------------------------------------------------------ We hope that this feature will be developed in the future. |
| Comments |
| Comment by David Thompson (Inactive) [ 2017-09-21 ] |
|
brown2773 very ingenious approach! I think step 3 is probably flawed and where we'd need to enhance the product. By backing up the entire brm metadata including the extent map you'd have an issue restoring this if you had changes in the target database you are restoring to. If you are strict about maintaining the 2 in exact sync then it should in theory work fine. Also not sure about copying the additional data files in step 3, i assume the system didn't work without those? One of our engineers wrote a blog about the directory naming if this helps: https://linuxjedi.co.uk/2017/09/01/how-mariadb-columnstores-filenames-work/ Anyway this is a very good feature enhancement regardless. I suspect it should be relatively easy to do if we can find a way to migrate just the portion of extent map for the partition plus we can provide an easier interface as well. |
| Comment by hogeun cheong [ 2017-09-22 ] |
|
Thank you for your reply and the blog you gave me. I want to implement partition backup and restore although i am also concerned about step 3. |
| Comment by David Thompson (Inactive) [ 2017-09-22 ] |
|
the columnstore info schema tables all provide the necessary information (columns, extents, files) to map columns to the underyling columnar files (making sure you also handle dictionary extents). In your original query above you might want to add brackets around the or clause for that which is always good practice anyway. |