[SERVER-63193] Watchdog may return success reading from page cache Created: 01/Feb/22  Updated: 29/Oct/23  Resolved: 04/Aug/22

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

Type: Bug Priority: Major - P3
Reporter: Kevin Arhelger Assignee: Gabriel Marks
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Linux


Issue Links:
Related
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Security 2022-05-02, Security 2022-05-16, Security 2022-05-30, Security 2022-07-11, Security 2022-07-25, Security 2022-08-08
Participants:
Case:
Linked BF Score: 35

 Description   

The comment on checkFile states this is “open a direct_io” to a new file. However, the O_DIRECT flag is not added to the open call. This should mean this is a standard, buffered IO.

https://github.com/mongodb/mongo/blob/master/src/mongo/watchdog/watchdog.cpp#L467

In an asymmetric storage failure where writes can complete, but reads are blocked, the read at https://github.com/mongodb/mongo/blob/master/src/mongo/watchdog/watchdog.cpp#L522 could be serviced from the Linux page cache, erroneously returning a success.



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

Author:

{'name': 'Gabriel Marks', 'email': 'gabriel.marks@mongodb.com', 'username': 'marksg07'}

Message: Revert "SERVER-63193 Use O_DIRECT in checkFile for the watchdog"

This reverts commit 50d4bcf42c06c70d179c128247919e62d5bffa50.
Branch: master
https://github.com/mongodb/mongo/commit/1aa4307b5ecd61413468cb190935f3746ddcf6ef

Comment by Githook User [ 25/Jul/22 ]

Author:

{'name': 'Gabriel Marks', 'email': 'gabriel.marks@mongodb.com', 'username': 'marksg07'}

Message: SERVER-63193 Use O_DIRECT in checkFile for the watchdog
Branch: master
https://github.com/mongodb/mongo/commit/50d4bcf42c06c70d179c128247919e62d5bffa50

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