Skip to content
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

HDDS-11411. Snapshot garbage collection should not run when the keys are moved from a deleted snapshot to the next snapshot in the chain #7193

Merged
merged 15 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions hadoop-hdds/common/src/main/resources/ozone-default.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3743,6 +3743,15 @@
</description>
</property>

<property>
<name>ozone.snapshot.deep.cleaning.enabled</name>
<value>true</value>
swamirishi marked this conversation as resolved.
Show resolved Hide resolved
<tag>OZONE, PERFORMANCE, OM</tag>
<description>
Flag to enable/disable snapshot deep cleaning.
</description>
</property>

<property>
<name>ozone.scm.event.ContainerReport.thread.pool.size</name>
<value>10</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,8 @@ private OMConfigKeys() {
/**
* Configuration properties for Snapshot Directory Service.
*/
public static final String OZONE_SNAPSHOT_DEEP_CLEANING_ENABLED = "ozone.snapshot.deep.cleaning.enabled";
public static final boolean OZONE_SNAPSHOT_DEEP_CLEANING_ENABLED_DEFAULT = true;
public static final String OZONE_SNAPSHOT_DIRECTORY_SERVICE_INTERVAL =
"ozone.snapshot.directory.service.interval";
public static final String OZONE_SNAPSHOT_DIRECTORY_SERVICE_INTERVAL_DEFAULT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1379,6 +1379,8 @@ message PurgeKeysRequest {
// if set, will purge keys in a snapshot DB instead of active DB
optional string snapshotTableKey = 2;
repeated SnapshotMoveKeyInfos keysToUpdate = 3;
// previous snapshotID can also be null & this field would be absent in older requests.
optional NullableUUID expectedPreviousSnapshotID = 4;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do you deal with it if this field is null ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

protobuf fields cannot be null.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to pass expectedPreviousSnapshotID = null for the case there are no snapshots in the chain. But older requests might not have a expectedPreviousSnapshotID in the request, so this validation could incorrectly run for the older requests leading to inconsistencies in the OM db on replays.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since there is no direct explicit way to differentiate b/w older requests & null values. I had to create a wrapper which means I can set NullableUUID which doesn't have anything inside. Since uuid field inside NullableUUID type is optional, we can signify this as a newer request and having nothing inside the field would signify a null value.

}

message PurgeKeysResponse {
Expand All @@ -1401,6 +1403,12 @@ message PurgePathsResponse {
message PurgeDirectoriesRequest {
repeated PurgePathRequest deletedPath = 1;
optional string snapshotTableKey = 2;
// previous snapshotID can also be null & this field would be absent in older requests.
optional NullableUUID expectedPreviousSnapshotID = 3;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment as above regarding this field being null.

}

message NullableUUID {
hemantk-12 marked this conversation as resolved.
Show resolved Hide resolved
optional hadoop.hdds.UUID uuid = 1;
}

message PurgeDirectoriesResponse {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@
import static org.apache.hadoop.ozone.om.OMConfigKeys.OZONE_OM_OPEN_KEY_CLEANUP_SERVICE_INTERVAL_DEFAULT;
import static org.apache.hadoop.ozone.om.OMConfigKeys.OZONE_OM_OPEN_KEY_CLEANUP_SERVICE_TIMEOUT;
import static org.apache.hadoop.ozone.om.OMConfigKeys.OZONE_OM_OPEN_KEY_CLEANUP_SERVICE_TIMEOUT_DEFAULT;
import static org.apache.hadoop.ozone.om.OMConfigKeys.OZONE_SNAPSHOT_DEEP_CLEANING_ENABLED;
import static org.apache.hadoop.ozone.om.OMConfigKeys.OZONE_SNAPSHOT_DEEP_CLEANING_ENABLED_DEFAULT;
import static org.apache.hadoop.ozone.om.OMConfigKeys.OZONE_SNAPSHOT_DIRECTORY_SERVICE_INTERVAL;
import static org.apache.hadoop.ozone.om.OMConfigKeys.OZONE_SNAPSHOT_DIRECTORY_SERVICE_INTERVAL_DEFAULT;
import static org.apache.hadoop.ozone.om.OMConfigKeys.OZONE_SNAPSHOT_DIRECTORY_SERVICE_TIMEOUT;
Expand Down Expand Up @@ -228,6 +230,8 @@ public KeyManagerImpl(OzoneManager om, ScmClient scmClient,

@Override
public void start(OzoneConfiguration configuration) {
boolean isSnapshotDeepCleaningEnabled = configuration.getBoolean(OZONE_SNAPSHOT_DEEP_CLEANING_ENABLED,
OZONE_SNAPSHOT_DEEP_CLEANING_ENABLED_DEFAULT);
if (keyDeletingService == null) {
long blockDeleteInterval = configuration.getTimeDuration(
OZONE_BLOCK_DELETING_SERVICE_INTERVAL,
Expand All @@ -239,7 +243,7 @@ public void start(OzoneConfiguration configuration) {
TimeUnit.MILLISECONDS);
keyDeletingService = new KeyDeletingService(ozoneManager,
scmClient.getBlockClient(), this, blockDeleteInterval,
serviceTimeout, configuration);
serviceTimeout, configuration, isSnapshotDeepCleaningEnabled);
keyDeletingService.start();
}

Expand Down Expand Up @@ -312,7 +316,7 @@ public void start(OzoneConfiguration configuration) {
}
}

if (snapshotDirectoryCleaningService == null &&
if (isSnapshotDeepCleaningEnabled && snapshotDirectoryCleaningService == null &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

&& or
|| ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It has to be && . Configuration to isSnapshotDeepCleaningEnabled should be enabled & also snapshotDirectoryCleaningService should not have been initialized before.

ozoneManager.isFilesystemSnapshotEnabled()) {
long dirDeleteInterval = configuration.getTimeDuration(
OZONE_SNAPSHOT_DIRECTORY_SERVICE_INTERVAL,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
import static org.apache.hadoop.ozone.om.OMConfigKeys.OZONE_SNAPSHOT_CHECKPOINT_DIR_CREATION_POLL_TIMEOUT_DEFAULT;
import static org.apache.hadoop.ozone.om.exceptions.OMException.ResultCodes.BUCKET_NOT_FOUND;
import static org.apache.hadoop.ozone.om.exceptions.OMException.ResultCodes.FILE_NOT_FOUND;
import static org.apache.hadoop.ozone.om.exceptions.OMException.ResultCodes.INTERNAL_ERROR;
import static org.apache.hadoop.ozone.om.exceptions.OMException.ResultCodes.VOLUME_NOT_FOUND;
import static org.apache.hadoop.ozone.OzoneConsts.OM_SNAPSHOT_CHECKPOINT_DIR;
import static org.apache.hadoop.ozone.om.service.SnapshotDeletingService.isBlockLocationInfoSame;
Expand Down Expand Up @@ -1595,11 +1596,20 @@ public PendingKeysDeletion getPendingDeletionKeys(final int keyCount,
String[] keySplit = kv.getKey().split(OM_KEY_PREFIX);
String bucketKey = getBucketKey(keySplit[1], keySplit[2]);
OmBucketInfo bucketInfo = getBucketTable().get(bucketKey);

SnapshotInfo previousSnapshotInfo = SnapshotUtils.getLatestSnapshotInfo(bucketInfo.getVolumeName(),
bucketInfo.getBucketName(), ozoneManager, snapshotChainManager);
// previous snapshot is not active or it has not been flushed to disk then don't process the key in this
// iteration.
if (previousSnapshotInfo != null &&
(previousSnapshotInfo.getSnapshotStatus() != SnapshotInfo.SnapshotStatus.SNAPSHOT_ACTIVE ||
!OmSnapshotManager.areSnapshotChangesFlushedToDB(ozoneManager.getMetadataManager(),
previousSnapshotInfo))) {
continue;
}
// Get the latest snapshot in snapshot path.
try (ReferenceCounted<OmSnapshot>
rcLatestSnapshot = getLatestActiveSnapshot(
keySplit[1], keySplit[2], omSnapshotManager)) {
try (ReferenceCounted<OmSnapshot> rcLatestSnapshot = previousSnapshotInfo == null ? null :
omSnapshotManager.getSnapshot(previousSnapshotInfo.getVolumeName(),
previousSnapshotInfo.getBucketName(), previousSnapshotInfo.getName())) {

// Multiple keys with the same path can be queued in one DB entry
RepeatedOmKeyInfo infoList = kv.getValue();
Expand Down Expand Up @@ -1688,6 +1698,14 @@ public PendingKeysDeletion getPendingDeletionKeys(final int keyCount,
infoList.getOmKeyInfoList().size()) {
keyBlocksList.addAll(blockGroupList);
}
SnapshotInfo newPreviousSnapshotInfo = SnapshotUtils.getLatestSnapshotInfo(bucketInfo.getVolumeName(),
bucketInfo.getBucketName(), ozoneManager, snapshotChainManager);
if (!Objects.equals(Optional.ofNullable(newPreviousSnapshotInfo).map(SnapshotInfo::getSnapshotId),
Optional.ofNullable(previousSnapshotInfo).map(SnapshotInfo::getSnapshotId))) {
throw new OMException("Snapshot chain has changed while checking for key reference " +
hemantk-12 marked this conversation as resolved.
Show resolved Hide resolved
"Previous snapshot in chain : " + previousSnapshotInfo + " new snapshot in chain : " +
newPreviousSnapshotInfo, INTERNAL_ERROR);
}
}
}
}
Expand All @@ -1703,55 +1721,6 @@ private boolean versionExistsInPreviousSnapshot(OmKeyInfo omKeyInfo,
delOmKeyInfo != null;
}

/**
* Get the latest OmSnapshot for a snapshot path.
*/
public ReferenceCounted<OmSnapshot> getLatestActiveSnapshot(
String volumeName, String bucketName,
OmSnapshotManager snapshotManager)
throws IOException {

String snapshotPath = volumeName + OM_KEY_PREFIX + bucketName;
Optional<UUID> latestPathSnapshot = Optional.ofNullable(
snapshotChainManager.getLatestPathSnapshotId(snapshotPath));

Optional<SnapshotInfo> snapshotInfo = Optional.empty();

while (latestPathSnapshot.isPresent()) {
Optional<String> snapTableKey = latestPathSnapshot
.map(uuid -> snapshotChainManager.getTableKey(uuid));

snapshotInfo = snapTableKey.isPresent() ?
Optional.ofNullable(getSnapshotInfoTable().get(snapTableKey.get())) :
Optional.empty();

if (snapshotInfo.isPresent() && snapshotInfo.get().getSnapshotStatus() ==
SnapshotInfo.SnapshotStatus.SNAPSHOT_ACTIVE) {
break;
}

// Update latestPathSnapshot if current snapshot is deleted.
if (snapshotChainManager.hasPreviousPathSnapshot(snapshotPath,
latestPathSnapshot.get())) {
latestPathSnapshot = Optional.ofNullable(snapshotChainManager
.previousPathSnapshot(snapshotPath, latestPathSnapshot.get()));
} else {
latestPathSnapshot = Optional.empty();
}
}

Optional<ReferenceCounted<OmSnapshot>> rcOmSnapshot =
snapshotInfo.isPresent() ?
Optional.ofNullable(
snapshotManager.getSnapshot(volumeName,
bucketName,
snapshotInfo.get().getName())
) :
Optional.empty();

return rcOmSnapshot.orElse(null);
}

/**
* Decide whether the open key is a multipart upload related key.
* @param openKeyInfo open key related to multipart upload
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,21 @@
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.UUID;

import com.google.common.collect.Maps;
import org.apache.commons.compress.utils.Lists;
import org.apache.commons.lang3.tuple.Pair;
import org.apache.hadoop.hdds.utils.TransactionInfo;
import org.apache.hadoop.hdds.utils.db.cache.CacheKey;
import org.apache.hadoop.hdds.utils.db.cache.CacheValue;
import org.apache.hadoop.ozone.OzoneConsts;
import org.apache.hadoop.ozone.om.OMMetrics;
import org.apache.hadoop.ozone.om.OmMetadataManagerImpl;
import org.apache.hadoop.ozone.om.SnapshotChainManager;
import org.apache.hadoop.ozone.om.exceptions.OMException;
swamirishi marked this conversation as resolved.
Show resolved Hide resolved
import org.apache.hadoop.ozone.om.snapshot.SnapshotUtils;
import org.apache.ratis.server.protocol.TermIndex;
import org.apache.hadoop.ozone.om.OMMetadataManager;
Expand All @@ -45,8 +53,10 @@
import org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMRequest;
import org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMResponse;

import static org.apache.hadoop.hdds.HddsUtils.fromProtobuf;
import static org.apache.hadoop.ozone.OzoneConsts.DELETED_HSYNC_KEY;
import static org.apache.hadoop.ozone.om.lock.OzoneManagerLock.Resource.BUCKET_LOCK;
import static org.apache.hadoop.ozone.om.snapshot.SnapshotUtils.validatePreviousSnapshotId;

/**
* Handles purging of keys from OM DB.
Expand All @@ -66,19 +76,34 @@ public OMClientResponse validateAndUpdateCache(OzoneManager ozoneManager, TermIn

List<OzoneManagerProtocolProtos.PurgePathRequest> purgeRequests =
purgeDirsRequest.getDeletedPathList();

SnapshotInfo fromSnapshotInfo = null;
Set<Pair<String, String>> lockSet = new HashSet<>();
Map<Pair<String, String>, OmBucketInfo> volBucketInfoMap = new HashMap<>();
OMMetadataManager omMetadataManager = ozoneManager.getMetadataManager();
OmMetadataManagerImpl omMetadataManager = (OmMetadataManagerImpl) ozoneManager.getMetadataManager();
Map<String, OmKeyInfo> openKeyInfoMap = new HashMap<>();

OMMetrics omMetrics = ozoneManager.getMetrics();
OMResponse.Builder omResponse = OmResponseUtil.getOMResponseBuilder(
getOmRequest());
final SnapshotInfo fromSnapshotInfo;
try {
if (fromSnapshot != null) {
fromSnapshotInfo = SnapshotUtils.getSnapshotInfo(ozoneManager, fromSnapshot);
fromSnapshotInfo = fromSnapshot != null ? SnapshotUtils.getSnapshotInfo(ozoneManager,
fromSnapshot) : null;
// Checking if this request is an old request or new one.
hemantk-12 marked this conversation as resolved.
Show resolved Hide resolved
if (purgeDirsRequest.hasExpectedPreviousSnapshotID()) {
// Validating previous snapshot since while purging deletes, a snapshot create request could make this purge
swamirishi marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, this is redundant. validatePreviousSnapshotId should have a comment with enough details and that should be sufficient. No need to write a duplicate comment here and in KeyPurgeRequest.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the comment here is different

// directory request invalid on AOS since the deletedDirectory would be in the newly created snapshot. Adding
// subdirectories could lead to not being able to reclaim sub-files and subdirectories since the
// file/directory would be present in the newly created snapshot.
// Validating previous snapshot can ensure the chain hasn't changed.
UUID expectedPreviousSnapshotId = purgeDirsRequest.getExpectedPreviousSnapshotID().hasUuid()
? fromProtobuf(purgeDirsRequest.getExpectedPreviousSnapshotID().getUuid()) : null;
validatePreviousSnapshotId(fromSnapshotInfo, omMetadataManager.getSnapshotChainManager(),
expectedPreviousSnapshotId);
}

} catch (IOException e) {
LOG.error("Error occured while performing OMDirectoriesPurge. ", e);
swamirishi marked this conversation as resolved.
Show resolved Hide resolved
return new OMDirectoriesPurgeResponseWithFSO(createErrorOMResponse(omResponse, e));
}
try {
for (OzoneManagerProtocolProtos.PurgePathRequest path : purgeRequests) {
for (OzoneManagerProtocolProtos.KeyInfo key :
path.getMarkDeletedSubDirsList()) {
Expand Down Expand Up @@ -170,12 +195,8 @@ public OMClientResponse validateAndUpdateCache(OzoneManager ozoneManager, TermIn
}
}

OMResponse.Builder omResponse = OmResponseUtil.getOMResponseBuilder(
getOmRequest());
OMClientResponse omClientResponse = new OMDirectoriesPurgeResponseWithFSO(
return new OMDirectoriesPurgeResponseWithFSO(
omResponse.build(), purgeRequests, ozoneManager.isRatisEnabled(),
getBucketLayout(), volBucketInfoMap, fromSnapshotInfo, openKeyInfoMap);

return omClientResponse;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.apache.hadoop.hdds.utils.db.cache.CacheKey;
import org.apache.hadoop.hdds.utils.db.cache.CacheValue;
import org.apache.hadoop.ozone.om.OmMetadataManagerImpl;
import org.apache.hadoop.ozone.om.exceptions.OMException;
import org.apache.hadoop.ozone.om.snapshot.SnapshotUtils;
import org.apache.ratis.server.protocol.TermIndex;
import org.apache.hadoop.ozone.om.OzoneManager;
Expand All @@ -42,6 +43,10 @@
import org.slf4j.LoggerFactory;

import java.util.List;
import java.util.UUID;

import static org.apache.hadoop.hdds.HddsUtils.fromProtobuf;
import static org.apache.hadoop.ozone.om.snapshot.SnapshotUtils.validatePreviousSnapshotId;

/**
* Handles purging of keys from OM DB.
Expand All @@ -58,30 +63,46 @@ public OMKeyPurgeRequest(OMRequest omRequest) {
@Override
public OMClientResponse validateAndUpdateCache(OzoneManager ozoneManager, TermIndex termIndex) {
PurgeKeysRequest purgeKeysRequest = getOmRequest().getPurgeKeysRequest();
List<DeletedKeys> bucketDeletedKeysList = purgeKeysRequest
.getDeletedKeysList();
List<SnapshotMoveKeyInfos> keysToUpdateList = purgeKeysRequest
.getKeysToUpdateList();
String fromSnapshot = purgeKeysRequest.hasSnapshotTableKey() ?
purgeKeysRequest.getSnapshotTableKey() : null;
List<String> keysToBePurgedList = new ArrayList<>();
List<DeletedKeys> bucketDeletedKeysList = purgeKeysRequest.getDeletedKeysList();
List<SnapshotMoveKeyInfos> keysToUpdateList = purgeKeysRequest.getKeysToUpdateList();
String fromSnapshot = purgeKeysRequest.hasSnapshotTableKey() ? purgeKeysRequest.getSnapshotTableKey() : null;
OmMetadataManagerImpl omMetadataManager = (OmMetadataManagerImpl) ozoneManager.getMetadataManager();

OMResponse.Builder omResponse = OmResponseUtil.getOMResponseBuilder(
getOmRequest());
OMClientResponse omClientResponse = null;

for (DeletedKeys bucketWithDeleteKeys : bucketDeletedKeysList) {
for (String deletedKey : bucketWithDeleteKeys.getKeysList()) {
keysToBePurgedList.add(deletedKey);

final SnapshotInfo fromSnapshotInfo;
try {
fromSnapshotInfo = fromSnapshot != null ? SnapshotUtils.getSnapshotInfo(ozoneManager,
fromSnapshot) : null;
// Checking if this request is an old request or new one.
if (purgeKeysRequest.hasExpectedPreviousSnapshotID()) {
// Validating previous snapshot since while purging deletes, a snapshot create request could make this purge
// directory request invalid on AOS since the deletedDirectory would be in the newly created snapshot. Adding
// subdirectories could lead to not being able to reclaim sub-files and subdirectories since the
// file/directory would be present in the newly created snapshot.
// Validating previous snapshot can ensure the chain hasn't changed.
swamirishi marked this conversation as resolved.
Show resolved Hide resolved
UUID expectedPreviousSnapshotId = purgeKeysRequest.getExpectedPreviousSnapshotID().hasUuid()
? fromProtobuf(purgeKeysRequest.getExpectedPreviousSnapshotID().getUuid()) : null;
validatePreviousSnapshotId(fromSnapshotInfo, omMetadataManager.getSnapshotChainManager(),
expectedPreviousSnapshotId);
}
} catch (IOException e) {
LOG.error("Error occured while performing OMDirectoriesPurge. ", e);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if validatePreviousSnapshotID throws exception, it would be caught here. the relevant error message should be here instead of line 104.

swamirishi marked this conversation as resolved.
Show resolved Hide resolved
return new OMKeyPurgeResponse(createErrorOMResponse(omResponse, e));
}
final SnapshotInfo fromSnapshotInfo;

try {
fromSnapshotInfo = fromSnapshot == null ? null : SnapshotUtils.getSnapshotInfo(ozoneManager, fromSnapshot);
} catch (IOException ex) {
return new OMKeyPurgeResponse(createErrorOMResponse(omResponse, ex));
List<String> keysToBePurgedList = new ArrayList<>();

for (DeletedKeys bucketWithDeleteKeys : bucketDeletedKeysList) {
keysToBePurgedList.addAll(bucketWithDeleteKeys.getKeysList());
}

if (keysToBePurgedList.isEmpty()) {
return new OMKeyPurgeResponse(createErrorOMResponse(omResponse,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this message right for this condition ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah I forgot to move this block above. I had expectedPreviousSnapshotId inside each bucketDeleteKeysList to make it more optimized. But realized it is not worth the effort to making the request bulky to do this validation for all the buckets. It is better to have it atomic than do partial operations.

new OMException("None of the keys can be purged be purged since a new snapshot was created for all the " +
"buckets, making this request invalid", OMException.ResultCodes.KEY_DELETION_ERROR)));
}

// Setting transaction info for snapshot, this is to prevent duplicate purge requests to OM from background
Expand All @@ -95,10 +116,9 @@ public OMClientResponse validateAndUpdateCache(OzoneManager ozoneManager, TermIn
} catch (IOException e) {
return new OMKeyPurgeResponse(createErrorOMResponse(omResponse, e));
}
omClientResponse = new OMKeyPurgeResponse(omResponse.build(), keysToBePurgedList, fromSnapshotInfo,
keysToUpdateList);

return omClientResponse;
return new OMKeyPurgeResponse(omResponse.build(),
keysToBePurgedList, fromSnapshotInfo, keysToUpdateList);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ public OMClientResponse validateAndUpdateCache(OzoneManager ozoneManager, TermIn
OmResponseUtil.getOMResponseBuilder(getOmRequest());
try {
// Check the snapshot exists.
SnapshotUtils.getSnapshotInfo(ozoneManager, fromSnapshot.getTableKey());
SnapshotInfo snapshotInfo = SnapshotUtils.getSnapshotInfo(ozoneManager, fromSnapshot.getTableKey());

nextSnapshot = SnapshotUtils.getNextActiveSnapshot(fromSnapshot, snapshotChainManager, ozoneManager);
nextSnapshot = SnapshotUtils.getNextSnapshot(ozoneManager, snapshotChainManager, snapshotInfo);

// Get next non-deleted snapshot.
List<SnapshotMoveKeyInfos> nextDBKeysList = moveDeletedKeysRequest.getNextDBKeysList();
Expand Down
Loading