diff options
author | Tor Egge <Tor.Egge@oath.com> | 2018-02-26 11:18:53 +0000 |
---|---|---|
committer | Tor Egge <Tor.Egge@oath.com> | 2018-02-26 12:07:31 +0000 |
commit | 22c8bbe1867c0e711189578306f945bfb9c299b6 (patch) | |
tree | 1cb4101dddf80dfa24ad0abe1ffa6f3a05347823 | |
parent | d4397003e0c2dffafc43c31436cca30ab4c0d35d (diff) |
Use ClusterState from DistributorBucketSpace in PendingBucketSpaceDbTransition.
-rw-r--r-- | storage/src/tests/distributor/bucketdbupdatertest.cpp | 9 | ||||
-rw-r--r-- | storage/src/vespa/storage/distributor/pending_bucket_space_db_transition.cpp | 2 |
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), |