From cd19a9b61af72acc69e93f3e39af3f4bf21961ff Mon Sep 17 00:00:00 2001 From: "A.J. Beamon" Date: Mon, 1 Mar 2021 14:50:27 -0800 Subject: [PATCH 01/11] Fix bug where regions reported extra satellites --- fdbcli/fdbcli.actor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fdbcli/fdbcli.actor.cpp b/fdbcli/fdbcli.actor.cpp index f34534f7b3..896c3cfd12 100644 --- a/fdbcli/fdbcli.actor.cpp +++ b/fdbcli/fdbcli.actor.cpp @@ -1025,9 +1025,9 @@ void printStatus(StatusObjectReader statusObj, StatusClient::StatusLevel level, outputString += "\n Regions: "; regions = statusObjConfig["regions"].get_array(); bool isPrimary = false; - std::vector regionSatelliteDCs; std::string regionDC; for (StatusObjectReader region : regions) { + std::vector regionSatelliteDCs; for (StatusObjectReader dc : region["datacenters"].get_array()) { if (!dc.has("satellite")) { regionDC = dc["id"].get_str(); From 75c2e1e2ea78e386ea88984ab1d3309a341df872 Mon Sep 17 00:00:00 2001 From: Evan Tschannen Date: Fri, 5 Mar 2021 10:07:09 -0800 Subject: [PATCH 02/11] fix: if the time associated with newest fetchkeys is equal to now(), longestTime will throw an unknown error --- fdbserver/storageserver.actor.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/fdbserver/storageserver.actor.cpp b/fdbserver/storageserver.actor.cpp index b75d4a768e..dcdb0ed617 100644 --- a/fdbserver/storageserver.actor.cpp +++ b/fdbserver/storageserver.actor.cpp @@ -338,15 +338,18 @@ public: const double currentTime = now(); double longest = 0; - UID UIDofLongest; + Optional UIDofLongest; for (const auto& kv: startTimeMap) { const double currentRunningTime = currentTime - kv.second; - if (longest < currentRunningTime) { + if (longest <= currentRunningTime) { longest = currentRunningTime; UIDofLongest = kv.first; } } - return {longest, keyRangeMap.at(UIDofLongest)}; + if(UIDofLongest.present()) { + return {longest, keyRangeMap[UIDofLongest.get()]}; + } + return {-1, emptyKeyRange}; } int numRunning() const { return startTimeMap.size(); } From 5988ac5487d263270b1f13a8d25713fd0400a01e Mon Sep 17 00:00:00 2001 From: Evan Tschannen Date: Fri, 5 Mar 2021 10:12:24 -0800 Subject: [PATCH 03/11] updated documentation for 6.2.33 --- documentation/sphinx/source/downloads.rst | 24 +++++++++---------- .../release-notes/release-notes-620.rst | 4 ++++ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/documentation/sphinx/source/downloads.rst b/documentation/sphinx/source/downloads.rst index 5729a4ba1c..8ca21b8007 100644 --- a/documentation/sphinx/source/downloads.rst +++ b/documentation/sphinx/source/downloads.rst @@ -10,38 +10,38 @@ macOS The macOS installation package is supported on macOS 10.7+. It includes the client and (optionally) the server. -* `FoundationDB-6.2.30.pkg `_ +* `FoundationDB-6.2.33.pkg `_ Ubuntu ------ The Ubuntu packages are supported on 64-bit Ubuntu 12.04+, but beware of the Linux kernel bug in Ubuntu 12.x. -* `foundationdb-clients-6.2.30-1_amd64.deb `_ -* `foundationdb-server-6.2.30-1_amd64.deb `_ (depends on the clients package) +* `foundationdb-clients-6.2.33-1_amd64.deb `_ +* `foundationdb-server-6.2.33-1_amd64.deb `_ (depends on the clients package) RHEL/CentOS EL6 --------------- The RHEL/CentOS EL6 packages are supported on 64-bit RHEL/CentOS 6.x. -* `foundationdb-clients-6.2.30-1.el6.x86_64.rpm `_ -* `foundationdb-server-6.2.30-1.el6.x86_64.rpm `_ (depends on the clients package) +* `foundationdb-clients-6.2.33-1.el6.x86_64.rpm `_ +* `foundationdb-server-6.2.33-1.el6.x86_64.rpm `_ (depends on the clients package) RHEL/CentOS EL7 --------------- The RHEL/CentOS EL7 packages are supported on 64-bit RHEL/CentOS 7.x. -* `foundationdb-clients-6.2.30-1.el7.x86_64.rpm `_ -* `foundationdb-server-6.2.30-1.el7.x86_64.rpm `_ (depends on the clients package) +* `foundationdb-clients-6.2.33-1.el7.x86_64.rpm `_ +* `foundationdb-server-6.2.33-1.el7.x86_64.rpm `_ (depends on the clients package) Windows ------- The Windows installer is supported on 64-bit Windows XP and later. It includes the client and (optionally) the server. -* `foundationdb-6.2.30-x64.msi `_ +* `foundationdb-6.2.33-x64.msi `_ API Language Bindings ===================== @@ -58,18 +58,18 @@ On macOS and Windows, the FoundationDB Python API bindings are installed as part If you need to use the FoundationDB Python API from other Python installations or paths, download the Python package: -* `foundationdb-6.2.30.tar.gz `_ +* `foundationdb-6.2.33.tar.gz `_ Ruby 1.9.3/2.0.0+ ----------------- -* `fdb-6.2.30.gem `_ +* `fdb-6.2.33.gem `_ Java 8+ ------- -* `fdb-java-6.2.30.jar `_ -* `fdb-java-6.2.30-javadoc.jar `_ +* `fdb-java-6.2.33.jar `_ +* `fdb-java-6.2.33-javadoc.jar `_ Go 1.11+ -------- diff --git a/documentation/sphinx/source/release-notes/release-notes-620.rst b/documentation/sphinx/source/release-notes/release-notes-620.rst index 35094d3497..1eb4dd8d91 100644 --- a/documentation/sphinx/source/release-notes/release-notes-620.rst +++ b/documentation/sphinx/source/release-notes/release-notes-620.rst @@ -4,6 +4,10 @@ Release Notes ############# +6.2.33 +====== +* Fixed a issue where storage servers could shutdown with ``unknown_error``. `(PR #4380) `_ + 6.2.32 ====== * Fix an issue where symbolic links in cmake-built RPMs are broken if you unpack the RPM to a custom directory. `(PR #4380) `_ From 2f625fd767092e5ca633be3b826d8b6bdce4dd27 Mon Sep 17 00:00:00 2001 From: Evan Tschannen Date: Fri, 5 Mar 2021 10:18:08 -0800 Subject: [PATCH 04/11] added more protection --- fdbserver/storageserver.actor.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fdbserver/storageserver.actor.cpp b/fdbserver/storageserver.actor.cpp index dcdb0ed617..eb2535daf7 100644 --- a/fdbserver/storageserver.actor.cpp +++ b/fdbserver/storageserver.actor.cpp @@ -346,7 +346,10 @@ public: UIDofLongest = kv.first; } } - if(UIDofLongest.present()) { + if(BUGGIFY) { + UIDofLongest = Optional(); + } + if(UIDofLongest.present() && keyRangeMap.count(UIDofLongest.get())) { return {longest, keyRangeMap[UIDofLongest.get()]}; } return {-1, emptyKeyRange}; From 980755b9cf2a0d520bb858b16cd8d95069659197 Mon Sep 17 00:00:00 2001 From: Evan Tschannen Date: Fri, 5 Mar 2021 10:22:16 -0800 Subject: [PATCH 05/11] fixed compile error --- fdbserver/storageserver.actor.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fdbserver/storageserver.actor.cpp b/fdbserver/storageserver.actor.cpp index eb2535daf7..dd7f510710 100644 --- a/fdbserver/storageserver.actor.cpp +++ b/fdbserver/storageserver.actor.cpp @@ -338,7 +338,7 @@ public: const double currentTime = now(); double longest = 0; - Optional UIDofLongest; + UID UIDofLongest; for (const auto& kv: startTimeMap) { const double currentRunningTime = currentTime - kv.second; if (longest <= currentRunningTime) { @@ -347,10 +347,10 @@ public: } } if(BUGGIFY) { - UIDofLongest = Optional(); + UIDofLongest = deterministicRandom()->randomUniqueID(); } - if(UIDofLongest.present() && keyRangeMap.count(UIDofLongest.get())) { - return {longest, keyRangeMap[UIDofLongest.get()]}; + if(keyRangeMap.count(UIDofLongest)) { + return {longest, keyRangeMap[UIDofLongest]}; } return {-1, emptyKeyRange}; } From 1d8977f3c24566ef6ee80b1dd47d8a3cf755d8e6 Mon Sep 17 00:00:00 2001 From: Evan Tschannen Date: Fri, 5 Mar 2021 10:25:44 -0800 Subject: [PATCH 06/11] another attempt to fix compile error --- fdbserver/storageserver.actor.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fdbserver/storageserver.actor.cpp b/fdbserver/storageserver.actor.cpp index dd7f510710..059ce81fe5 100644 --- a/fdbserver/storageserver.actor.cpp +++ b/fdbserver/storageserver.actor.cpp @@ -350,7 +350,8 @@ public: UIDofLongest = deterministicRandom()->randomUniqueID(); } if(keyRangeMap.count(UIDofLongest)) { - return {longest, keyRangeMap[UIDofLongest]}; + const KeyRange& range = keyRangeMap[UIDofLongest]; + return {longest, range}; } return {-1, emptyKeyRange}; } From 36c904b6f77b0ef328b52b498eeed5b8740e4d7d Mon Sep 17 00:00:00 2001 From: Evan Tschannen Date: Fri, 5 Mar 2021 10:32:24 -0800 Subject: [PATCH 07/11] go back to using .at() because we are in a const function --- fdbserver/storageserver.actor.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fdbserver/storageserver.actor.cpp b/fdbserver/storageserver.actor.cpp index 059ce81fe5..534dca4fec 100644 --- a/fdbserver/storageserver.actor.cpp +++ b/fdbserver/storageserver.actor.cpp @@ -350,8 +350,7 @@ public: UIDofLongest = deterministicRandom()->randomUniqueID(); } if(keyRangeMap.count(UIDofLongest)) { - const KeyRange& range = keyRangeMap[UIDofLongest]; - return {longest, range}; + return {longest, keyRangeMap.at(UIDofLongest)}; } return {-1, emptyKeyRange}; } From 8d88afec8a186db1f5ff5e0f267953f0c3f16c02 Mon Sep 17 00:00:00 2001 From: Evan Tschannen Date: Fri, 5 Mar 2021 10:35:17 -0800 Subject: [PATCH 08/11] change to using find --- fdbserver/storageserver.actor.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fdbserver/storageserver.actor.cpp b/fdbserver/storageserver.actor.cpp index 534dca4fec..ff886bd75c 100644 --- a/fdbserver/storageserver.actor.cpp +++ b/fdbserver/storageserver.actor.cpp @@ -349,8 +349,9 @@ public: if(BUGGIFY) { UIDofLongest = deterministicRandom()->randomUniqueID(); } - if(keyRangeMap.count(UIDofLongest)) { - return {longest, keyRangeMap.at(UIDofLongest)}; + auto it = keyRangeMap.find(UIDofLongest); + if(it != keyRangeMap.end()) { + return {longest, *it}; } return {-1, emptyKeyRange}; } From 940ea42c6e1d12b65af58db550b3eb663de2b488 Mon Sep 17 00:00:00 2001 From: Evan Tschannen Date: Fri, 5 Mar 2021 10:37:49 -0800 Subject: [PATCH 09/11] wrong use of the iterator --- fdbserver/storageserver.actor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fdbserver/storageserver.actor.cpp b/fdbserver/storageserver.actor.cpp index ff886bd75c..32d8f91ac0 100644 --- a/fdbserver/storageserver.actor.cpp +++ b/fdbserver/storageserver.actor.cpp @@ -351,7 +351,7 @@ public: } auto it = keyRangeMap.find(UIDofLongest); if(it != keyRangeMap.end()) { - return {longest, *it}; + return {longest, it->second}; } return {-1, emptyKeyRange}; } From 75352611842ff048a3e19a446ee0a1147dace873 Mon Sep 17 00:00:00 2001 From: "A.J. Beamon" Date: Tue, 9 Mar 2021 09:43:42 -0800 Subject: [PATCH 10/11] Fix typo --- documentation/sphinx/source/release-notes/release-notes-620.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/sphinx/source/release-notes/release-notes-620.rst b/documentation/sphinx/source/release-notes/release-notes-620.rst index 1eb4dd8d91..17af92da7b 100644 --- a/documentation/sphinx/source/release-notes/release-notes-620.rst +++ b/documentation/sphinx/source/release-notes/release-notes-620.rst @@ -6,7 +6,7 @@ Release Notes 6.2.33 ====== -* Fixed a issue where storage servers could shutdown with ``unknown_error``. `(PR #4380) `_ +* Fixed an issue where storage servers could shutdown with ``unknown_error``. `(PR #4380) `_ 6.2.32 ====== From 060885d9ad1eecb5cd4cb106f0c128e8cd466129 Mon Sep 17 00:00:00 2001 From: Evan Tschannen Date: Tue, 9 Mar 2021 11:46:54 -0800 Subject: [PATCH 11/11] removed changes to downloads.rst applied clang format --- documentation/sphinx/source/downloads.rst | 24 +++++++++++------------ fdbserver/storageserver.actor.cpp | 12 ++++++------ 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/documentation/sphinx/source/downloads.rst b/documentation/sphinx/source/downloads.rst index 8ca21b8007..5729a4ba1c 100644 --- a/documentation/sphinx/source/downloads.rst +++ b/documentation/sphinx/source/downloads.rst @@ -10,38 +10,38 @@ macOS The macOS installation package is supported on macOS 10.7+. It includes the client and (optionally) the server. -* `FoundationDB-6.2.33.pkg `_ +* `FoundationDB-6.2.30.pkg `_ Ubuntu ------ The Ubuntu packages are supported on 64-bit Ubuntu 12.04+, but beware of the Linux kernel bug in Ubuntu 12.x. -* `foundationdb-clients-6.2.33-1_amd64.deb `_ -* `foundationdb-server-6.2.33-1_amd64.deb `_ (depends on the clients package) +* `foundationdb-clients-6.2.30-1_amd64.deb `_ +* `foundationdb-server-6.2.30-1_amd64.deb `_ (depends on the clients package) RHEL/CentOS EL6 --------------- The RHEL/CentOS EL6 packages are supported on 64-bit RHEL/CentOS 6.x. -* `foundationdb-clients-6.2.33-1.el6.x86_64.rpm `_ -* `foundationdb-server-6.2.33-1.el6.x86_64.rpm `_ (depends on the clients package) +* `foundationdb-clients-6.2.30-1.el6.x86_64.rpm `_ +* `foundationdb-server-6.2.30-1.el6.x86_64.rpm `_ (depends on the clients package) RHEL/CentOS EL7 --------------- The RHEL/CentOS EL7 packages are supported on 64-bit RHEL/CentOS 7.x. -* `foundationdb-clients-6.2.33-1.el7.x86_64.rpm `_ -* `foundationdb-server-6.2.33-1.el7.x86_64.rpm `_ (depends on the clients package) +* `foundationdb-clients-6.2.30-1.el7.x86_64.rpm `_ +* `foundationdb-server-6.2.30-1.el7.x86_64.rpm `_ (depends on the clients package) Windows ------- The Windows installer is supported on 64-bit Windows XP and later. It includes the client and (optionally) the server. -* `foundationdb-6.2.33-x64.msi `_ +* `foundationdb-6.2.30-x64.msi `_ API Language Bindings ===================== @@ -58,18 +58,18 @@ On macOS and Windows, the FoundationDB Python API bindings are installed as part If you need to use the FoundationDB Python API from other Python installations or paths, download the Python package: -* `foundationdb-6.2.33.tar.gz `_ +* `foundationdb-6.2.30.tar.gz `_ Ruby 1.9.3/2.0.0+ ----------------- -* `fdb-6.2.33.gem `_ +* `fdb-6.2.30.gem `_ Java 8+ ------- -* `fdb-java-6.2.33.jar `_ -* `fdb-java-6.2.33-javadoc.jar `_ +* `fdb-java-6.2.30.jar `_ +* `fdb-java-6.2.30-javadoc.jar `_ Go 1.11+ -------- diff --git a/fdbserver/storageserver.actor.cpp b/fdbserver/storageserver.actor.cpp index 32d8f91ac0..6888f79d0f 100644 --- a/fdbserver/storageserver.actor.cpp +++ b/fdbserver/storageserver.actor.cpp @@ -333,27 +333,27 @@ public: std::pair longestTime() const { if (numRunning() == 0) { - return {-1, emptyKeyRange}; + return { -1, emptyKeyRange }; } const double currentTime = now(); double longest = 0; UID UIDofLongest; - for (const auto& kv: startTimeMap) { + for (const auto& kv : startTimeMap) { const double currentRunningTime = currentTime - kv.second; if (longest <= currentRunningTime) { longest = currentRunningTime; UIDofLongest = kv.first; } } - if(BUGGIFY) { + if (BUGGIFY) { UIDofLongest = deterministicRandom()->randomUniqueID(); } auto it = keyRangeMap.find(UIDofLongest); - if(it != keyRangeMap.end()) { - return {longest, it->second}; + if (it != keyRangeMap.end()) { + return { longest, it->second }; } - return {-1, emptyKeyRange}; + return { -1, emptyKeyRange }; } int numRunning() const { return startTimeMap.size(); }