diff --git a/fdbcli/fdbcli.actor.cpp b/fdbcli/fdbcli.actor.cpp index 3db220f7bd..6fe87c0132 100644 --- a/fdbcli/fdbcli.actor.cpp +++ b/fdbcli/fdbcli.actor.cpp @@ -436,9 +436,9 @@ void initHelp() { "clear a range of keys from the database", "All keys between BEGINKEY (inclusive) and ENDKEY (exclusive) are cleared from the database. This command will succeed even if the specified range is empty, but may fail because of conflicts." ESCAPINGK); helpMap["configure"] = CommandHelp( - "configure [new] |logs=|resolvers=>*", + "configure [new] |logs=|resolvers=>*", "change 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 specified.\n\nRedundancy mode:\n single - one copy of the data. Not fault tolerant.\n double - two copies of data (survive one failure).\n triple - three copies of data (survive two failures).\n three_data_hall - See the Admin Guide.\n three_datacenter - See the Admin Guide.\n fast_recovery_double - two copies of data on the storage servers, three copies of the data on the logs, non-copying recovery if one log is missing.\n fast_recovery_triple - three copies of data on the storage servers, four copies of the data on the logs, non-copying recovery if one log is missing.\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\nproxies=: Sets the desired number of proxies in the cluster. Must be at least 1, or set to -1 which restores the number of 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."); + "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 specified.\n\nRedundancy mode:\n single - one copy of the data. Not fault tolerant.\n double - two copies of data (survive one failure).\n triple - three copies of data (survive two failures).\n three_data_hall - 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\nproxies=: Sets the desired number of proxies in the cluster. Must be at least 1, or set to -1 which restores the number of 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["coordinators"] = CommandHelp( "coordinators auto|
+ [description=new_cluster_description]", "change cluster coordinators or description", @@ -1895,7 +1895,7 @@ void onoff_generator(const char* text, const char *line, std::vector& lc) { - const char* opts[] = {"new", "single", "double", "triple", "three_data_hall", "three_datacenter", "fast_recovery_double", "fast_recovery_triple", "ssd", "ssd-1", "ssd-2", "memory", "proxies=", "logs=", "resolvers=", NULL}; + const char* opts[] = {"new", "single", "double", "triple", "three_data_hall", "three_datacenter", "ssd", "ssd-1", "ssd-2", "memory", "proxies=", "logs=", "resolvers=", NULL}; array_generator(text, line, opts, lc); } diff --git a/fdbclient/ManagementAPI.actor.cpp b/fdbclient/ManagementAPI.actor.cpp index fad3176af2..ded2ec6eac 100644 --- a/fdbclient/ManagementAPI.actor.cpp +++ b/fdbclient/ManagementAPI.actor.cpp @@ -87,7 +87,7 @@ std::map configForToken( std::string const& mode ) { return out; } - std::string redundancy, log_replicas, log_recovery_anti_quorum, dc="1", minDC="1"; + std::string redundancy, log_replicas, dc="1", minDC="1"; IRepPolicyRef storagePolicy; IRepPolicyRef tLogPolicy; @@ -95,36 +95,21 @@ std::map configForToken( std::string const& mode ) { if (mode == "single") { redundancy="1"; log_replicas="1"; - log_recovery_anti_quorum="0"; storagePolicy = tLogPolicy = IRepPolicyRef(new PolicyOne()); - } else if(mode == "double") { + } else if(mode == "double" || mode == "fast_recovery_double") { redundancy="2"; log_replicas="2"; - log_recovery_anti_quorum="0"; storagePolicy = tLogPolicy = IRepPolicyRef(new PolicyAcross(2, "zoneid", IRepPolicyRef(new PolicyOne()))); - } else if(mode == "triple") { + } else if(mode == "triple" || mode == "fast_recovery_triple") { redundancy="3"; log_replicas="3"; - log_recovery_anti_quorum="0"; storagePolicy = tLogPolicy = IRepPolicyRef(new PolicyAcross(3, "zoneid", IRepPolicyRef(new PolicyOne()))); - } else if(mode == "fast_recovery_double") { - redundancy="2"; - log_replicas="3"; - log_recovery_anti_quorum="1"; - storagePolicy = IRepPolicyRef(new PolicyAcross(2, "zoneid", IRepPolicyRef(new PolicyOne()))); - tLogPolicy = IRepPolicyRef(new PolicyAcross(3, "zoneid", IRepPolicyRef(new PolicyOne()))); - } else if(mode == "fast_recovery_triple") { - redundancy="3"; - log_replicas="4"; - log_recovery_anti_quorum="1"; - storagePolicy = IRepPolicyRef(new PolicyAcross(3, "zoneid", IRepPolicyRef(new PolicyOne()))); - tLogPolicy = IRepPolicyRef(new PolicyAcross(4, "zoneid", IRepPolicyRef(new PolicyOne()))); } else if(mode == "two_datacenter") { - redundancy="3"; log_replicas="3"; log_recovery_anti_quorum="0"; dc="2"; minDC="1"; + redundancy="3"; log_replicas="3"; dc="2"; minDC="1"; storagePolicy = tLogPolicy = IRepPolicyRef(new PolicyAcross(3, "zoneid", IRepPolicyRef(new PolicyOne()))); } else if(mode == "three_datacenter") { - redundancy="3"; log_replicas="3"; log_recovery_anti_quorum="0"; dc="3"; minDC="2"; + redundancy="3"; log_replicas="3"; dc="3"; minDC="2"; storagePolicy = tLogPolicy = IRepPolicyRef(new PolicyAnd({ IRepPolicyRef(new PolicyAcross(3, "dcid", IRepPolicyRef(new PolicyOne()))), IRepPolicyRef(new PolicyAcross(3, "zoneid", IRepPolicyRef(new PolicyOne()))) @@ -132,7 +117,6 @@ std::map configForToken( std::string const& mode ) { } else if(mode == "three_data_hall") { redundancy="3"; log_replicas="4"; - log_recovery_anti_quorum="0"; storagePolicy = IRepPolicyRef(new PolicyAcross(3, "data_hall", IRepPolicyRef(new PolicyOne()))); tLogPolicy = IRepPolicyRef(new PolicyAcross(2, "data_hall", IRepPolicyRef(new PolicyAcross(2, "zoneid", IRepPolicyRef(new PolicyOne()))) @@ -144,7 +128,6 @@ std::map configForToken( std::string const& mode ) { out[p+"storage_quorum"] = redundancy; out[p+"log_replicas"] = log_replicas; out[p+"log_anti_quorum"] = "0"; - out[p+"log_recovery_anti_quorum"] = log_recovery_anti_quorum; out[p+"replica_datacenters"] = dc; out[p+"min_replica_datacenters"] = minDC; @@ -307,10 +290,10 @@ ConfigureAutoResult parseConfig( StatusObject const& status ) { result.auto_replication = "double"; storage_replication = 2; log_replication = 2; - } else if( result.old_replication == "double" ) { + } else if( result.old_replication == "double" || result.old_replication == "fast_recovery_double" ) { storage_replication = 2; log_replication = 2; - } else if( result.old_replication == "triple" ) { + } else if( result.old_replication == "triple" || result.old_replication == "fast_recovery_triple" ) { storage_replication = 3; log_replication = 3; } else if( result.old_replication == "two_datacenter" ) { @@ -319,12 +302,6 @@ ConfigureAutoResult parseConfig( StatusObject const& status ) { } else if( result.old_replication == "three_datacenter" ) { storage_replication = 3; log_replication = 3; - } else if( result.old_replication == "fast_recovery_double" ) { - storage_replication = 2; - log_replication = 3; - } else if( result.old_replication == "fast_recovery_triple" ) { - storage_replication = 3; - log_replication = 4; } else return ConfigureAutoResult(); diff --git a/fdbserver/DatabaseConfiguration.cpp b/fdbserver/DatabaseConfiguration.cpp index 9fb7ce998b..7ce493ab34 100644 --- a/fdbserver/DatabaseConfiguration.cpp +++ b/fdbserver/DatabaseConfiguration.cpp @@ -81,18 +81,21 @@ std::map DatabaseConfiguration::toMap() const { std::map result; if( initialized ) { - if( tLogReplicationFactor == durableStorageQuorum && - durableStorageQuorum == storageTeamSize && + if( durableStorageQuorum == storageTeamSize && tLogWriteAntiQuorum == 0 ) { - if( durableStorageQuorum == 1 && desiredDataCenters == 1 && minDataCenters == 1 ) + if( tLogReplicationFactor == 1 && durableStorageQuorum == 1 && desiredDataCenters == 1 && minDataCenters == 1 ) result["redundancy_mode"] = "single"; - else if( durableStorageQuorum == 2 && desiredDataCenters == 1 && minDataCenters == 1 ) + else if( tLogReplicationFactor == 2 && durableStorageQuorum == 2 && desiredDataCenters == 1 && minDataCenters == 1 ) result["redundancy_mode"] = "double"; - else if( durableStorageQuorum == 3 && desiredDataCenters == 1 && minDataCenters == 1 ) + else if( tLogReplicationFactor == 3 && durableStorageQuorum == 3 && desiredDataCenters == 1 && minDataCenters == 1 ) result["redundancy_mode"] = "triple"; - else if( durableStorageQuorum == 3 && desiredDataCenters == 2 && minDataCenters == 1 ) + else if( tLogReplicationFactor == 3 && durableStorageQuorum == 2 && desiredDataCenters == 1 && minDataCenters == 1 ) + result["redundancy_mode"] = "fast_recovery_double"; + else if( tLogReplicationFactor == 4 && durableStorageQuorum == 3 && desiredDataCenters == 1 && minDataCenters == 1 ) + result["redundancy_mode"] = "fast_recovery_triple"; + else if( tLogReplicationFactor == 3 && durableStorageQuorum == 3 && desiredDataCenters == 2 && minDataCenters == 1 ) result["redundancy_mode"] = "two_datacenter"; - else if( durableStorageQuorum == 3 && desiredDataCenters == 3 && minDataCenters == 2 ) + else if( tLogReplicationFactor == 3 && durableStorageQuorum == 3 && desiredDataCenters == 3 && minDataCenters == 2 ) result["redundancy_mode"] = "three_datacenter"; else result["redundancy_mode"] = "custom";