From 9ade12d313ce0482a9ca73fc225a6d510be913c3 Mon Sep 17 00:00:00 2001 From: Zhe Wu Date: Fri, 18 Nov 2022 09:56:40 -0800 Subject: [PATCH] Switch the knob that enables shared map to enable client using cluster id key --- fdbclient/ClientKnobs.cpp | 2 +- fdbclient/MultiVersionTransaction.actor.cpp | 4 ++-- fdbclient/include/fdbclient/ClientKnobs.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fdbclient/ClientKnobs.cpp b/fdbclient/ClientKnobs.cpp index e64db5c4be..fb0680fb31 100644 --- a/fdbclient/ClientKnobs.cpp +++ b/fdbclient/ClientKnobs.cpp @@ -294,7 +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( CLIENT_ENABLE_USING_CLUSTER_ID_KEY, false ); init( ENABLE_ENCRYPTION_CPU_TIME_LOGGING, false ); // clang-format on diff --git a/fdbclient/MultiVersionTransaction.actor.cpp b/fdbclient/MultiVersionTransaction.actor.cpp index 2bff227748..d0d084d46e 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 (CLIENT_KNOBS->ENABLE_CLUSTER_SHARED_STATE_MAP && db.isValid() && dbProtocolVersion.present() && + if (db.isValid() && dbProtocolVersion.present() && MultiVersionApi::api->getApiVersion().hasClusterSharedStateMap() && !isConfigDB) { Future updateResult = MultiVersionApi::api->updateClusterSharedStateMap(connectionRecord, dbProtocolVersion.get(), db); @@ -2968,7 +2968,7 @@ ACTOR Future updateClusterSharedStateMapImpl(MultiVersionApi* self, // The cluster ID will be the connection record string (either a filename or the connection string itself) // in versions before we could read the cluster ID. state std::string clusterId = connectionRecord.toString(); - if (dbProtocolVersion.hasClusterIdSpecialKey()) { + if (CLIENT_KNOBS->CLIENT_ENABLE_USING_CLUSTER_ID_KEY && dbProtocolVersion.hasClusterIdSpecialKey()) { state Reference tr = db->createTransaction(); loop { try { diff --git a/fdbclient/include/fdbclient/ClientKnobs.h b/fdbclient/include/fdbclient/ClientKnobs.h index fa96e97cf7..90ac004621 100644 --- a/fdbclient/include/fdbclient/ClientKnobs.h +++ b/fdbclient/include/fdbclient/ClientKnobs.h @@ -289,7 +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; + bool CLIENT_ENABLE_USING_CLUSTER_ID_KEY; // Encryption-at-rest bool ENABLE_ENCRYPTION_CPU_TIME_LOGGING;