[SERVER-51841] Incorrect usage of fassertFailedNoTrace in OplogCapMaintainerThread Created: 27/Oct/20  Updated: 29/Oct/23  Resolved: 08/Jul/22

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: None
Fix Version/s: 6.1.0-rc0

Type: Bug Priority: Major - P3
Reporter: Kevin Pulo Assignee: Leonardo Menti (Inactive)
Resolution: Fixed Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Execution Team 2022-07-11
Participants:

 Description   

This line:

fassertFailedNoTrace(!"unknown error in OplogCapMaintainerThread");

is not how fassertFailedNoTrace is supposed to be used - it takes a unique error code. This code takes the address of the string literal (which will be non-zero), logically negates that (to get 0), and then passes that to fassertFailedNoTrace which will log the message:

Fatal assertion 0 at src/mongo/db/storage/oplog_cap_maintainer_thread.cpp 90

This is almost certainly not what was intended. I suspect it should be more like:

LOGV2_FATAL_NOTRACE(5184100, "unknown error in OplogCapMaintainerThread");



 Comments   
Comment by Githook User [ 07/Jul/22 ]

Author:

{'name': 'Leonardo Menti', 'email': 'leonardo.menti@mongodb.com', 'username': 'leonardomenti'}

Message: SERVER-51841 Correct usage of fassertFailedNoTrace in OplogCapMaintainerThread
Branch: master
https://github.com/mongodb/mongo/commit/850161356ba07d654aab253b6e3fd31849278a16

Comment by Daniel Gottlieb (Inactive) [ 30/Oct/20 ]

Original commit

Generated at Thu Feb 08 05:26:35 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.