Skip to content

Commit 564e310

Browse files
jimwwalkerdaverigby
authored andcommitted
MB-39864: Improve passive stream collection exception logging
Logging exception but missing the DCP prefix (which comes from using log()) and no vb logged. Change-Id: I2c7d039cda9d53eb784ac5694d4a086c2174df26 Reviewed-on: http://review.couchbase.org/c/kv_engine/+/133814 Tested-by: Build Bot <[email protected]> Reviewed-by: Dave Rigby <[email protected]>
1 parent d776bb4 commit 564e310

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

engines/ep/src/dcp/passive_stream.cc

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -874,8 +874,10 @@ ENGINE_ERROR_CODE PassiveStream::processCreateCollection(
874874
event.getMaxTtl(),
875875
event.getBySeqno());
876876
} catch (std::exception& e) {
877-
EP_LOG_WARN("PassiveStream::processCreateCollection exception {}",
878-
e.what());
877+
log(spdlog::level::level_enum::warn,
878+
"PassiveStream::processCreateCollection {} exception {}",
879+
vb.getId(),
880+
e.what());
879881
return ENGINE_EINVAL;
880882
}
881883
return ENGINE_SUCCESS;
@@ -888,8 +890,10 @@ ENGINE_ERROR_CODE PassiveStream::processDropCollection(
888890
event.getCollectionID(),
889891
event.getBySeqno());
890892
} catch (std::exception& e) {
891-
EP_LOG_WARN("PassiveStream::processDropCollection exception {}",
892-
e.what());
893+
log(spdlog::level::level_enum::warn,
894+
"PassiveStream::processDropCollection {} exception {}",
895+
vb.getId(),
896+
e.what());
893897
return ENGINE_EINVAL;
894898
}
895899
return ENGINE_SUCCESS;
@@ -903,7 +907,10 @@ ENGINE_ERROR_CODE PassiveStream::processCreateScope(
903907
event.getKey(),
904908
event.getBySeqno());
905909
} catch (std::exception& e) {
906-
EP_LOG_WARN("PassiveStream::processCreateScope exception {}", e.what());
910+
log(spdlog::level::level_enum::warn,
911+
"PassiveStream::processCreateScope {} exception {}",
912+
vb.getId(),
913+
e.what());
907914
return ENGINE_EINVAL;
908915
}
909916
return ENGINE_SUCCESS;
@@ -915,7 +922,10 @@ ENGINE_ERROR_CODE PassiveStream::processDropScope(VBucket& vb,
915922
vb.replicaDropScope(
916923
event.getManifestUid(), event.getScopeID(), event.getBySeqno());
917924
} catch (std::exception& e) {
918-
EP_LOG_WARN("PassiveStream::processDropScope exception {}", e.what());
925+
log(spdlog::level::level_enum::warn,
926+
"PassiveStream::processDropScope {} exception {}",
927+
vb.getId(),
928+
e.what());
919929
return ENGINE_EINVAL;
920930
}
921931
return ENGINE_SUCCESS;

0 commit comments

Comments
 (0)