FastRestore:Init VersionBatch explicitly

Built-in variable may not be zero initialized by
compiler provided default constructor.
This commit is contained in:
Meng Xu 2020-01-26 11:15:05 -08:00
parent 6945a6ea01
commit 76f30e71dc
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;