HDDS-13452. Prevent snapshot defrag from happening before upgrade finalization#9240
Merged
swamirishi merged 170 commits intoapache:masterfrom Nov 13, 2025
Merged
HDDS-13452. Prevent snapshot defrag from happening before upgrade finalization#9240swamirishi merged 170 commits intoapache:masterfrom
swamirishi merged 170 commits intoapache:masterfrom
Conversation
Change-Id: Iba47aeb21663dfa407ab71339cef02c0d74b49f2
Change-Id: Ifd2feca1fddb144e4955db025f0b15a2ab1f3bfe
Change-Id: I34536ff06efb7d5a4942853f0fd83942ab398b5f
…otLocalDataManager Change-Id: I34536ff06efb7d5a4942853f0fd83942ab398b5f
Change-Id: I32bcaf2a1fb290f1790c02872a0230cd65586636
Change-Id: I105a2e8178c0444d52de41b99801f4ceb6d57ffd # Conflicts: # hadoop-hdds/common/src/main/java/org/apache/hadoop/ozone/util/Checksum.java # hadoop-hdds/common/src/main/java/org/apache/hadoop/ozone/util/ObjectSerializer.java # hadoop-hdds/common/src/main/java/org/apache/hadoop/ozone/util/YamlSerializer.java # hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmSnapshotLocalDataYaml.java # hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/OmSnapshotLocalDataManager.java # hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestOmSnapshotLocalDataYaml.java
Change-Id: I985170e38fb8beeb784048e85a08a4c79e1aec97
Change-Id: I33e6e6e825bf23c323ad7ed593d800a11720fa4f
Change-Id: If30b2c766db82adde72145c8ecd3e590ef54cc2d
Change-Id: Id3f2c49050bc3476b9e0f5f51dacb6d9acc4c2f7
Change-Id: I432960725b4c6c55aa906b5780cc3027e41e10db
Change-Id: I3c5514e5bbd251a2b5297d8f074cfde5c71fa543
Change-Id: Ib5a9e6c91bdccba17820263c47eaf2c8400e930d
Change-Id: Ica36e0615c7bc6aa9b6a7f6fafafd0f830d4bafb
Change-Id: I26b66f266bb7677e4b1078f5fcd9f2ce3a651a70 # Conflicts: # hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/OmSnapshotLocalDataManager.java
Change-Id: I1d93dbc048a42cc55ff1f8ffa420e52f967527b8
Change-Id: I34202928a7a367dd0a1e57219317ff34de352b78
Change-Id: Iad6f26cb71ec921c51ee2d138745df1a2663533f
Change-Id: Ic5f7e249cfb9cb3973cbcd4abd36b22a6ff8f5aa
…calDataProvider Change-Id: I3a004b4b435075a4348960aeed642e8da71e7e72
Change-Id: I06990bc9ab8fc7e1eb7bec255646a650bd8c35fe
Change-Id: I4c6c61c83aa9fadab8ecef854b99dcc0a89a2208
Change-Id: I0e476322372a302572f1fe79cbf2e874bfeac2ed
Change-Id: I31004e0c95dad64411c6fe848501a82f2f773cba
Change-Id: Id317c8b56e8b25c122b68eaf96599b9690d08f79
Change-Id: I3849387d064e093634e69cdaf870d27c1934cda5 # Conflicts: # hadoop-hdds/common/src/main/java/org/apache/hadoop/ozone/util/ObjectSerializer.java # hadoop-hdds/common/src/main/java/org/apache/hadoop/ozone/util/YamlSerializer.java # hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmSnapshotLocalData.java # hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmSnapshotLocalDataYaml.java # hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmSnapshotManager.java # hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/OmSnapshotLocalDataManager.java
Change-Id: Ie5e5f3dab4324103e8855dd15619d7755f0422e6
Change-Id: I55bd5c3ef7fc32910a9111328638de2edffcd541
Change-Id: I880997d3eebdf378f14c203c61c2d63b2d17552e
Change-Id: I13ba8e2fd012a3c964d657e83496c93a4f55a3be
…alization Change-Id: I26ac4e914906fd1e764877577afb9a51a489b07f
Change-Id: If064b64d1dfd624324090a946a33eab55535f28f
Change-Id: I3ed6575a96a12c349bb229fb3772c256a986f242
Change-Id: I83628385c1311ab9dc9de105ff29a0421fc8c4b3
Change-Id: I93602a49fc217d6167ed9629b6ff3ffcaccc8afa
Change-Id: Ic6fa9707da609617c187247efa03543e555ee181 # Conflicts: # hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmSnapshotManager.java
jojochuang
reviewed
Nov 3, 2025
| RDBStore store = (RDBStore) omMetadataManager.getStore(); | ||
| String checkpointPrefix = store.getDbLocation().getName(); | ||
| File snapshotDir = new File(store.getSnapshotsParentDir()); | ||
| boolean upgradeNeeded = !layoutVersionManager.isAllowed(SNAPSHOT_DEFRAG); |
Contributor
There was a problem hiding this comment.
software is updated, but not finalized yet.
...ne-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/OmSnapshotLocalDataManager.java
Show resolved
Hide resolved
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/SnapshotDefragService.java
Show resolved
Hide resolved
Change-Id: Ied3c728c1f566bdd9327b6b5340892bed993cbf6
Change-Id: I1105c70ad060e8a344d042eadc3fa65b1469b716
Change-Id: Idc77f8a9a9a6cecb43b69d5532cf1bb2c679ce78
Change-Id: Ie6f1f79674be95db37a77969d3a06bce023e4bef
Change-Id: I1902394b0edfa8fa2f153787de98f21b20c55e59 # Conflicts: # hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmSnapshotManager.java # hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/OmSnapshotLocalDataManager.java # hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotLocalDataManager.java
Contributor
Author
|
@jojochuang can you review #9235 before this PR |
Change-Id: I85d6072d0826ccc7f81a2579af307bfad4f049a7
Change-Id: Idabbe831cff0b00a51d32c2149765a09eecf7e23 # Conflicts: # hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmMetadataManagerImpl.java # hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmSnapshotManager.java
5e61924 to
260942e
Compare
jojochuang
reviewed
Nov 12, 2025
...e/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/service/TestKeyDeletingService.java
Outdated
Show resolved
Hide resolved
jojochuang
approved these changes
Nov 13, 2025
Contributor
jojochuang
left a comment
There was a problem hiding this comment.
lgtm except for the System.out.println
| private Iterator<Table.KeyValue<String, V>> itr; | ||
| private final String prefix; | ||
| private final TreeMap<String, V> values; | ||
| private final NavigableMap<String, V> values; |
Contributor
There was a problem hiding this comment.
use the abstract parent class. Nice to have but not required in this PR.
Co-authored-by: Wei-Chiu Chuang <jojochuang@gmail.com>
Contributor
If the patch needs to be updated before merge, then please:
|
adoroszlai
reviewed
Nov 13, 2025
Comment on lines
22
to
24
| /** | ||
| * | ||
| */ |
Contributor
Author
There was a problem hiding this comment.
Done I have added java doc here.
Contributor
Author
Change-Id: I66f8dde36164036193bf6c399f7c33c226ad6f2f
Change-Id: I4a49a827d2a3ee46682dcb9d2b673cc2c0f1c215
Change-Id: I1a2bbe2f55adab3fff553229cc58c0d08ac2bd3d
Contributor
Author
|
thank you for reviewing the patch @jojochuang and @adoroszlai for removing the debug print statement |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Any snapshot defragmentation write operation can only happen after OM upgrade is finalized.
However we would still allow creation of the local yaml file which is inconsequential to the upgrade finalization since rollback would just mean that the yaml file would become orphan and can be deleted.
On OmSnapshotLocalDataManager initialization if the upgrade has not been finalized the snapshots which miss the yaml file are implicitly created by reading the rocksdb present in the version 0 path and getting the sst files from it for all the active snapshots. For the deleted snapshots the rocksdb could be in a partial purged state which could lead to issues while trying to open the snapshot rocksdb. Moreover the sstFileList fetch would not be useful since we would never defrag a snapshot when the previous snapshot is deleted or the snapshot itself has been deleted.
This is built on top of PR #9235 and #9150
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-13452
How was this patch tested?
Additional unit tests