[SERVER-35343] Coverity analysis defect 103593: Unchecked return value Created: 01/Jun/18  Updated: 29/Oct/23  Resolved: 13/Jun/18

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: None
Fix Version/s: 4.1.1

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: Benety Goh
Resolution: Fixed Votes: 0
Labels: coverity
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-30101 Coverity analysis defect 101783: Unch... Closed
Related
is related to SERVER-32335 Update initial sync to use new Applie... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Repl 2018-06-18
Participants:

 Description   

Value returned from a function is not checked for errors before being used

Defect 103593 (STATIC_C)
Checker CHECKED_RETURN (subcategory none)
File: /src/mongo/db/repl/sync_tail.cpp
Function mongo::repl::multiSyncApply(mongo::OperationContext , std::vector<const mongo::repl::OplogEntry *, std::allocator<const mongo::repl::OplogEntry *>> *, mongo::repl::SyncTail *, std::vector<mongo::MultikeyPathInfo, std::allocator<mongo::MultikeyPathInfo>>)
/src/mongo/db/repl/sync_tail.cpp, line: 1285
Calling "fetchAndInsertMissingDocument" without checking return value (as is done elsewhere 2 out of 3 times).

                            st->fetchAndInsertMissingDocument(opCtx, entry);



 Comments   
Comment by Githook User [ 13/Jun/18 ]

Author:

{'username': 'benety', 'name': 'Benety Goh', 'email': 'benety@mongodb.com'}

Message: SERVER-35343 SyncTail::fetchAndInsertMissingDocument() no longer returns a bool
Branch: master
https://github.com/mongodb/mongo/commit/644e0813ee7c68faa23ccfcf4633a9ff4819466d

Comment by Githook User [ 13/Jun/18 ]

Author:

{'username': 'benety', 'name': 'Benety Goh', 'email': 'benety@mongodb.com'}

Message: SERVER-35343 convert repl dbtest to use OplogApplier::Observer
Branch: master
https://github.com/mongodb/mongo/commit/56a4d894cc679db1ccd2336c490a1c3cd838f0d6

Comment by Benety Goh [ 12/Jun/18 ]

This coverity warning was introduced during SERVER-32335 in the commit d2978d6af210356616c07193a29641a41f797d8b when we combined multiInitialSyncApply and multiSyncApply. We previously diagnosed this defect in SERVER-30101.

Generated at Thu Feb 08 04:39:33 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.