ozone icon indicating copy to clipboard operation
ozone copied to clipboard

HDDS-6983. Snapshot Chain - list of snapshots per snapshottable bucket

Open neils-dev opened this issue 2 years ago • 2 comments

…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

neils-dev avatar Aug 05 '22 23:08 neils-dev

What is the plan for synchronization within the SnapshotChain structures? Snapshot diff could try to read at anytime, right?

GeorgeJahad avatar Aug 10 '22 22:08 GeorgeJahad

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.

neils-dev avatar Aug 30 '22 00:08 neils-dev

Thanks @neils-dev for the PR. Thanks @GeorgeJahad and @sadanand48 for reviewing this as well.

smengcl avatar Oct 27 '22 16:10 smengcl