Skip to content

Commit fc1dfdb

Browse files
committed
MB-34410: [SR] Warmup::loadPreparedSyncWrites: skip missing vBuckets
In loadPreparedSyncWrites() the result of getVBucket(vbid) is not checked to see if it's a non-null ptr, unlike other warmup phases. As such, if ns_server deletes a vBucket before loadPreparedSyncWrites, then we can crash dereferencig a null ptr. Change-Id: I6e0639716d35a2e0f4db92d8b2cdfbfb09c9f5c5 Reviewed-on: http://review.couchbase.org/109972 Reviewed-by: Jim Walker <[email protected]> Tested-by: Dave Rigby <[email protected]>
1 parent 97ba0d7 commit fc1dfdb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

engines/ep/src/warmup.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1168,6 +1168,9 @@ void Warmup::loadPreparedSyncWrites(uint16_t shardId) {
11681168
for (const auto vbid : shardVbIds[shardId]) {
11691169
const auto start = std::chrono::steady_clock::now();
11701170
auto vb = store.getVBucket(vbid);
1171+
if (!vb) {
1172+
continue;
1173+
}
11711174
auto& epVb = dynamic_cast<EPVBucket&>(*vb);
11721175

11731176
auto storageCB = std::make_shared<LoadSyncWrites>(epVb);

0 commit comments

Comments
 (0)