-
Notifications
You must be signed in to change notification settings - Fork 593
HDDS-13452. Prevent snapshot defrag from happening before upgrade finalization #9240
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
170 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 d36622a
HDDS-13785. Remove orphan versions from SnapshotLocalData Yaml file
swamirishi ee213d1
HDDS-13785. 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 ae655cb
HDDS-13785. Set defrag flag on previous snapshotId update
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 2aecde4
Merge remote-tracking branch 'origin/HDDS-13783' into HEAD
swamirishi 8eeb44b
HDDS-13783. Fix pmd
swamirishi d9301b3
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi 06e7d37
HDDS-13785. Fix merge issue
swamirishi efd6c51
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi fab85ea
HDDS-13785. Fix checkstyle
swamirishi c73a355
HDDS-13783. Fix test
swamirishi 76b99e2
Merge remote-tracking branch 'origin/HDDS-13783' into HEAD
swamirishi 1d39bee
HDDS-13785. Fix test
swamirishi 54f1508
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi b1a3834
HDDS-13785. Fix test
swamirishi 1986bbe
HDDS-13785. Fix conditions
swamirishi 52be3dd
HDDS-13783. Allow version resolution to null
swamirishi 5f50a04
Merge remote-tracking branch 'origin/HDDS-13783' into HEAD
swamirishi 908c47d
HDDS-13785. Fix tests
swamirishi 278605a
HDDS-13783. Add dirty bit
swamirishi 40265e1
Merge remote-tracking branch 'origin/HDDS-13783' into HEAD
swamirishi ac4719b
Merge
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 fcc630e
Merge remote-tracking branch 'origin/HDDS-13783' into HEAD
swamirishi 6f144e2
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi 4600c96
Merge remote-tracking branch 'apache/master' into HEAD
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 02dd061
Merge remote-tracking branch 'origin/HDDS-13783' into HEAD
swamirishi ff90af8
HDDS-13785. Add unit tests
swamirishi 8b014dd
HDDS-13783. Add case for commit key in middle of chain
swamirishi 57662c6
HDDS-13783. Convert set to list of predecessors
swamirishi bcc0fc8
Merge remote-tracking branch 'origin/HDDS-13783' into HEAD
swamirishi 79a46f4
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi cd24a81
Merge remote-tracking branch 'origin/HDDS-13783' into HEAD
swamirishi 5f0bb91
HDDS-13833. Add transactionInfo field in SnapshotLocalData and update…
swamirishi 3de4346
Merge remote-tracking branch 'origin/HDDS-13833' into HEAD
swamirishi 5b55a59
HDDS-13785. Merge with HDDS-13833
swamirishi aa6facf
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi cc35056
HDDS-13783. Make local data graph synchrnous
swamirishi 9c1689c
Merge remote-tracking branch 'origin/HDDS-13783' into HEAD
swamirishi 3f59895
HDDS-13785. Use internal lock on orphan block cleanup
swamirishi 95341dd
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi 616bef3
HDDS-13783. Fix NPE with concurrentHashMap
swamirishi b0023d1
HDDS-13830. Snapshot Rocks DB directory path computation based on loc…
swamirishi 36b6fb3
HDDS-13830. Add test
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 8c1373a
Merge remote-tracking branch 'origin/HDDS-13833' into HEAD
swamirishi 25ee4e2
Merge remote-tracking branch 'origin/HDDS-13783' into HEAD
swamirishi c6e3914
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi fd4bfdb
HDDS-13785. Add test for handling needs defrag
swamirishi 49f4424
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 cca2dbf
Merge remote-tracking branch 'origin/HDDS-13833' into HEAD
swamirishi a810cc1
HDDS-13785. Fix findbugs
swamirishi 78c1036
HDDS-13859. OmSnapshotLocalDataManager should handle needsDefrag flag…
swamirishi a2bbea5
Merge remote-tracking branch 'origin/HDDS-13859' into HEAD
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 7afc8f5
Merge remote-tracking branch 'origin/HDDS-13859' into HEAD
swamirishi 5849dac
HDDS-13785. Fix tests after merge
swamirishi e58ff09
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi 83b887e
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi 519495a
HDDS-13785. Address review comments
swamirishi c125250
HDDS-13785. Address review comments
swamirishi 408e213
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi 715b2f0
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi ec59b89
HDDS-13785. Address review comments
swamirishi b0b6d6a
HDDS-13785. Address review comments
swamirishi a759807
HDDS-13785. Change catch exception
swamirishi 808b174
HDDS-13785. Address review comments
swamirishi c829a8b
HDDS-13830. Fix test
swamirishi 8e91e47
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi bfd341c
HDDS-13830. Fix test
swamirishi 4ccd3fc
HDDS-13830. Fix test
swamirishi 4fd3b0e
HDDS-13849. Refactor getTablePrefix function in SnapshotDiff flow
swamirishi 41b7cfb
HDDS-13830. Fix pmd
swamirishi 3a8c8f6
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi d0422ae
HDDS-13830. Fix mrge issue
swamirishi 4ff8cea
Merge remote-tracking branch 'origin/HDDS-13830' into HEAD
swamirishi 649468d
Merge remote-tracking branch 'origin/HDDS-13849' into HEAD
swamirishi bb5139f
HDDS-13452. Prevent snapshot defrag from happening before upgrade fin…
swamirishi c46e1ae
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi 298ae36
HDDS-13849. Fix test
swamirishi 8e43b90
Merge remote-tracking branch 'origin/HDDS-13849' into HEAD
swamirishi 55c68bd
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi d1d04cf
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi 018571c
HDDS-13785. Address review comments
swamirishi 6cd54dd
HDDS-13785. Address review comments
swamirishi 261a669
HDDS-13785. Remove unnecessary read lock
swamirishi 8955d80
Merge remote-tracking branch 'origin/HDDS-13785' into HEAD
swamirishi ac88692
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi 5823347
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi 260942e
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi c88c9bf
Remove leftover debug comment
adoroszlai 39605f3
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi ae35dc9
HDDS-13452. Address review comments
swamirishi a7daebd
Merge remote-tracking branch 'origin/HDDS-13452' into HEAD
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
31 changes: 31 additions & 0 deletions
31
...hdds/framework/src/test/java/org/apache/hadoop/hdds/utils/db/StringInMemoryTestTable.java
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 |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one or more | ||
| * contributor license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright ownership. | ||
| * The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| * (the "License"); you may not use this file except in compliance with | ||
| * the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| package org.apache.hadoop.hdds.utils.db; | ||
|
|
||
| import org.apache.hadoop.hdds.utils.MapBackedTableIterator; | ||
|
|
||
| /** | ||
| * In memory test table for String keys. | ||
| * @param <V> Value type. | ||
| */ | ||
| public class StringInMemoryTestTable<V> extends InMemoryTestTable<String, V> { | ||
| @Override | ||
| public KeyValueIterator<String, V> iterator(String prefix, KeyValueIterator.Type type) { | ||
| return new MapBackedTableIterator<>(getMap(), prefix); | ||
| } | ||
| } |
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 |
|---|---|---|
|
|
@@ -20,6 +20,10 @@ | |
| import static org.apache.hadoop.ozone.om.OMConfigKeys.OZONE_OM_SNAPSHOT_LOCAL_DATA_MANAGER_SERVICE_INTERVAL; | ||
| import static org.apache.hadoop.ozone.om.OMConfigKeys.OZONE_OM_SNAPSHOT_LOCAL_DATA_MANAGER_SERVICE_INTERVAL_DEFAULT; | ||
| import static org.apache.hadoop.ozone.om.OmSnapshotLocalDataYaml.YAML_FILE_EXTENSION; | ||
| import static org.apache.hadoop.ozone.om.OmSnapshotManager.COLUMN_FAMILIES_TO_TRACK_IN_SNAPSHOT; | ||
| import static org.apache.hadoop.ozone.om.helpers.SnapshotInfo.SnapshotStatus.SNAPSHOT_ACTIVE; | ||
| import static org.apache.hadoop.ozone.om.upgrade.OMLayoutFeature.SNAPSHOT_DEFRAG; | ||
| import static org.apache.ozone.rocksdb.util.RdbUtil.getLiveSSTFilesForCFs; | ||
|
|
||
| import com.google.common.annotations.VisibleForTesting; | ||
| import com.google.common.graph.GraphBuilder; | ||
|
|
@@ -52,7 +56,10 @@ | |
| import org.apache.hadoop.hdds.utils.Scheduler; | ||
| import org.apache.hadoop.hdds.utils.TransactionInfo; | ||
| import org.apache.hadoop.hdds.utils.db.RDBStore; | ||
| import org.apache.hadoop.hdds.utils.db.Table; | ||
| import org.apache.hadoop.hdds.utils.db.managed.ManagedRocksDB; | ||
| import org.apache.hadoop.ozone.om.OMMetadataManager; | ||
| import org.apache.hadoop.ozone.om.OmMetadataManagerImpl; | ||
| import org.apache.hadoop.ozone.om.OmSnapshotLocalData; | ||
| import org.apache.hadoop.ozone.om.OmSnapshotLocalData.VersionMeta; | ||
| import org.apache.hadoop.ozone.om.OmSnapshotLocalDataYaml; | ||
|
|
@@ -63,8 +70,10 @@ | |
| import org.apache.hadoop.ozone.om.lock.HierarchicalResourceLockManager; | ||
| import org.apache.hadoop.ozone.om.lock.HierarchicalResourceLockManager.HierarchicalResourceLock; | ||
| import org.apache.hadoop.ozone.om.lock.OMLockDetails; | ||
| import org.apache.hadoop.ozone.om.upgrade.OMLayoutVersionManager; | ||
| import org.apache.hadoop.ozone.util.ObjectSerializer; | ||
| import org.apache.hadoop.ozone.util.YamlSerializer; | ||
| import org.apache.ratis.util.function.CheckedFunction; | ||
| import org.apache.ratis.util.function.CheckedSupplier; | ||
| import org.apache.ratis.util.function.UncheckedAutoCloseableSupplier; | ||
| import org.rocksdb.LiveFileMetaData; | ||
|
|
@@ -113,7 +122,8 @@ public class OmSnapshotLocalDataManager implements AutoCloseable { | |
| private volatile boolean closed; | ||
|
|
||
| public OmSnapshotLocalDataManager(OMMetadataManager omMetadataManager, | ||
| SnapshotChainManager snapshotChainManager, | ||
| SnapshotChainManager snapshotChainManager, OMLayoutVersionManager omLayoutVersionManager, | ||
| CheckedFunction<SnapshotInfo, OmMetadataManagerImpl, IOException> defaultSnapProvider, | ||
| OzoneConfiguration configuration) throws IOException { | ||
| this.localDataGraph = GraphBuilder.directed().build(); | ||
| this.omMetadataManager = omMetadataManager; | ||
|
|
@@ -128,7 +138,7 @@ public void computeAndSetChecksum(Yaml yaml, OmSnapshotLocalData data) throws IO | |
| this.versionNodeMap = new ConcurrentHashMap<>(); | ||
| this.fullLock = new ReentrantReadWriteLock(); | ||
| this.internalLock = new ReentrantReadWriteLock(); | ||
| init(configuration, snapshotChainManager); | ||
| init(configuration, snapshotChainManager, omLayoutVersionManager, defaultSnapProvider); | ||
| } | ||
|
|
||
| @VisibleForTesting | ||
|
|
@@ -172,7 +182,8 @@ public void createNewOmSnapshotLocalDataFile(RDBStore snapshotStore, SnapshotInf | |
| try (WritableOmSnapshotLocalDataProvider snapshotLocalData = | ||
| new WritableOmSnapshotLocalDataProvider(snapshotInfo.getSnapshotId(), | ||
| () -> Pair.of(new OmSnapshotLocalData(snapshotInfo.getSnapshotId(), | ||
| OmSnapshotManager.getSnapshotSSTFileList(snapshotStore), | ||
| getLiveSSTFilesForCFs(snapshotStore.getDb().getManagedRocksDb(), | ||
| COLUMN_FAMILIES_TO_TRACK_IN_SNAPSHOT), | ||
| snapshotInfo.getPathPreviousSnapshotId(), null), | ||
| null))) { | ||
| snapshotLocalData.commit(); | ||
|
|
@@ -242,6 +253,32 @@ private void addSnapshotVersionMeta(UUID snapshotId, SnapshotVersionsMeta snapsh | |
| } | ||
| } | ||
|
|
||
| private void addMissingSnapshotYamlFiles( | ||
| CheckedFunction<SnapshotInfo, OmMetadataManagerImpl, IOException> defaultSnapProvider) throws IOException { | ||
| try (Table.KeyValueIterator<String, SnapshotInfo> itr = omMetadataManager.getSnapshotInfoTable().iterator()) { | ||
| while (itr.hasNext()) { | ||
| SnapshotInfo snapshotInfo = itr.next().getValue(); | ||
jojochuang marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| UUID snapshotId = snapshotInfo.getSnapshotId(); | ||
| File snapshotLocalDataFile = new File(getSnapshotLocalPropertyYamlPath(snapshotId)); | ||
| // Create a yaml file for snapshots which are missing | ||
| if (!snapshotLocalDataFile.exists()) { | ||
| List<LiveFileMetaData> sstList = Collections.emptyList(); | ||
| if (snapshotInfo.getSnapshotStatus() == SNAPSHOT_ACTIVE) { | ||
| try (OmMetadataManagerImpl snapshotMetadataManager = defaultSnapProvider.apply(snapshotInfo)) { | ||
| ManagedRocksDB snapDB = ((RDBStore)snapshotMetadataManager.getStore()).getDb().getManagedRocksDb(); | ||
| sstList = getLiveSSTFilesForCFs(snapDB, COLUMN_FAMILIES_TO_TRACK_IN_SNAPSHOT); | ||
| } catch (Exception e) { | ||
| throw new IOException(e); | ||
| } | ||
| } | ||
| OmSnapshotLocalData snapshotLocalData = new OmSnapshotLocalData(snapshotId, sstList, | ||
| snapshotInfo.getPathPreviousSnapshotId(), null); | ||
| snapshotLocalDataSerializer.save(snapshotLocalDataFile, snapshotLocalData); | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| void addVersionNodeWithDependents(OmSnapshotLocalData snapshotLocalData) throws IOException { | ||
| if (versionNodeMap.containsKey(snapshotLocalData.getSnapshotId())) { | ||
| return; | ||
|
|
@@ -297,12 +334,18 @@ Map<UUID, Integer> getSnapshotToBeCheckedForOrphans() { | |
| return snapshotToBeCheckedForOrphans; | ||
| } | ||
|
|
||
| private void init(OzoneConfiguration configuration, SnapshotChainManager chainManager) throws IOException { | ||
| private void init(OzoneConfiguration configuration, SnapshotChainManager chainManager, | ||
| OMLayoutVersionManager layoutVersionManager, | ||
| CheckedFunction<SnapshotInfo, OmMetadataManagerImpl, IOException> defaultSnapProvider) throws IOException { | ||
| this.locks = omMetadataManager.getHierarchicalLockManager(); | ||
| this.snapshotToBeCheckedForOrphans = new ConcurrentHashMap<>(); | ||
| 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. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. software is updated, but not finalized yet. |
||
| if (upgradeNeeded) { | ||
| addMissingSnapshotYamlFiles(defaultSnapProvider); | ||
| } | ||
| File[] localDataFiles = snapshotDir.listFiles( | ||
| (dir, name) -> name.startsWith(checkpointPrefix) && name.endsWith(YAML_FILE_EXTENSION)); | ||
| if (localDataFiles == null) { | ||
|
|
@@ -826,7 +869,8 @@ private SnapshotVersionsMeta validateModification(OmSnapshotLocalData snapshotLo | |
| } | ||
|
|
||
| public void addSnapshotVersion(RDBStore snapshotStore) throws IOException { | ||
| List<LiveFileMetaData> sstFiles = OmSnapshotManager.getSnapshotSSTFileList(snapshotStore); | ||
| List<LiveFileMetaData> sstFiles = getLiveSSTFilesForCFs(snapshotStore.getDb().getManagedRocksDb(), | ||
| COLUMN_FAMILIES_TO_TRACK_IN_SNAPSHOT); | ||
| OmSnapshotLocalData previousSnapshotLocalData = getPreviousSnapshotLocalData(); | ||
| this.getSnapshotLocalData().addVersionSSTFileInfos(sstFiles, previousSnapshotLocalData == null ? 0 : | ||
| previousSnapshotLocalData.getVersion()); | ||
|
|
||
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
Oops, something went wrong.
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.
use the abstract parent class. Nice to have but not required in this PR.