ozone
ozone copied to clipboard
HDDS-6983. Snapshot Chain - list of snapshots per snapshottable bucket
…t of snapshots. Iniitializes in-memory snapshot chains on start/restart from snapshotInfoTable. Provides interface to add/delete snapshot and for getting next/previous snapshots in snapshot chain.
What changes were proposed in this pull request?
This PR implements the in-memory snapshot chain for ozone object store snapshots. The snapshot chain provides the sequence of snapshots created in chronological order. Two snapshot chains are provided, the sequence of snapshots created per bucket path and the total global sequence of snapshots created. The snapshot chain will be maintained by the Snapshot Metadata manager and the creation sequence chains are intended to be used for efficient deletion and reclamation of keys.
The snapshot chains are initialized from the on-disk snapshotInfoTable
when instantiated on start/restart. Provided are interfaces to add / delete snapshots from the snapshot chain and getters for the previous and next snapshots in a snapshot sequence given a snapshot.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-6983
How was this patch tested?
Units tests : TestSnapshotChain
hadoop-ozone/ozone-manager$ mvn -Dtest=TestSnapshotChain test
[INFO] ------------------------------------------------------- [INFO] T E S T S [INFO] ------------------------------------------------------- [INFO] Running org.apache.hadoop.ozone.om.TestSnapshotChain [INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.091 s - in org.apache.hadoop.ozone.om.TestSnapshotChain [INFO] [INFO] Results: [INFO] [INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0
CI workflow
What is the plan for synchronization within the SnapshotChain structures? Snapshot diff could try to read at anytime, right?
What is the plan for synchronization within the SnapshotChain structures? Snapshot diff could try to read at anytime, right?
One SnapshotChainManager
is initialized from the SnapshotInfo
, loaded into memory and maintained by the SnapshotMetadataManager
(or equivalent). On each ratis
snapshot action, create and delete, the SnapshotChain
is updated and current. The state of snapshots is reflected by the SnapshotChainManager
in this manner. Each SnapshotChain
user, including snapshot diff, find the SnapshotChain
containing the current state of snapshots.
Further, on OM restart, the SnapshotChainManager
is loaded into memory initialized with the persistent storage snapshot state stored in the OM snapshotInfo table.
Thanks @neils-dev for the PR. Thanks @GeorgeJahad and @sadanand48 for reviewing this as well.