From 81fc8e9d2ff6a0fda381610ac44c6b7f63e24c6b Mon Sep 17 00:00:00 2001 From: Zhe Wu Date: Wed, 9 Nov 2022 22:41:22 -0800 Subject: [PATCH] Using a knob to guard updateClusterSharedStateMap --- fdbclient/ClientKnobs.cpp | 1 + fdbclient/MultiVersionTransaction.actor.cpp | 2 +- fdbclient/include/fdbclient/ClientKnobs.h | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/fdbclient/ClientKnobs.cpp b/fdbclient/ClientKnobs.cpp index 18abda3702..e64db5c4be 100644 --- a/fdbclient/ClientKnobs.cpp +++ b/fdbclient/ClientKnobs.cpp @@ -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 diff --git a/fdbclient/MultiVersionTransaction.actor.cpp b/fdbclient/MultiVersionTransaction.actor.cpp index d351bc29d2..2bff227748 100644 --- a/fdbclient/MultiVersionTransaction.actor.cpp +++ b/fdbclient/MultiVersionTransaction.actor.cpp @@ -2200,7 +2200,7 @@ void MultiVersionDatabase::DatabaseState::updateDatabase(Reference 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 updateResult = MultiVersionApi::api->updateClusterSharedStateMap(connectionRecord, dbProtocolVersion.get(), db); diff --git a/fdbclient/include/fdbclient/ClientKnobs.h b/fdbclient/include/fdbclient/ClientKnobs.h index 7532007541..fa96e97cf7 100644 --- a/fdbclient/include/fdbclient/ClientKnobs.h +++ b/fdbclient/include/fdbclient/ClientKnobs.h @@ -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;