The DD_TENANT_AWARENESS_ENABLED knob was indirectly disabling the feature by not initializing a dd tenant cache, but this could be bypassed by enabling storage quotas. This makes the knob more explicitly control the feature.

This commit is contained in:
A.J. Beamon 2023-03-15 15:56:24 -07:00
parent b4eb665f1d
commit 3f9d51db4e

View File

@ -937,12 +937,12 @@ ACTOR Future<Void> brokenPromiseToReady(Future<Void> f) {
}
static bool shardMergeFeasible(DataDistributionTracker* self, KeyRange const& keys, KeyRangeRef adjRange) {
bool honorTenantKeyspaceBoundaries = self->ddTenantCache.present();
if (!honorTenantKeyspaceBoundaries) {
if (!SERVER_KNOBS->DD_TENANT_AWARENESS_ENABLED) {
return true;
}
ASSERT(self->ddTenantCache.present());
Optional<Reference<TCTenantInfo>> tenantOwningRange = {};
Optional<Reference<TCTenantInfo>> tenantOwningAdjRange = {};
@ -1498,7 +1498,8 @@ ACTOR Future<Void> dataDistributionTracker(Reference<InitialDataDistribution> in
initData.clear(); // Release reference count.
state PromiseStream<TenantCacheTenantCreated> tenantCreationSignal;
if (self.ddTenantCache.present()) {
if (SERVER_KNOBS->DD_TENANT_AWARENESS_ENABLED) {
ASSERT(self.ddTenantCache.present());
tenantCreationSignal = self.ddTenantCache.get()->tenantCreationSignal;
}