Skip to content

Commit

Permalink
MB-39745: Manually size shards in VBucketMap
Browse files Browse the repository at this point in the history
Manually size the KVShard vector as we know the correct size.

Change-Id: I1f2d302bcb12170bfe612860b8437951fa875c05
Reviewed-on: http://review.couchbase.org/c/kv_engine/+/153168
Reviewed-by: Paolo Cocchi <paolo.cocchi@couchbase.com>
Tested-by: Build Bot <build@couchbase.com>
  • Loading branch information
BenHuddleston authored and daverigby committed Jul 14, 2021
1 parent 296348e commit 1d305e3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion engines/ep/src/vbucketmap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ VBucketMap::VBucketMap(Configuration& config, KVBucket& store)
: size(config.getMaxVbuckets()) {
auto& engine = store.getEPEngine();
const auto numShards = engine.getWorkLoadPolicy().getNumShards();
shards.resize(numShards);
for (size_t shardId = 0; shardId < numShards; shardId++) {
shards.push_back(std::make_unique<KVShard>(engine, shardId));
shards[shardId] = std::make_unique<KVShard>(engine, shardId);
}

config.addValueChangedListener(
Expand Down

0 comments on commit 1d305e3

Please sign in to comment.