Using a knob to guard updateClusterSharedStateMap

This commit is contained in:
Zhe Wu 2022-11-09 22:41:22 -08:00
parent f40b8da3e9
commit 81fc8e9d2f
3 changed files with 3 additions and 1 deletions

View File

@ -294,6 +294,7 @@ void ClientKnobs::initialize(Randomize randomize) {
init( METACLUSTER_ASSIGNMENT_FIRST_CHOICE_DELAY, 1.0 ); if ( randomize && BUGGIFY ) METACLUSTER_ASSIGNMENT_FIRST_CHOICE_DELAY = deterministicRandom()->random01() * 60;
init( METACLUSTER_ASSIGNMENT_AVAILABILITY_TIMEOUT, 10.0 ); if ( randomize && BUGGIFY ) METACLUSTER_ASSIGNMENT_AVAILABILITY_TIMEOUT = 1 + deterministicRandom()->random01() * 59;
init( TENANT_ENTRY_CACHE_LIST_REFRESH_INTERVAL, 2 ); if( randomize && BUGGIFY ) TENANT_ENTRY_CACHE_LIST_REFRESH_INTERVAL = deterministicRandom()->randomInt(1, 10);
init( ENABLE_CLUSTER_SHARED_STATE_MAP, false); if( randomize && BUGGIFY ) ENABLE_CLUSTER_SHARED_STATE_MAP = true;
init( ENABLE_ENCRYPTION_CPU_TIME_LOGGING, false );
// clang-format on

View File

@ -2200,7 +2200,7 @@ void MultiVersionDatabase::DatabaseState::updateDatabase(Reference<IDatabase> ne
// state. Avoid updating the shared state if the database is a
// configuration database, because a configuration database does not have
// access to typical system keys and does not need to be updated.
if (db.isValid() && dbProtocolVersion.present() &&
if (CLIENT_KNOBS->ENABLE_CLUSTER_SHARED_STATE_MAP && db.isValid() && dbProtocolVersion.present() &&
MultiVersionApi::api->getApiVersion().hasClusterSharedStateMap() && !isConfigDB) {
Future<std::string> updateResult =
MultiVersionApi::api->updateClusterSharedStateMap(connectionRecord, dbProtocolVersion.get(), db);

View File

@ -289,6 +289,7 @@ public:
double METACLUSTER_ASSIGNMENT_FIRST_CHOICE_DELAY;
double METACLUSTER_ASSIGNMENT_AVAILABILITY_TIMEOUT;
int TENANT_ENTRY_CACHE_LIST_REFRESH_INTERVAL; // How often the TenantEntryCache is refreshed
bool ENABLE_CLUSTER_SHARED_STATE_MAP;
// Encryption-at-rest
bool ENABLE_ENCRYPTION_CPU_TIME_LOGGING;