Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mysqlctl: add MyRocks dir/files to backups #4549

Merged
merged 2 commits into from
Jan 25, 2019

Conversation

derekperkins
Copy link
Member

Using MyRocks changes the data location from a normal MySQL installation. It leaves an .sdi file in the schema directory, where InnoDB would have an .ibd file. All the actual data however for all schemas is stored in a single .rocksdb directory at the data root, with no table specific files. This PR just adds a new file extension check for .sst to confirm a data directory to backup.

ls $DATADIR/schemaname/
-rw-r----- 1 vitess vitess 7.3K Jan 24 02:18 urls_519.sdi

ls $DATADIR/.rocksdb/
-rw-r----- 1 vitess vitess 8.5K Jan 24 02:18 000003.log
-rw-r----- 1 vitess vitess  18M Jan 24 01:44 000011.sst
-rw-r----- 1 vitess vitess  19M Jan 24 01:44 000012.sst
...
-rw-r----- 1 vitess vitess   16 Jan 23 17:51 CURRENT
-rw-r----- 1 vitess vitess   37 Jan 23 17:51 IDENTITY
-rw-r----- 1 vitess vitess    0 Jan 23 17:51 LOCK
-rw-r----- 1 vitess vitess  42K Jan 24 02:18 LOG
-rw-r----- 1 vitess vitess   13 Jan 23 17:51 MANIFEST-000001
-rw-r----- 1 vitess vitess 3.7K Jan 24 02:18 MANIFEST-000006
-rw-r----- 1 vitess vitess 7.1K Jan 23 17:51 OPTIONS-000008
-rw-r----- 1 vitess vitess 7.1K Jan 23 17:51 OPTIONS-000010

Signed-off-by: Derek Perkins <derek@derekperkins.com>
@derekperkins
Copy link
Member Author

There should be no backwards compatibility issues. The only potential side effect is if there were subdirectories that were previously ignored because they contained .sst files and not other db file extensions. Those directories will now be copied and restored. There is nothing that will be excluded that was previously included.

@sougou sougou requested a review from dkhenry January 25, 2019 04:00
@sougou
Copy link
Contributor

sougou commented Jan 25, 2019

This LGTM. @dkhenry do you have any comments?

@dkhenry
Copy link
Contributor

dkhenry commented Jan 25, 2019

I would just add that we add a .rocksdb folder to the backup_test to go along with the innodb files there.

Signed-off-by: Derek Perkins <derek@derekperkins.com>
Copy link
Contributor

@dkhenry dkhenry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@derekperkins derekperkins merged commit b92f377 into vitessio:master Jan 25, 2019
@derekperkins
Copy link
Member Author

Good call on updating those tests, I don't know how I missed those before.

@derekperkins derekperkins deleted the backup-myrocks-dir branch February 13, 2019 01:38
notfelineit pushed a commit to planetscale/vitess that referenced this pull request Mar 12, 2024
… data races on memorytopo Conn.closed (vitessio#4555)

* backport of 4549

* Fix import conflict

Signed-off-by: Matt Lord <mattalord@gmail.com>

---------

Signed-off-by: Matt Lord <mattalord@gmail.com>
Co-authored-by: Matt Lord <mattalord@gmail.com>
systay pushed a commit that referenced this pull request Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants