smengcl commented on code in PR #5070:
URL: https://github.com/apache/ozone/pull/5070#discussion_r1268704325
##########
hadoop-hdds/rocksdb-checkpoint-differ/src/main/java/org/apache/ozone/rocksdiff/RocksDBCheckpointDiffer.java:
##########
@@ -588,6 +590,8 @@ public void onCompactionCompleted(RocksDB db,
return;
}
+ waitForTarballCreation();
Review Comment:
@GeorgeJahad I agree we should try a better solution.
What I've been thinking is that, since the original intent of taking a DB
checkpoint (even before Ozone snapshot feature is implemented) is to transfer a
**consistent point-in-time** copy of the active DB to the bootstrapping
follower, we could apply the same principle to the _extras_ we added for the
Ozone snapshot feature, namely:
1. Compaction log
2. SST backup directory
So an ideal solution would be: if RocksDB had `onCheckpointBegin` (or
`onCheckpointCompleted`) listener, we could take a filesystem snapshot for both
and include that point-in-time copy of compaction log and SST backup dir in the
tarball instead. Based on the assumption that RocksDB won't perform
checkpointing while another compaction thread is running on the same DB (not
verified yet).
Problems are:
1. Only some relatively modern FSes (ZFS, btrfs,
[UFS](https://en.wikipedia.org/wiki/Unix_File_System), APFS) supports
snapshots, and commonly-used `ext4` doesn't. So this won't be a portable
solution. -- This can be worked around by enabling this only on supported FSes.
Otherwise we fall back to copying / hard-linking instead.
2. Latest RocksDB doesn't have checkpoint event listeners, we could add them
if we want to tho:
https://javadoc.io/static/org.rocksdb/rocksdbjni/8.3.2/org/rocksdb/AbstractEventListener.html#i0
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]