[SERVER-66283] Tailable cursors can miss writes on unreplicated capped collections Created: 06/May/22  Updated: 05/Feb/24  Resolved: 29/Dec/22

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

Type: Bug Priority: Major - P3
Reporter: Louis Williams Assignee: Louis Williams
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-68271 Trigger Collection instantiation when... Closed
Related
is related to SERVER-86241 InsertStatement's recordId might be u... Backlog
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Execution Team 2022-07-11, Execution Team 2022-07-25, Execution Team 2022-08-08, Execution Team 2022-08-22, Execution Team 2022-09-05, Execution Team 2022-09-19, Execution Team 2022-10-03, Execution Team 2022-10-17, Execution Team 2022-10-31, Execution Team 2022-11-14, Execution Team 2022-12-12, Execution Team 2022-11-28, Execution Team 2022-12-26, Execution Team 2023-01-09
Participants:

 Description   

Unreplicated capped collections do not serialize writes (see SERVER-21646), which means that tailable cursors can miss writes that commit in a different order than they were inserted.

This problem has essentially existed since we implemented document-level locking in 3.0.

Instead of also serializing writes to capped local collections, which would affect performance of inserts into the system.profile collection, I propose that we ban the usage of tailable cursors on unreplicated capped collections since they never worked correctly anyways.



 Comments   
Comment by Githook User [ 29/Dec/22 ]

Author:

{'name': 'Louis Williams', 'email': 'louis.williams@mongodb.com', 'username': 'louiswilliams'}

Message: SERVER-66283 Correct tailable cursor support on unreplicated capped collections

This corrects previously incorrect behavior where tailable cursors on unreplicated capped
collections like the profile collection could miss writes

This pushes non-oplog capped collection visibility logic outside of the storage engine layer
Branch: master
https://github.com/mongodb/mongo/commit/96573561ca19babfc0fa5f535c6cec095e703ebc

Comment by Gregory Noma [ 15/Dec/22 ]

louis.williams@mongodb.com I see this is in Blocked but it's not linked as dependent as on anything, is there a ticket this can be linked to?

Comment by Louis Williams [ 10/May/22 ]

More context: we unintentionally broke tailable cursors on the system.profile collection in SERVER-61277 for 5.3.0 by no longer serializing writes, which was a request in SERVER-55476.

We have three options:

  • Partially-revert the change in SERVER-61277 and serialize writes on system.profile again
  • Implement SERVER-18934
  • Ban tailable cursors on unreplicated capped collections. We don't think we should do this.
Comment by Louis Williams [ 06/May/22 ]

This is essentially an alternative to SERVER-18934, which is a decent amount of work.

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