Merge pull request #10740 from sfc-gh-jslocum/fix_tenant_watching

Fix tenant watching
This commit is contained in:
Jingyu Zhou 2024-01-09 11:22:48 -08:00 committed by GitHub
commit e458651a04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 3 deletions

View File

@ -1459,7 +1459,7 @@ ACTOR Future<Void> monitorTenants(Reference<BlobManagerData> bmData) {
tr->setOption(FDBTransactionOptions::LOCK_AWARE);
wait(loadTenantMap(tr, bmData));
state Future<Void> watchChange = tr->watch(TenantMetadata::lastTenantId().key);
state Future<Void> watchChange = TenantMetadata::lastTenantModification().watch(tr);
wait(tr->commit());
wait(watchChange);
tr->reset();

View File

@ -845,7 +845,8 @@ private:
// A special key to be loaded at the end:
// Blob worker monitors lastTenantId to refresh tenant map. If we load it before
// rest of other part of tenant metadata, Blob worker may get partial tenant map. So delay it.
if (rows[i].key == TenantMetadata::lastTenantId().key) {
if (rows[i].key == TenantMetadata::lastTenantId().key ||
rows[i].key == TenantMetadata::lastTenantModification().key) {
self->delayedRows_.push_back_deep(self->delayedRows_.arena(), rows[i]);
} else {
tr.set(rows[i].key, rows[i].value);

View File

@ -5075,7 +5075,7 @@ ACTOR Future<Void> monitorTenants(Reference<BlobWorkerData> bwData) {
}
bwData->tenantData.addTenants(tenants);
state Future<Void> watchChange = tr->watch(TenantMetadata::lastTenantId().key);
state Future<Void> watchChange = TenantMetadata::lastTenantModification().watch(tr);
wait(tr->commit());
bwData->addGRVHistory(tr->getReadVersion().get());
wait(watchChange);