aboutsummaryrefslogtreecommitdiffstats
path: root/vdslib
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@verizonmedia.com>2019-03-15 16:05:22 +0000
committerTor Brede Vekterli <vekterli@verizonmedia.com>2019-03-15 16:05:22 +0000
commit00804dfe908b6a337f88c42ea3def0e1f1397474 (patch)
treee4e58c7a54e830fc5a237fe0be945e1f62f40492 /vdslib
parent1b959abd3224c00f0347a8078dc333abfdd3ce9f (diff)
Properly handle non-owned vs. missing buckets
Bonus: no more spurious "we have removed buckets" log messages caused by ownership changes. Also ensure that we BUSY-bounce operations in `ExternalOperationHandler` when there is no actual state to send back in a `WrongDistributionReply`.
Diffstat (limited to 'vdslib')
-rw-r--r--vdslib/src/vespa/vdslib/state/cluster_state_bundle.cpp9
-rw-r--r--vdslib/src/vespa/vdslib/state/cluster_state_bundle.h2
2 files changed, 11 insertions, 0 deletions
diff --git a/vdslib/src/vespa/vdslib/state/cluster_state_bundle.cpp b/vdslib/src/vespa/vdslib/state/cluster_state_bundle.cpp
index 68a279f04f8..ff633c02fad 100644
--- a/vdslib/src/vespa/vdslib/state/cluster_state_bundle.cpp
+++ b/vdslib/src/vespa/vdslib/state/cluster_state_bundle.cpp
@@ -4,6 +4,7 @@
#include "cluster_state_bundle.h"
#include "clusterstate.h"
#include <iostream>
+#include <sstream>
namespace storage::lib {
@@ -78,6 +79,14 @@ ClusterStateBundle::operator==(const ClusterStateBundle &rhs) const
return true;
}
+std::string
+ClusterStateBundle::toString() const
+{
+ std::ostringstream os;
+ os << *this;
+ return os.str();
+}
+
std::ostream& operator<<(std::ostream& os, const ClusterStateBundle& bundle) {
os << "ClusterStateBundle('" << *bundle.getBaselineClusterState();
if (!bundle.getDerivedClusterStates().empty()) {
diff --git a/vdslib/src/vespa/vdslib/state/cluster_state_bundle.h b/vdslib/src/vespa/vdslib/state/cluster_state_bundle.h
index a9e84225c1f..d0b052766ff 100644
--- a/vdslib/src/vespa/vdslib/state/cluster_state_bundle.h
+++ b/vdslib/src/vespa/vdslib/state/cluster_state_bundle.h
@@ -5,6 +5,7 @@
#include <vespa/document/bucket/bucketspace.h>
#include <unordered_map>
#include <iosfwd>
+#include <string>
namespace storage::lib {
@@ -40,6 +41,7 @@ public:
}
uint32_t getVersion() const;
bool deferredActivation() const noexcept { return _deferredActivation; }
+ std::string toString() const;
bool operator==(const ClusterStateBundle &rhs) const;
bool operator!=(const ClusterStateBundle &rhs) const { return !operator==(rhs); }
};