Skip to content

Commit

Permalink
Reveal hook to assume meta file validity on restore. This speeds rest…
Browse files Browse the repository at this point in the history
…ores when meta files are large and known to be valid. A more-correct solution of using the BackupStatusMgr is forthcoming. (#1085)
  • Loading branch information
mattl-netflix committed Mar 10, 2024
1 parent 3ad7dba commit 6e9ab1a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Expand Up @@ -43,6 +43,7 @@ public class MetaV2Proxy implements IMetaProxy {
private final Path metaFileDirectory;
private final IBackupFileSystem fs;
private final Provider<AbstractBackupPath> abstractBackupPathProvider;
private final IConfiguration config;

@Inject
public MetaV2Proxy(
Expand All @@ -52,6 +53,7 @@ public MetaV2Proxy(
fs = backupFileSystemCtx.getFileStrategy(configuration);
this.abstractBackupPathProvider = abstractBackupPathProvider;
metaFileDirectory = Paths.get(configuration.getDataFileLocation());
this.config = configuration;
}

@Override
Expand Down Expand Up @@ -196,7 +198,9 @@ public BackupVerificationResult isMetaFileValid(AbstractBackupPath metaBackupPat
metaFile = downloadMetaFile(metaBackupPath);
result.manifestAvailable = true;

metaFileBackupValidator.readMeta(metaFile);
if (!config.skipMetaFileValidationOnRestore()) {
metaFileBackupValidator.readMeta(metaFile);
}
result.valid = (result.filesInMetaOnly.isEmpty());
} catch (FileNotFoundException fne) {
logger.error(fne.getLocalizedMessage());
Expand Down
Expand Up @@ -1183,4 +1183,8 @@ default int getBlockForPeersTimeoutInSecs() {
* @return The result for the property, or the defaultValue if provided (null otherwise)
*/
String getProperty(String key, String defaultValue);

default boolean skipMetaFileValidationOnRestore() {
return false;
}
}

0 comments on commit 6e9ab1a

Please sign in to comment.