Merge pull request #2604 from xumengpanda/mengxu/fast-restore-valgrind-fix-PR14

Performant restore [14/XX Add-on]: Fix initialized field in VersionBatch struct
This commit is contained in:
A.J. Beamon 2020-01-27 15:22:31 -08:00 committed by GitHub
commit fa51a1abc5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -267,7 +267,7 @@ struct GetShardStateRequest {
FETCHING = 1,
READABLE = 2
};
KeyRange keys;
int32_t mode;
ReplyPromise<GetShardStateReply> reply;

View File

@ -50,7 +50,7 @@ struct VersionBatch {
std::vector<RestoreFileFR> rangeFiles;
double size; // size of data in range and log files
VersionBatch() = default;
VersionBatch() : beginVersion(0), endVersion(0), size(0){};
bool isEmpty() { return logFiles.empty() && rangeFiles.empty(); }
void reset() {
@ -240,7 +240,7 @@ struct RestoreMasterData : RestoreRoleData, public ReferenceCounted<RestoreMaste
if (vb.size + nextVersionSize <= opConfig.batchSizeThreshold) {
// nextVersion should be included in this batch
vb.size += nextVersionSize;
while (rangeIdx < nextRangeIdx) {
while (rangeIdx < nextRangeIdx && rangeIdx < rangeFiles.size()) {
ASSERT(rangeFiles[rangeIdx].fileSize > 0);
vb.rangeFiles.push_back(rangeFiles[rangeIdx]);
++rangeIdx;