Use special BlobMigrator UID and remove the data movement restrictions for blob migrator (#9839)

This commit is contained in:
Hui Liu 2023-03-30 08:25:35 -07:00 committed by GitHub
parent 0e720634f3
commit d5dc848626
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 2 deletions

View File

@ -2434,7 +2434,7 @@ ACTOR Future<Void> startBlobMigrator(ClusterControllerData* self, double waitTim
ProcessClass::NeverAssign,
self->db.config,
id_used);
InitializeBlobMigratorRequest req(deterministicRandom()->randomUniqueID());
InitializeBlobMigratorRequest req(BlobMigratorInterface::newId());
state WorkerDetails worker = blobMigratorWorker.worker;
if (self->onMasterIsBetter(worker, ProcessClass::BlobMigrator)) {
worker = self->id_worker[self->masterProcessId.get()].details;

View File

@ -401,6 +401,11 @@ bool canLaunchSrc(RelocateData& relocation,
ASSERT(relocation.src.size() != 0);
ASSERT(teamSize >= singleRegionTeamSize);
// Blob migrator is backed by s3 so it can allow unlimited data movements
if (relocation.src.size() == 1 && BlobMigratorInterface::isBlobMigrator(relocation.src.back())) {
return true;
}
// find the "workFactor" for this, were it launched now
int workFactor = getSrcWorkFactor(relocation, singleRegionTeamSize);
int neededServers = std::min<int>(relocation.src.size(), teamSize - singleRegionTeamSize + 1);
@ -424,6 +429,7 @@ bool canLaunchSrc(RelocateData& relocation,
return true;
}
}
return false;
}

View File

@ -38,7 +38,9 @@ struct BlobMigratorInterface {
BlobMigratorInterface() {}
BlobMigratorInterface(const struct LocalityData& l, UID id) : uniqueID(id), locality(l) {
ssi.locality = l;
ssi.uniqueID = id;
// The second 8 bytes of all blob migration interface id is fixed
ASSERT(id.second() == file_identifier);
ssi.uniqueID = uniqueID;
}
void initEndpoints() { ssi.initEndpoints(); }
@ -47,6 +49,9 @@ struct BlobMigratorInterface {
bool operator==(const BlobMigratorInterface& r) const { return id() == r.id(); }
bool operator!=(const BlobMigratorInterface& r) const { return !(*this == r); }
static UID newId() { return UID(deterministicRandom()->randomUInt64(), file_identifier); }
static bool isBlobMigrator(UID id) { return id.second() == file_identifier; };
template <class Archive>
void serialize(Archive& ar) {
serializer(ar, locality, uniqueID, haltBlobMigrator, waitFailure);