Skip to content

Commit 3bde439

Browse files
rdemellowdaverigby
authored andcommitted
MB-48862: Don't log critical msg in MagmaKVStore::prepareToDeleteImpl
MagmaKVStore::prepareToDeleteImpl() shouldn't log a critical message if it's unable to get hold of the revision of the current KVStore within magma. As there may not be one present, if we've not persisted any documents to disk for the given VBucket. Change-Id: I538ee556081a49dde4468e39f56421d350b0d254 Reviewed-on: http://review.couchbase.org/c/kv_engine/+/163892 Tested-by: Build Bot <[email protected]> Reviewed-by: Dave Rigby <[email protected]>
1 parent ccadd07 commit 3bde439

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

engines/ep/src/kvstore/magma-kvstore/magma-kvstore.cc

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,20 +1069,15 @@ void MagmaKVStore::prepareToCreateImpl(Vbid vbid) {
10691069
}
10701070

10711071
uint64_t MagmaKVStore::prepareToDeleteImpl(Vbid vbid) {
1072-
Status status;
1073-
Magma::KVStoreRevision kvsRev;
1074-
std::tie(status, kvsRev) = magma->GetKVStoreRevision(vbid.get());
1075-
if (!status) {
1076-
logger->critical(
1077-
"MagmaKVStore::prepareToDeleteImpl {} "
1078-
"GetKVStoreRevision failed. Status:{}",
1079-
vbid,
1080-
status.String());
1081-
// Even though we couldn't get the kvstore revision from magma,
1082-
// we'll use what is in kv engine and assume its the latest.
1083-
kvsRev = kvstoreRevList[getCacheSlot(vbid)];
1072+
auto [status, kvsRev] = magma->GetKVStoreRevision(vbid.get());
1073+
if (status) {
1074+
return kvsRev;
10841075
}
1085-
return kvsRev;
1076+
// Even though we couldn't get the kvstore revision from magma, we'll use
1077+
// what is in kv engine and assume its the latest. We might not be able to
1078+
// get the revision of the KVStore if we've not persited any documents yet
1079+
// for this vbid.
1080+
return kvstoreRevList[getCacheSlot(vbid)];
10861081
}
10871082

10881083
// Note: It is assumed this can only be called from bg flusher thread or

0 commit comments

Comments
 (0)