You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "jojochuang (via GitHub)" <gi...@apache.org> on 2026/04/06 22:40:47 UTC
[PR] HDDS-14982. [Docs] Snapshot deletion lifecycle [ozone-site]
jojochuang opened a new pull request, #373:
URL: https://github.com/apache/ozone-site/pull/373
## What changes were proposed in this pull request?
HDDS-14982. [Docs] Snapshot deletion lifecycle
Please describe your PR in detail:
- Add to System internals doc the detailed description of snapshot deletion.
## What is the link to the Apache Jira?
https://issues.apache.org/jira/browse/HDDS-14982
## How was this patch tested?
https://github.com/jojochuang/ozone-site/actions/runs/24054721472
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-14982. [Docs] Snapshot deletion lifecycle [ozone-site]
Posted by "jojochuang (via GitHub)" <gi...@apache.org>.
jojochuang commented on PR #373:
URL: https://github.com/apache/ozone-site/pull/373#issuecomment-4249911891
Merged. Thanks @smengcl
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-14982. [Docs] Snapshot deletion lifecycle [ozone-site]
Posted by "smengcl (via GitHub)" <gi...@apache.org>.
smengcl commented on code in PR #373:
URL: https://github.com/apache/ozone-site/pull/373#discussion_r3077183224
##########
docs/07-system-internals/07-features/03-bucket-snapshot-deletion-lifecycle.md:
##########
@@ -0,0 +1,51 @@
+---
+sidebar_label: Snapshot Deletion Lifecycle
+---
+
+# Snapshot Deletion Lifecycle
+
+This document describes the internal lifecycle of snapshot deletion in Apache Ozone, from the initial user request to the final physical removal of data and metadata.
+
+The snapshot deletion process is divided into four main phases:
+
+## 1. Request Phase: `OMSnapshotDeleteRequest`
+
+* **Trigger:** User executes the command `ozone sh snapshot delete <bucket> <snapshot>`.
+* **Operation:**
+ * The Ozone Manager (OM) receives the request and validates it.
+ * The snapshot's status is updated to `SNAPSHOT_DELETED` in the `SnapshotInfoTable`.
+ * The `deletionTime` is set to the current timestamp.
+* **Result:** This phase only "labels" the snapshot for deletion. It does not yet adjust the snapshot chain or reclaim any data. The snapshot remains in the system but is now a candidate for the background reclamation service.
+
+## 2. Reclamation Phase: `SnapshotDeletingService`
+
+* **Trigger:** A background service that runs periodically.
+* **Operation:**
+ * The service identifies snapshots with the `SNAPSHOT_DELETED` status.
+ * It processes the deleted snapshot's internal tracking tables: `deletedTable`, `deletedDirTable`, and `renamedTable`.
+ * **Data Moving:** It moves entries from these tables to either:
+ 1. The **next active snapshot** in the chain (if one exists).
+ 2. The **Active Object Store (AOS)** (the main bucket) if no subsequent snapshot exists.
Review Comment:
what is `(the main bucket)`?
```suggestion
2. The **Active Object Store (AOS)** if no subsequent snapshot exists.
```
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-14982. [Docs] Snapshot deletion lifecycle [ozone-site]
Posted by "jojochuang (via GitHub)" <gi...@apache.org>.
jojochuang commented on PR #373:
URL: https://github.com/apache/ozone-site/pull/373#issuecomment-4249852216
<img width="2816" height="1536" alt="snapshot_delete" src="https://github.com/user-attachments/assets/0923b35d-d6de-4eba-81e8-d58f1c663553" />
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-14982. [Docs] Snapshot deletion lifecycle [ozone-site]
Posted by "smengcl (via GitHub)" <gi...@apache.org>.
smengcl commented on code in PR #373:
URL: https://github.com/apache/ozone-site/pull/373#discussion_r3077212850
##########
docs/07-system-internals/07-features/03-bucket-snapshot-deletion-lifecycle.md:
##########
@@ -0,0 +1,51 @@
+---
+sidebar_label: Snapshot Deletion Lifecycle
+---
+
+# Snapshot Deletion Lifecycle
+
+This document describes the internal lifecycle of snapshot deletion in Apache Ozone, from the initial user request to the final physical removal of data and metadata.
+
+The snapshot deletion process is divided into four main phases:
+
+## 1. Request Phase: `OMSnapshotDeleteRequest`
+
+* **Trigger:** User executes the command `ozone sh snapshot delete <bucket> <snapshot>`.
+* **Operation:**
+ * The Ozone Manager (OM) receives the request and validates it.
+ * The snapshot's status is updated to `SNAPSHOT_DELETED` in the `SnapshotInfoTable`.
+ * The `deletionTime` is set to the current timestamp.
+* **Result:** This phase only "labels" the snapshot for deletion. It does not yet adjust the snapshot chain or reclaim any data. The snapshot remains in the system but is now a candidate for the background reclamation service.
+
+## 2. Reclamation Phase: `SnapshotDeletingService`
+
+* **Trigger:** A background service that runs periodically.
+* **Operation:**
+ * The service identifies snapshots with the `SNAPSHOT_DELETED` status.
+ * It processes the deleted snapshot's internal tracking tables: `deletedTable`, `deletedDirTable`, and `renamedTable`.
+ * **Data Moving:** It moves entries from these tables to either:
+ 1. The **next active snapshot** in the chain (if one exists).
+ 2. The **Active Object Store (AOS)** (the main bucket) if no subsequent snapshot exists.
+* **Settling:** Once all keys and directories for the snapshot have been successfully moved (i.e., the snapshot's deleted tables are empty), the service collects the snapshot's DB key into a "purge list".
+
+## 3. Finalization Phase: `OMSnapshotPurgeRequest`
+
+* **Trigger:** Triggered by the `SnapshotDeletingService` once a snapshot is fully "empty" (all keys reclaimed).
+* **Chain Adjustment (The Surgeon):** This is where the actual snapshot chain surgery occurs. The service updates the `previousSnapshotId` of the next snapshot in the chain to point to the deleted snapshot's predecessor, effectively "stitching" the chain back together.
Review Comment:
Not sure where `The Surgeon` comes from :) Was it in the prompt? or the agent just came up with it?
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-14982. [Docs] Snapshot deletion lifecycle [ozone-site]
Posted by "jojochuang (via GitHub)" <gi...@apache.org>.
jojochuang merged PR #373:
URL: https://github.com/apache/ozone-site/pull/373
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org