-
Notifications
You must be signed in to change notification settings - Fork 594
HDDS-13859. OmSnapshotLocalDataManager should handle needsDefrag flag in the yaml file #9224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
94 commits
Select commit
Hold shift + click to select a range
6e241f6
HDDS-13765. SnapshotLocalData yaml should also track snapshotId
swamirishi a869500
HDDS-13627. In memory Manager for Snapshot Local Data
swamirishi 252d338
HDDS-13627. In memory Manager for Snapshot Local Data
swamirishi 4099bc6
HDDS-13767. Refactor SnapshotLocalDataYaml related code into OmSnapsh…
swamirishi e02670c
HDDS-13767. Fix pmd
swamirishi 5a66cfc
Merge remote-tracking branch 'origin/HDDS-13767' into HEAD
swamirishi 79580e9
HDDS-13627. Fix checkstyle
swamirishi 2a331ef
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi c4f69e2
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi afbc592
HDDS-13627. Add tests
swamirishi 70ac2c7
HDDS-13783. Implement locks for OmSnapshotLocalDataManager
swamirishi b554cc7
HDDS-13783. Implement locks for OmSnapshotLocalDataManager
swamirishi 49eccfa
HDDS-13783. Refactor inline variable
swamirishi 51eda04
HDDS-13627. Refactor map data structure
swamirishi 25f766c
Merge remote-tracking branch 'origin/HDDS-13627' into HEAD
swamirishi 96689fa
HDDS-13783. Add more condition to upsert
swamirishi 0674299
HDDS-13783. Add java doc comment
swamirishi 5d9fc49
HDDS-13783. Add java doc comment
swamirishi 2d88176
HDDS-13783. Implement full lock
swamirishi a3c4c69
HDDS-13783. Refactor and move modify method into WritableOmSnapshotLo…
swamirishi 686d0c7
HDDS-13783. Make full lock non static
swamirishi 491a54b
HDDS-13783. Fix remove
swamirishi 5e69ee9
HDDS-13627. Fix findbugs
swamirishi 81871b2
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi a95604e
HDDS-13627. Fix tests
swamirishi 5a90fcf
HDDS-13627. remove checksum interface
swamirishi 20d7d6a
HDDS-13627. Fix test failures
swamirishi 25fa6ae
Merge remote-tracking branch 'origin/HDDS-13627' into HEAD
swamirishi d419283
HDDS-13783. Fix findbugs
swamirishi 8a44308
HDDS-13783. Fix pmd
swamirishi cb94c36
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi e26052c
Merge remote-tracking branch 'origin/HDDS-13627' into HEAD
swamirishi 4d272d1
HDDS-13783. Fix lock release
swamirishi 2a38f59
HDDS-13627. address review comments
swamirishi ca098cf
HDDS-13783. Make graph updates synchronized
swamirishi 67d4b3d
HDDS-13627. Make add version with dependents package private
swamirishi 9838cda
Merge remote-tracking branch 'origin/HDDS-13627' into HEAD
swamirishi 6a19dbb
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi 665f411
HDDS-13783. Fix checkstyle
swamirishi 2894e40
HDDS-13783. Fix merge conflict
swamirishi ea0ab16
HDDS-13783. Add write version api
swamirishi 915562b
HDDS-13797. Refactor OzoneManagerLock Resource class to handle handle…
swamirishi 1c0d0ac
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi 24da3eb
HDDS-13797. Update interface
swamirishi 8f3774a
HDDS-13798. Implement PoolBasedHierarchicalResourceLockManager for Hi…
swamirishi 503cd4e
Merge remote-tracking branch 'origin/HDDS-13798' into HEAD
swamirishi 6865fad
HDDS-13797. Revert move of Leveled Resource and Resource enum/interface
swamirishi 903ecd1
Merge remote-tracking branch 'origin/HDDS-13797' into HEAD
swamirishi 06d1e99
Merge remote-tracking branch 'origin/HDDS-13798' into HEAD
swamirishi 60a7728
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi 4711517
HDDS-13798. Fix pmd findbugs
swamirishi af8754c
Merge remote-tracking branch 'origin/HDDS-13798' into HEAD
swamirishi 655a724
HDDS-13798. Fix pmd findbugs
swamirishi 6386c1b
Merge remote-tracking branch 'origin/HDDS-13798' into HEAD
swamirishi 2bc6134
HDDS-13798. Fix ozone-default.xml
swamirishi 0de7c62
Merge remote-tracking branch 'origin/HDDS-13798' into HEAD
swamirishi 8e8c534
HDDS-13798. Stop lock data manager on metadata stop
swamirishi f148f24
HDDS-13798. Update tests
swamirishi da030c0
HDDS-13798. Rename class
swamirishi 6af6498
Merge remote-tracking branch 'origin/HDDS-13798' into HEAD
swamirishi b281569
HDDS-13783. Add tests
swamirishi 1ad24b4
HDDS-13783. Fix checkstyle
swamirishi d629911
HDDS-13783. Fix findbugs
swamirishi 8eeb44b
HDDS-13783. Fix pmd
swamirishi d9301b3
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi c73a355
HDDS-13783. Fix test
swamirishi 52be3dd
HDDS-13783. Allow version resolution to null
swamirishi 278605a
HDDS-13783. Add dirty bit
swamirishi cf19dce
HDDS-13783. Address review comments
swamirishi 34097de
HDDS-13783. Address review comments
swamirishi c46ddc2
HDDS-13783. Address review comments
swamirishi 99afc02
HDDS-13783. Address review comments
swamirishi 48ec0bb
HDDS-13810. Fix Build Issue because of unused dependency
swamirishi f524cad
Merge remote-tracking branch 'origin/HDDS-13810' into HEAD
swamirishi cb31b7c
Revert "HDDS-13810. Fix Build Issue because of unused dependency"
swamirishi 8b014dd
HDDS-13783. Add case for commit key in middle of chain
swamirishi 57662c6
HDDS-13783. Convert set to list of predecessors
swamirishi 79a46f4
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi 5f0bb91
HDDS-13833. Add transactionInfo field in SnapshotLocalData and update…
swamirishi aa6facf
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi cc35056
HDDS-13783. Make local data graph synchrnous
swamirishi 95341dd
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi 616bef3
HDDS-13783. Fix NPE with concurrentHashMap
swamirishi 4596386
HDDS-13783. Add comments for localDataGraph
swamirishi 7af6521
Merge remote-tracking branch 'origin/HDDS-13783' into HEAD
swamirishi e19dae2
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi 613d106
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi 8a29736
HDDS-13833. Fix checkstyle
swamirishi 78c1036
HDDS-13859. OmSnapshotLocalDataManager should handle needsDefrag flag…
swamirishi bf4746f
HDDS-13859. Fix Test
swamirishi 09d955c
HDDS-13859. Add comments
swamirishi cde567d
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi 49c662a
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi 2cf1bce
HDDS-13859. Fix test after merge master
swamirishi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -435,6 +435,32 @@ private void validateVersions(OmSnapshotLocalDataManager snapshotLocalDataManage | |
| } | ||
| } | ||
|
|
||
| @ParameterizedTest | ||
| @ValueSource(booleans = {true, false}) | ||
| public void testWriteWithChainUpdate(boolean previousSnapshotExisting) throws IOException { | ||
| localDataManager = new OmSnapshotLocalDataManager(omMetadataManager); | ||
| List<UUID> snapshotIds = createSnapshotLocalData(localDataManager, 3 + (previousSnapshotExisting ? 1 : 0)); | ||
| int snapshotIdx = 1 + (previousSnapshotExisting ? 1 : 0); | ||
| for (UUID snapshotId : snapshotIds) { | ||
| addVersionsToLocalData(localDataManager, snapshotId, ImmutableMap.of(1, 1)); | ||
| } | ||
|
|
||
| UUID snapshotId = snapshotIds.get(snapshotIdx); | ||
| UUID toUpdatePreviousSnapshotId = snapshotIdx - 2 >= 0 ? snapshotIds.get(snapshotIdx - 2) : null; | ||
|
|
||
| try (WritableOmSnapshotLocalDataProvider snap = | ||
| localDataManager.getWritableOmSnapshotLocalData(snapshotId, toUpdatePreviousSnapshotId)) { | ||
| assertFalse(snap.needsDefrag()); | ||
| snap.commit(); | ||
| assertTrue(snap.needsDefrag()); | ||
| } | ||
| try (ReadableOmSnapshotLocalDataProvider snap = | ||
| localDataManager.getOmSnapshotLocalData(snapshotId)) { | ||
| assertEquals(toUpdatePreviousSnapshotId, snap.getSnapshotLocalData().getPreviousSnapshotId()); | ||
| assertTrue(snap.needsDefrag()); | ||
| } | ||
| } | ||
|
|
||
| /** | ||
| * Validates write-time version propagation and removal rules when the previous | ||
| * snapshot already has a concrete version recorded. | ||
|
|
@@ -535,6 +561,26 @@ private void addVersionsToLocalData(OmSnapshotLocalDataManager snapshotLocalData | |
| } | ||
| } | ||
|
|
||
| @ParameterizedTest | ||
| @ValueSource(ints = {1, 2, 3}) | ||
| public void testNeedsDefrag(int previousVersion) throws IOException { | ||
| localDataManager = new OmSnapshotLocalDataManager(omMetadataManager); | ||
| List<UUID> snapshotIds = createSnapshotLocalData(localDataManager, 2); | ||
| for (UUID snapshotId : snapshotIds) { | ||
| try (ReadableOmSnapshotLocalDataProvider snap = localDataManager.getOmSnapshotLocalData(snapshotId)) { | ||
| assertTrue(snap.needsDefrag()); | ||
| } | ||
| } | ||
| addVersionsToLocalData(localDataManager, snapshotIds.get(0), ImmutableMap.of(1, 1, 2, 2, 3, 3)); | ||
| try (ReadableOmSnapshotLocalDataProvider snap = localDataManager.getOmSnapshotLocalData(snapshotIds.get(0))) { | ||
| assertFalse(snap.needsDefrag()); | ||
| } | ||
| addVersionsToLocalData(localDataManager, snapshotIds.get(1), ImmutableMap.of(1, 3, 2, previousVersion)); | ||
| try (ReadableOmSnapshotLocalDataProvider snap = localDataManager.getOmSnapshotLocalData(snapshotIds.get(1))) { | ||
| assertEquals(previousVersion < snap.getPreviousSnapshotLocalData().getVersion(), snap.needsDefrag()); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. when the previousSnapshotId in the yaml file is updated |
||
| } | ||
| } | ||
|
|
||
| @ParameterizedTest | ||
| @ValueSource(booleans = {true, false}) | ||
| public void testVersionResolution(boolean read) throws IOException { | ||
|
|
@@ -645,7 +691,7 @@ public void testCreateNewSnapshotLocalYaml() throws IOException { | |
| assertEquals(notDefraggedVersionMeta, localData.getVersionSstFileInfos().get(0)); | ||
| assertFalse(localData.getSstFiltered()); | ||
| assertEquals(0L, localData.getLastDefragTime()); | ||
| assertFalse(localData.getNeedsDefrag()); | ||
| assertTrue(localData.getNeedsDefrag()); | ||
| assertEquals(1, localData.getVersionSstFileInfos().size()); | ||
| } | ||
|
|
||
|
|
@@ -681,6 +727,8 @@ public void testCreateNewOmSnapshotLocalDataFile() throws IOException { | |
| OmSnapshotLocalData.VersionMeta expectedVersionMeta = | ||
| new OmSnapshotLocalData.VersionMeta(0, sstFileInfos); | ||
| assertEquals(expectedVersionMeta, versionMeta); | ||
| // New Snapshot create needs to be defragged always. | ||
| assertTrue(snapshotLocalData.needsDefrag()); | ||
| } | ||
| } | ||
|
|
||
|
|
||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
newly created snapshots needs to defrag