FR:fix compilation error
This commit is contained in:
parent
7992cef025
commit
879998d01b
|
|
@ -53,6 +53,7 @@ struct RestoreSendVersionedMutationsRequest;
|
|||
struct RestoreSysInfo;
|
||||
struct RestoreApplierInterface;
|
||||
struct RestoreFinishRequest;
|
||||
struct RestoreSamplesRequest;
|
||||
|
||||
// RestoreSysInfo includes information each (type of) restore roles should know.
|
||||
// At this moment, it only include appliers. We keep the name for future extension.
|
||||
|
|
@ -206,7 +207,7 @@ struct RestoreApplierInterface : RestoreRoleInterface {
|
|||
struct RestoreControllerInterface : RestoreRoleInterface {
|
||||
constexpr static FileIdentifier file_identifier = 54253047;
|
||||
|
||||
RequestStream<RestoreSimpleRequest> samples;
|
||||
RequestStream<RestoreSamplesRequest> samples;
|
||||
|
||||
bool operator==(RestoreWorkerInterface const& r) const { return id() == r.id(); }
|
||||
bool operator!=(RestoreWorkerInterface const& r) const { return id() != r.id(); }
|
||||
|
|
@ -444,13 +445,15 @@ struct RestoreSamplesRequest : TimedRequest {
|
|||
int batchIndex;
|
||||
SampledMutationsVec samples; // sampled mutations
|
||||
|
||||
ReplyPromise<RestoreCommonReply> reply;
|
||||
|
||||
RestoreSamplesRequest() = default;
|
||||
explicit RestoreSamplesRequest(UID id, int batchIndex, SampledMutationsVec samples)
|
||||
: id(id), batchIndex(batchIndex), samples(samples) {}
|
||||
|
||||
template <class Ar>
|
||||
void serialize(Ar& ar) {
|
||||
serializer(ar, id, batchIndex, samples);
|
||||
serializer(ar, id, batchIndex, samples, reply);
|
||||
}
|
||||
|
||||
std::string toString() {
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ void splitKeyRangeForAppliers(Reference<ControllerBatchData> batchData,
|
|||
ACTOR Future<Void> sampleBackups(Reference<RestoreControllerData> self, RestoreControllerInterface ci) {
|
||||
loop {
|
||||
try {
|
||||
RestoreSamplesRequest req = waitnext(ci.samples.getFuture());
|
||||
RestoreSamplesRequest req = waitNext(ci.samples.getFuture());
|
||||
if (req.batchIndex > self->batch.size()) {
|
||||
TraceEvent(SevError, "FastRestoreControllerSampleBackupsInvalidBatchIndex")
|
||||
.detail("BatchIndex", req.batchIndex)
|
||||
|
|
@ -92,10 +92,7 @@ ACTOR Future<Void> sampleBackups(Reference<RestoreControllerData> self, RestoreC
|
|||
batch->samples.addMetric(m.key, m.size);
|
||||
}
|
||||
} catch (Error& e) {
|
||||
TraceEvent(SevWarn, "FastRestoreControllerError", self->id())
|
||||
.detail("RequestType", "RestoreSamplesRequest")
|
||||
.error(e, true);
|
||||
actors.clear(false);
|
||||
TraceEvent(SevWarn, "FastRestoreControllerSampleBackupsError", self->id()).error(e);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -107,7 +104,7 @@ ACTOR Future<Void> startRestoreController(Reference<RestoreWorkerData> controlle
|
|||
ASSERT(controllerWorker.isValid());
|
||||
ASSERT(controllerWorker->controllerInterf.present());
|
||||
state Reference<RestoreControllerData> self =
|
||||
Reference<RestoreControllerData>(new RestoreControllerData(controllerWorker->controllerInterf.id()));
|
||||
Reference<RestoreControllerData>(new RestoreControllerData(controllerWorker->controllerInterf.get().id()));
|
||||
state ActorCollectionNoErrors actors;
|
||||
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -56,8 +56,8 @@ ACTOR static Future<Void> _parseLogFileToMutationsOnLoader(NotifiedVersion* pPro
|
|||
Reference<IBackupContainer> bc, RestoreAsset asset);
|
||||
ACTOR static Future<Void> _parseRangeFileToMutationsOnLoader(
|
||||
std::map<LoadingParam, VersionedMutationsMap>::iterator kvOpsIter,
|
||||
std::map<LoadingParam, MutationsVec>::iterator samplesIter, LoaderCounters* cc, Reference<IBackupContainer> bc,
|
||||
Version version, RestoreAsset asset);
|
||||
std::map<LoadingParam, SampledMutationsVec>::iterator samplesIter, LoaderCounters* cc,
|
||||
Reference<IBackupContainer> bc, Version version, RestoreAsset asset);
|
||||
ACTOR Future<Void> handleFinishVersionBatchRequest(RestoreVersionBatchRequest req, Reference<RestoreLoaderData> self);
|
||||
|
||||
ACTOR Future<Void> restoreLoaderCore(RestoreLoaderInterface loaderInterf, int nodeIndex, Database cx,
|
||||
|
|
@ -385,14 +385,14 @@ ACTOR Future<Void> handleLoadFileRequest(RestoreLoadFileRequest req, Reference<R
|
|||
wait(it->second); // wait on the processing of the req.param.
|
||||
|
||||
// Send sampled mutations back to controller: batchData->sampleMutations[req.param]
|
||||
std::vector<Future<Void>> fSendSamples;
|
||||
std::vector<Future<RestoreCommonReply>> fSendSamples;
|
||||
SampledMutationsVec& samples = batchData->sampleMutations[req.param];
|
||||
SampledMutationsVec sampleBatch =
|
||||
SampledMutationsVec(); // sampleBatch is a Standalone pointer to the created object
|
||||
double sampleBatchSize = 0;
|
||||
for (int i = 0; i < samples.size(); ++i) {
|
||||
sampleBatchSize += samples[i].totalSize();
|
||||
sampleBatch.push_back_deep(samples[i]); // TODO: may not need deep copy
|
||||
sampleBatch.push_back_deep(sampleBatch.arena(), samples[i]); // TODO: may not need deep copy
|
||||
if (sampleBatchSize >= SERVER_KNOBS->FASTRESTORE_SAMPLE_MSG_BYTES) {
|
||||
fSendSamples.push_back(self->ci.samples.getReply(
|
||||
RestoreSamplesRequest(deterministicRandom()->randomUniqueID(), req.batchIndex, sampleBatch)));
|
||||
|
|
|
|||
|
|
@ -63,9 +63,15 @@ struct SampledMutation {
|
|||
long size;
|
||||
|
||||
explicit SampledMutation(KeyRef key, long size) : key(key), size(size) {}
|
||||
explicit SampledMutation(Arena& arena, const SampledMutation& sm) : key(arena, sm.key), size(sm.size) {}
|
||||
SampledMutation() = default;
|
||||
|
||||
int totalSize() { return key.size() + sizeof(size); }
|
||||
|
||||
template <class Ar>
|
||||
void serialize(Ar& ar) {
|
||||
serializer(ar, key, size);
|
||||
}
|
||||
};
|
||||
|
||||
using MutationsVec = Standalone<VectorRef<MutationRef>>;
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ struct RestoreWorkerData : NonCopyable, public ReferenceCounted<RestoreWorkerDa
|
|||
std::map<UID, RestoreWorkerInterface> workerInterfaces; // UID is worker's node id, RestoreWorkerInterface is worker's communication workerInterface
|
||||
|
||||
// Restore Roles
|
||||
Optional<RestoreLoaderInterface> controllerInterf;
|
||||
Optional<RestoreControllerInterface> controllerInterf;
|
||||
Optional<RestoreLoaderInterface> loaderInterf;
|
||||
Optional<RestoreApplierInterface> applierInterf;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue