Fork me on GitHub
#xtdb
<
2023-12-18
>
Petr Valenta15:12:02

Trying to find most simple solution for backing up rocksdb (document-store, transaction-store) of running application. What i have found is tool ldb.

ldb --db=./data/dev/doc-store backup --backup_dir=./data/dev/doc-store_backup
ldb command fails with:
Failed: IO error: While lock file: /home/petr/work/xtdb-play/data/dev/doc-store/LOCK: Resource temporarily unavailable
For successful backup I have to stop node and then start it again after backup is complete.

refset16:12:10

Hey @U068KARHD09 that's a limitation of how Rocks interacts with the filesystem. The only "safe" / supported way of doing this with a running node is to use the lower level APIs. Is this something you're trying to support in production already? Or are you still designing the architecture?

refset16:12:42

The checkpointing system already implements all this logic, using the relevant internal APIs, but currently only works for the index-store.

Petr Valenta16:12:49

No it's not production app, it's a playground. I am playing a few months with clojure at all and finding right libraries for my future web projects and xtdb will for sure be one of them but probably with postgres backend.

👍 1
refset16:12:26

Cool, good to know, happy to help with the internal APIs if you do want to go down that route. But yeah using Postgres as the document store/tx-log bypasses the problem

Petr Valenta16:12:56

What lower level API do you mean please? Use BackupEngine from rocksdbjni? I think lock from node doesn't allow this anyway.

Petr Valenta16:12:00

another way should be use of filesystem snapshot with (zfs snapshot or btrfs .....) but it's a little bit risky 🙂

refset16:12:59

the workaround code here might be helpful also (i.e. note there's a filesystem checkpoint store) https://github.com/xtdb/xtdb/issues/1813

Petr Valenta16:12:37

Thank you very much! ...I will walk through it because rocksdb is nice

🙏 1