Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
import org.apache.hadoop.hbase.snapshot.RestoreSnapshotHelper;
import org.apache.hadoop.hbase.snapshot.SnapshotDescriptionUtils;
import org.apache.hadoop.hbase.snapshot.SnapshotManifest;
import org.apache.hadoop.hbase.snapshot.SnapshotReferenceUtil;
import org.apache.hadoop.hbase.util.Pair;
import org.apache.yetus.audience.InterfaceAudience;
import org.slf4j.Logger;
Expand Down Expand Up @@ -351,6 +352,12 @@ private void prepareRestore(final MasterProcedureEnv env) throws IOException {
mfs.getFileSystem(),
SnapshotDescriptionUtils.getCompletedSnapshotDir(snapshot, mfs.getRootDir()),
snapshot);

// Verify snapshot validity
SnapshotReferenceUtil
Copy link
Contributor

Choose a reason for hiding this comment

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

This is currently in a block for only checking non-system tables. Needs to happen for all tables.

Also should probably be the first thing we do in prepareRestore, since it used to proceed the step.

Please update the status monitor about doing the verification as well.

.verifySnapshot(env.getMasterServices().getConfiguration(), mfs.getFileSystem(),
manifest);

int snapshotRegionCount = manifest.getRegionManifestsMap().size();
int tableRegionCount =
ProcedureSyncWait.getMasterQuotaManager(env).getRegionCountOfTable(tableName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -835,9 +835,6 @@ public long restoreOrCloneSnapshot(final SnapshotDescription reqSnapshot, final
// stop tracking "abandoned" handlers
cleanupSentinels();

// Verify snapshot validity
SnapshotReferenceUtil.verifySnapshot(master.getConfiguration(), fs, manifest);

// Execute the restore/clone operation
long procId;
if (MetaTableAccessor.tableExists(master.getConnection(), tableName)) {
Expand Down