remove PrepareBlobRestore waiting for inFlight moving
This commit is contained in:
parent
d7c089fd13
commit
91de1c880e
|
@ -1131,7 +1131,7 @@ void ServerKnobs::initialize(Randomize randomize, ClientKnobs* clientKnobs, IsSi
|
|||
init( BLOB_MANIFEST_RW_ROWS, isSimulated ? 10 : 1000 );
|
||||
init( BLOB_RESTORE_MLOGS_URL, isSimulated ? "file://simfdb/backups/" : "" );
|
||||
init( BLOB_MIGRATOR_ERROR_RETRIES, 20 );
|
||||
init( BLOB_MIGRATOR_PREPARE_TIMEOUT, 20.0 );
|
||||
init( BLOB_MIGRATOR_PREPARE_TIMEOUT, 120.0 );
|
||||
init( BLOB_RESTORE_MANIFEST_URL, isSimulated ? "file://simfdb/fdbblob/manifest" : "" );
|
||||
init( BLOB_RESTORE_MANIFEST_FILE_MAX_SIZE, isSimulated ? 10000 : 10000000 );
|
||||
init( BLOB_RESTORE_MANIFEST_RETENTION_MAX, 10 );
|
||||
|
|
|
@ -147,9 +147,6 @@ private:
|
|||
state Future<Void> dbInfoChange = Void();
|
||||
state Future<Void> delayTime = Void();
|
||||
state int retries = 0;
|
||||
// In simulation, we have to wait the DD finish inflight data movement, which may can't be done within
|
||||
// BLOB_MIGRATOR_ERROR_RETRIES retries.
|
||||
state int retryLimit = g_network->isSimulated() ? 5000 : SERVER_KNOBS->BLOB_MIGRATOR_ERROR_RETRIES;
|
||||
state UID requestId;
|
||||
loop {
|
||||
choose {
|
||||
|
@ -189,11 +186,11 @@ private:
|
|||
TraceEvent("BlobRestorePrepare", self->interf_.id())
|
||||
.detail("State", "Failed")
|
||||
.detail("ReqId", requestId)
|
||||
.detail("Code", reply.get().res)
|
||||
.detail("Reply", reply.get().toString())
|
||||
.detail("Retries", retries);
|
||||
}
|
||||
|
||||
if (++retries > retryLimit) {
|
||||
if (++retries > SERVER_KNOBS->BLOB_MIGRATOR_ERROR_RETRIES) {
|
||||
throw restore_error();
|
||||
}
|
||||
delayTime = delayJittered(10.0);
|
||||
|
|
|
@ -840,10 +840,6 @@ ACTOR Future<Void> serveBlobMigratorRequests(Reference<DataDistributor> self,
|
|||
loop {
|
||||
PrepareBlobRestoreRequest req = waitNext(self->context->interface.prepareBlobRestoreReq.getFuture());
|
||||
if (BlobMigratorInterface::isBlobMigrator(req.ssi.id())) {
|
||||
if (queue->activeRelocations + queue->queuedRelocations > 0) {
|
||||
req.reply.send(PrepareBlobRestoreReply(PrepareBlobRestoreReply::PROCESSING_RELOCATION));
|
||||
continue;
|
||||
}
|
||||
if (self->context->ddEnabledState->sameId(req.requesterID) &&
|
||||
self->context->ddEnabledState->isBlobRestorePreparing()) {
|
||||
// the sender use at-least once model, so we need to guarantee the idempotence
|
||||
|
|
|
@ -72,7 +72,7 @@ struct DataDistributorInterface {
|
|||
struct PrepareBlobRestoreReply {
|
||||
constexpr static FileIdentifier file_identifier = 1024888;
|
||||
|
||||
enum Type : int8_t { SUCCESS = 0, CONFLICT_SNAPSHOT, CONFLICT_BLOB_RESTORE, PROCESSING_RELOCATION };
|
||||
enum Type : int8_t { SUCCESS = 0, CONFLICT_SNAPSHOT, CONFLICT_BLOB_RESTORE };
|
||||
int8_t res;
|
||||
|
||||
PrepareBlobRestoreReply() = default;
|
||||
|
@ -82,6 +82,20 @@ struct PrepareBlobRestoreReply {
|
|||
void serialize(Ar& ar) {
|
||||
serializer(ar, res);
|
||||
}
|
||||
|
||||
std::string toString() const {
|
||||
switch (res) {
|
||||
case SUCCESS:
|
||||
return "success";
|
||||
case CONFLICT_SNAPSHOT:
|
||||
return "conflict_snapshot";
|
||||
case CONFLICT_BLOB_RESTORE:
|
||||
return "conflict_blob_restore";
|
||||
default:
|
||||
ASSERT(false);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
};
|
||||
|
||||
// when receive this request, DD will do the preparation work for blob migrator
|
||||
|
|
Loading…
Reference in New Issue