-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: None
-
Query Integration
-
ALL
-
None
-
None
-
None
-
None
-
None
-
None
-
None
The comment-based filtering in CurOpFailpointHelpers::waitWhileFailPointEnabled (src/mongo/db/curop_failpoint_helpers.cpp) arguably has a logic bug. If the failpoint data has a comment filter but the operation has no comment (opCtx->getComment() is null), the predicate short-circuits and falls through to the nss check, which is typically always true — incorrectly pausing the operation.
Current code:
if (data.hasField("comment") && opCtx->getComment()) { return opCtx->getComment()->String() == data.getStringField("comment"); } return nss.isEmpty() || fpNss.isEmpty() || fpNss == nss;
Suggested change:
if (data.hasField("comment")) { return opCtx->getComment() && opCtx->getComment()->String() == data.getStringField("comment"); } return nss.isEmpty() || fpNss.isEmpty() || fpNss == nss;
Operations without a comment should never match a comment-filtered failpoint.