FastRestore: Fix MacOS compilation

The bug shown in MacOS compilation may also cause logic error
in the implementation, even in Linux.
This commit is contained in:
Meng Xu 2019-04-09 22:16:03 -07:00
parent f39e8acad4
commit 092a890da5
3 changed files with 4 additions and 6 deletions

View File

@ -692,7 +692,7 @@ const Key restoreStatusKeyFor ( StringRef statusType) {
const Value restoreStatusValue( double const& val ) {
BinaryWriter wr(IncludeVersion());
wr << (long) val;
wr << StringRef(std::to_string(val));
return wr.toValue();
}
const KeyRef healthyZoneKey = LiteralStringRef("\xff\x02/healthyZone");

View File

@ -2148,6 +2148,7 @@ ACTOR static Future<Void> sampleWorkload(Reference<RestoreData> rd, RestoreReque
rd->cmdID = checkpointCMDUID;
curFileIndex = checkpointCurFileIndex;
curFileOffset = checkpointCurFileOffset;
allLoadReqsSent = false;
printf("[Sampling][Waring] Retry at CMDID:%s curFileIndex:%ld\n", rd->cmdID.toString().c_str(), curFileIndex);
}
}
@ -4422,9 +4423,6 @@ ACTOR Future<Void> workerCore(Reference<RestoreData> rd, RestoreInterface ri, Da
// TODO: Wait until all workers have registered their interface.
wait( setWorkerInterface(req, rd, ri, cx) );
}
}
} catch (Error &e) {

View File

@ -93,7 +93,7 @@ public:
std::string toString() const;
bool operator == ( const CMDUID& r ) const { return batch == r.batch && phase == r.phase; cmdID == r.cmdID; }
bool operator == ( const CMDUID& r ) const { return batch == r.batch && phase == r.phase && cmdID == r.cmdID; }
bool operator != ( const CMDUID& r ) const { return batch != r.batch || phase != r.phase || cmdID != r.cmdID; }
bool operator < ( const CMDUID& r ) const { return batch < r.batch || (batch == r.batch && phase < r.phase) || (batch == r.batch && phase == r.phase && cmdID < r.cmdID); }
@ -542,7 +542,7 @@ struct RestoreNodeStatus {
} else if ( newRole == RestoreRole::Applier) {
applierState = ApplierState::Ready;
} else if ( newRole == RestoreRole::Master) {
masterState == MasterState::Ready;
masterState = MasterState::Ready;
}
lastStart = 0;
totalExecTime = 0;