From cc5bc16bd8ac8841a3378849b02b4cdbc8f1b21b Mon Sep 17 00:00:00 2001 From: Young Liu Date: Tue, 15 Sep 2020 22:29:49 -0700 Subject: [PATCH] Rename more places from proxy to commit proxy --- fdbcli/fdbcli.actor.cpp | 19 ++++---- fdbclient/CommitProxyInterface.h | 4 +- fdbclient/DatabaseConfiguration.cpp | 48 ++++++++++++------- fdbclient/DatabaseContext.h | 2 +- fdbclient/Knobs.cpp | 2 +- fdbclient/ManagementAPI.actor.cpp | 1 - fdbclient/NativeAPI.actor.cpp | 6 +-- fdbclient/vexillographer/fdb.options | 2 +- fdbrpc/Locality.h | 3 -- fdbserver/ApplyMetadataMutation.cpp | 4 +- fdbserver/ClusterController.actor.cpp | 4 +- fdbserver/Knobs.cpp | 2 +- fdbserver/Knobs.h | 2 +- fdbserver/MasterInterface.h | 2 +- fdbserver/Ratekeeper.actor.cpp | 18 +++---- fdbserver/Resolver.actor.cpp | 10 ++-- fdbserver/Status.actor.cpp | 16 +++---- fdbserver/masterserver.actor.cpp | 26 +++++----- fdbserver/storageserver.actor.cpp | 6 +-- .../workloads/ConfigureDatabase.actor.cpp | 2 +- fdbserver/workloads/TargetedKill.actor.cpp | 10 ++-- tests/status/separate_not_enough_servers.txt | 2 +- 22 files changed, 100 insertions(+), 91 deletions(-) diff --git a/fdbcli/fdbcli.actor.cpp b/fdbcli/fdbcli.actor.cpp index a304daa2ad..ac219df9e3 100644 --- a/fdbcli/fdbcli.actor.cpp +++ b/fdbcli/fdbcli.actor.cpp @@ -471,8 +471,7 @@ void initHelp() { helpMap["configure"] = CommandHelp( "configure [new] " "|grv_" - "proxies=|logs=|resolvers=>*", + "COMMIT_PROXIES>|grv_proxies=|logs=|resolvers=>*", "change the database configuration", "The `new' option, if present, initializes a new database with the given configuration rather than changing " "the configuration of an existing one. When used, both a redundancy mode and a storage engine must be " @@ -481,15 +480,13 @@ void initHelp() { "See the Admin Guide.\n three_datacenter - See the Admin Guide.\n\nStorage engine:\n ssd - B-Tree storage " "engine optimized for solid state disks.\n memory - Durable in-memory storage engine for small " "datasets.\n\ncommit_proxies=: Sets the desired number of commit proxies in the cluster. Must " - "be at least 1, or set " - "to -1 which restores the number of commit proxies to the default value.\n\ngrv_proxies=: Sets " - "the " - "desired number of GRV proxies in the cluster. Must be at least 1, or set to -1 which restores the number of " - "GRV proxies to the default value.\n\nlogs=: Sets the desired number of log servers in the cluster. Must " - "be " - "at least 1, or set to -1 which restores the number of logs to the default value.\n\nresolvers=: " - "Sets the desired number of resolvers in the cluster. Must be at least 1, or set to -1 which restores the " - "number of resolvers to the default value.\n\nSee the FoundationDB Administration Guide for more information."); + "be at least 1, or set to -1 which restores the number of commit proxies to the default " + "value.\n\ngrv_proxies=: Sets the desired number of GRV proxies in the cluster. Must be at least " + "1, or set to -1 which restores the number of GRV proxies to the default value.\n\nlogs=: Sets the " + "desired number of log servers in the cluster. Must be at least 1, or set to -1 which restores the number of " + "logs to the default value.\n\nresolvers=: Sets the desired number of resolvers in the cluster. " + "Must be at least 1, or set to -1 which restores the number of resolvers to the default value.\n\nSee the " + "FoundationDB Administration Guide for more information."); helpMap["fileconfigure"] = CommandHelp( "fileconfigure [new] ", "change the database configuration from a file", diff --git a/fdbclient/CommitProxyInterface.h b/fdbclient/CommitProxyInterface.h index c6b12dd7f2..ceba2cf0f8 100644 --- a/fdbclient/CommitProxyInterface.h +++ b/fdbclient/CommitProxyInterface.h @@ -100,10 +100,10 @@ struct CommitProxyInterface { struct ClientDBInfo { constexpr static FileIdentifier file_identifier = 5355080; UID id; // Changes each time anything else changes - vector< GrvProxyInterface > grvProxies; + vector grvProxies; vector commitProxies; Optional - firstCommitProxy; // not serialized, used for commitOnFirstProxy when the proxies vector has been shrunk + firstCommitProxy; // not serialized, used for commitOnFirstProxy when the commit proxies vector has been shrunk double clientTxnInfoSampleRate; int64_t clientTxnInfoSizeLimit; Optional forward; diff --git a/fdbclient/DatabaseConfiguration.cpp b/fdbclient/DatabaseConfiguration.cpp index f70fc4275c..464c220555 100644 --- a/fdbclient/DatabaseConfiguration.cpp +++ b/fdbclient/DatabaseConfiguration.cpp @@ -164,24 +164,40 @@ void DatabaseConfiguration::setDefaultReplicationPolicy() { } bool DatabaseConfiguration::isValid() const { - if (!(initialized && tLogWriteAntiQuorum >= 0 && tLogWriteAntiQuorum <= tLogReplicationFactor / 2 && - tLogReplicationFactor >= 1 && storageTeamSize >= 1 && getDesiredCommitProxies() >= 1 && - getDesiredGrvProxies() >= 1 && getDesiredLogs() >= 1 && getDesiredResolvers() >= 1 && - tLogVersion != TLogVersion::UNSET && tLogVersion >= TLogVersion::MIN_RECRUITABLE && - tLogVersion <= TLogVersion::MAX_SUPPORTED && tLogDataStoreType != KeyValueStoreType::END && - tLogSpillType != TLogSpillType::UNSET && - !(tLogSpillType == TLogSpillType::REFERENCE && tLogVersion < TLogVersion::V3) && - storageServerStoreType != KeyValueStoreType::END && autoCommitProxyCount >= 1 && autoGrvProxyCount >= 1 && - autoResolverCount >= 1 && autoDesiredTLogCount >= 1 && storagePolicy && tLogPolicy && - getDesiredRemoteLogs() >= 1 && remoteTLogReplicationFactor >= 0 && repopulateRegionAntiQuorum >= 0 && - repopulateRegionAntiQuorum <= 1 && usableRegions >= 1 && usableRegions <= 2 && regions.size() <= 2 && - (usableRegions == 1 || regions.size() == 2) && (regions.size() == 0 || regions[0].priority >= 0) && - (regions.size() == 0 || - tLogPolicy->info() != - "dcid^2 x zoneid^2 x 1"))) { // We cannot specify regions with three_datacenter replication + if( !(initialized && + tLogWriteAntiQuorum >= 0 && + tLogWriteAntiQuorum <= tLogReplicationFactor/2 && + tLogReplicationFactor >= 1 && + storageTeamSize >= 1 && + getDesiredCommitProxies() >= 1 && + getDesiredGrvProxies() >= 1 && + getDesiredLogs() >= 1 && + getDesiredResolvers() >= 1 && + tLogVersion != TLogVersion::UNSET && + tLogVersion >= TLogVersion::MIN_RECRUITABLE && + tLogVersion <= TLogVersion::MAX_SUPPORTED && + tLogDataStoreType != KeyValueStoreType::END && + tLogSpillType != TLogSpillType::UNSET && + !(tLogSpillType == TLogSpillType::REFERENCE && tLogVersion < TLogVersion::V3) && + storageServerStoreType != KeyValueStoreType::END && + autoCommitProxyCount >= 1 && + autoGrvProxyCount >= 1 && + autoResolverCount >= 1 && + autoDesiredTLogCount >= 1 && + storagePolicy && + tLogPolicy && + getDesiredRemoteLogs() >= 1 && + remoteTLogReplicationFactor >= 0 && + repopulateRegionAntiQuorum >= 0 && + repopulateRegionAntiQuorum <= 1 && + usableRegions >= 1 && + usableRegions <= 2 && + regions.size() <= 2 && + ( usableRegions == 1 || regions.size() == 2 ) && + ( regions.size() == 0 || regions[0].priority >= 0 ) && + ( regions.size() == 0 || tLogPolicy->info() != "dcid^2 x zoneid^2 x 1") ) ) { //We cannot specify regions with three_datacenter replication return false; } - std::set dcIds; dcIds.insert(Key()); for(auto& r : regions) { diff --git a/fdbclient/DatabaseContext.h b/fdbclient/DatabaseContext.h index f9367482e5..5652ae7a14 100644 --- a/fdbclient/DatabaseContext.h +++ b/fdbclient/DatabaseContext.h @@ -221,7 +221,7 @@ public: Future monitorProxiesInfoChange; Reference commitProxies; Reference grvProxies; - bool proxyProvisional; + bool proxyProvisional; // Provisional commit proxy and grv proxy are used at the same time. UID proxiesLastChange; LocalityData clientLocality; QueueModel queueModel; diff --git a/fdbclient/Knobs.cpp b/fdbclient/Knobs.cpp index d1ec7a4f5f..9ec850bc75 100644 --- a/fdbclient/Knobs.cpp +++ b/fdbclient/Knobs.cpp @@ -171,7 +171,7 @@ void ClientKnobs::initialize(bool randomize) { init( MIN_CLEANUP_SECONDS, 3600.0 ); // Configuration - init( DEFAULT_AUTO_COMMIT_PROXIES, 3 ); + init( DEFAULT_AUTO_COMMIT_PROXIES, 3 ); init( DEFAULT_AUTO_GRV_PROXIES, 1 ); init( DEFAULT_AUTO_RESOLVERS, 1 ); init( DEFAULT_AUTO_LOGS, 3 ); diff --git a/fdbclient/ManagementAPI.actor.cpp b/fdbclient/ManagementAPI.actor.cpp index e4a5183b95..bd4b3b6e95 100644 --- a/fdbclient/ManagementAPI.actor.cpp +++ b/fdbclient/ManagementAPI.actor.cpp @@ -747,7 +747,6 @@ ConfigureAutoResult parseConfig( StatusObject const& status ) { proxyCount = result.old_commit_proxies; } - // Need to configure a good number. result.desired_grv_proxies = std::max(std::min(4, processCount / 20), 1); int grvProxyCount; if (!statusObjConfig.get("grv_proxies", result.old_grv_proxies)) { diff --git a/fdbclient/NativeAPI.actor.cpp b/fdbclient/NativeAPI.actor.cpp index 19683a536b..62a0c1936d 100644 --- a/fdbclient/NativeAPI.actor.cpp +++ b/fdbclient/NativeAPI.actor.cpp @@ -1597,9 +1597,9 @@ Reference DatabaseContext::getGrvProxies(bool useProvisionalProxie // Actor which will wait until the MultiInterface returned by the DatabaseContext cx is not NULL ACTOR Future> getCommitProxiesFuture(DatabaseContext* cx, bool useProvisionalProxies) { loop{ - Reference proxies = cx->getCommitProxies(useProvisionalProxies); - if (proxies) - return proxies; + Reference commitProxies = cx->getCommitProxies(useProvisionalProxies); + if (commitProxies) + return commitProxies; wait( cx->onProxiesChanged() ); } } diff --git a/fdbclient/vexillographer/fdb.options b/fdbclient/vexillographer/fdb.options index f11956d79c..37e57346ee 100644 --- a/fdbclient/vexillographer/fdb.options +++ b/fdbclient/vexillographer/fdb.options @@ -195,7 +195,7 @@ description is not currently required but encouraged.