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

Reveal hook to assume meta file validity on restore. This speeds rest… #1085

Merged
merged 1 commit into from Mar 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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;
}
}