FastRestore:Add comment for integrating with new backup format

This commit is contained in:
Meng Xu 2020-02-03 16:17:39 -08:00 committed by Jingyu Zhou
parent 3801e50288
commit d3071409c5
3 changed files with 15 additions and 3 deletions

View File

@ -612,6 +612,11 @@ void _parseSerializedMutation(std::map<LoadingParam, VersionedMutationsMap>::ite
}
// Parsing the data blocks in a range file
// kvOpsIter: saves the parsed versioned-mutations for the sepcific LoadingParam;
// samplesIter: saves the sampled mutations from the parsed versioned-mutations;
// bc: backup container to read the backup file
// version: the version the parsed mutations should be at
// asset: RestoreAsset about which backup data should be parsed
ACTOR static Future<Void> _parseRangeFileToMutationsOnLoader(
std::map<LoadingParam, VersionedMutationsMap>::iterator kvOpsIter,
std::map<LoadingParam, MutationsVec>::iterator samplesIter, LoaderCounters* cc, Reference<IBackupContainer> bc,
@ -691,9 +696,12 @@ ACTOR static Future<Void> _parseRangeFileToMutationsOnLoader(
return Void();
}
// Parse data blocks in a log file into a vector of <string, string> pairs. Each pair.second contains the mutations at a
// version encoded in pair.first Step 1: decodeLogFileBlock into <string, string> pairs Step 2: Concatenate the
// pair.second of pairs with the same pair.first.
// Parse data blocks in a log file into a vector of <string, string> pairs.
// Each pair.second contains the mutations at a version encoded in pair.first;
// Step 1: decodeLogFileBlock into <string, string> pairs;
// Step 2: Concatenate the second of pairs with the same pair.first.
// pProcessedFileOffset: ensure each data block is processed in order exactly once;
// pMutationMap: concatenated mutation list string at the mutation's commit version
ACTOR static Future<Void> _parseLogFileToMutationsOnLoader(NotifiedVersion* pProcessedFileOffset,
SerializedMutationListMap* pMutationMap,
SerializedMutationPartMap* pMutationPartMap,

View File

@ -276,6 +276,7 @@ ACTOR static Future<Version> processRestoreRequest(Reference<RestoreMasterData>
self->initBackupContainer(request.url);
// Get all backup files' description and save them to files
// TODO for Jingyu: Verify all backup files in new backup are collected
wait(collectBackupFiles(self->bc, &rangeFiles, &logFiles, cx, request));
std::sort(rangeFiles.begin(), rangeFiles.end());
@ -284,6 +285,7 @@ ACTOR static Future<Version> processRestoreRequest(Reference<RestoreMasterData>
std::tie(f2.endVersion, f2.beginVersion, f2.fileIndex, f2.fileName);
});
// TODO for Jingyu: Verify new backup files are grouped into correct version batches.
self->buildVersionBatches(rangeFiles, logFiles, &self->versionBatches); // Divide files into version batches
self->dumpVersionBatches(self->versionBatches);

View File

@ -51,6 +51,8 @@ struct RestoreMasterData;
struct RestoreSimpleRequest;
// VersionedMutationsMap: Key is the version of parsed backup mutations
// Value MutationsVec is the vector of parsed backup mutations
using VersionedMutationsMap = std::map<Version, MutationsVec>;
ACTOR Future<Void> isSchedulable(Reference<RestoreRoleData> self, int actorBatchIndex, std::string name);