Skip to content

Commit

Permalink
MB-48862: Don't log critical msg in MagmaKVStore::prepareToDeleteImpl
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
rdemellow authored and daverigby committed Oct 20, 2021
1 parent ccadd07 commit 3bde439
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions engines/ep/src/kvstore/magma-kvstore/magma-kvstore.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1069,20 +1069,15 @@ void MagmaKVStore::prepareToCreateImpl(Vbid vbid) {
}

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

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

0 comments on commit 3bde439

Please sign in to comment.