summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeir Storli <geirstorli@yahoo.no>2018-02-26 14:19:53 +0100
committerGitHub <noreply@github.com>2018-02-26 14:19:53 +0100
commit28e5338aca83d5738da5d77bce663763b55e8532 (patch)
treef55d91d88bd6a1cbf75d2a31263325bb21ea9c63
parente330bc4bcde9620a178cf931f94c4e867a3a1831 (diff)
parent22c8bbe1867c0e711189578306f945bfb9c299b6 (diff)
Merge pull request #5148 from vespa-engine/toregge/use-cluster-stace-from-distributor-bucket-space-in-pending-bucket-space-db-transition
Use ClusterState from DistributorBucketSpace in PendingBucketSpaceDbTransition.
-rw-r--r--storage/src/tests/distributor/bucketdbupdatertest.cpp9
-rw-r--r--storage/src/vespa/storage/distributor/pending_bucket_space_db_transition.cpp2
2 files changed, 8 insertions, 3 deletions
diff --git a/storage/src/tests/distributor/bucketdbupdatertest.cpp b/storage/src/tests/distributor/bucketdbupdatertest.cpp
index 7831328460d..08262e30fe6 100644
--- a/storage/src/tests/distributor/bucketdbupdatertest.cpp
+++ b/storage/src/tests/distributor/bucketdbupdatertest.cpp
@@ -182,12 +182,17 @@ protected:
bool bucketExistsThatHasNode(int bucketCount, uint16_t node) const;
- ClusterInformation::CSP createClusterInfo(const std::string& clusterState) {
+ ClusterInformation::CSP createClusterInfo(const std::string& clusterStateString) {
+ auto clusterState = std::make_shared<lib::ClusterState>(clusterStateString);
ClusterInformation::CSP clusterInfo(
new SimpleClusterInformation(
getBucketDBUpdater().getDistributorComponent().getIndex(),
- lib::ClusterState(clusterState),
+ *clusterState,
"ui"));
+ auto &repo = getBucketSpaceRepo();
+ for (auto &elem : repo) {
+ elem.second->setClusterState(clusterState);
+ }
return clusterInfo;
}
diff --git a/storage/src/vespa/storage/distributor/pending_bucket_space_db_transition.cpp b/storage/src/vespa/storage/distributor/pending_bucket_space_db_transition.cpp
index ed9c8bc222b..2071558628e 100644
--- a/storage/src/vespa/storage/distributor/pending_bucket_space_db_transition.cpp
+++ b/storage/src/vespa/storage/distributor/pending_bucket_space_db_transition.cpp
@@ -29,7 +29,7 @@ PendingBucketSpaceDbTransition::PendingBucketSpaceDbTransition(const PendingClus
_missingEntries(),
_clusterInfo(std::move(clusterInfo)),
_outdatedNodes(newClusterState.getNodeCount(NodeType::STORAGE)),
- _prevClusterState(_clusterInfo->getClusterState()),
+ _prevClusterState(distributorBucketSpace.getClusterState()),
_newClusterState(newClusterState),
_creationTimestamp(creationTimestamp),
_pendingClusterState(pendingClusterState),