[SERVER-46241] Ensure minVisibleSnapshots of collections created in multi-document transactions are appropriately set by the time they are visible in the catalog Created: 18/Feb/20  Updated: 29/Oct/23  Resolved: 02/Mar/20

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

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

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Execution Team 2020-03-09
Participants:

 Description   

When a collection gets created, it gets registered as part of the collection catalog during recovery unit commit. Its corresponding indexes have their minVisibleTimestamp set in a separate onCommit handler. Additionally, we set the minVisibleSnapshot of the newly-created collection to be a potentially null timestamp, before setting it again through creation of the _id index.



 Comments   
Comment by Githook User [ 02/Mar/20 ]

Author:

{'name': 'Maria van Keulen', 'username': 'mvankeulen94', 'email': 'maria@mongodb.com'}

Message: SERVER-46241 Set minVisibleSnapshot before new collections are visible

This patch specifically addresses collections created inside multi-
-document transactions.
Branch: master
https://github.com/mongodb/mongo/commit/8986181de667c0eb659ee0fe5d4ae7242c282ff6

Comment by Louis Williams [ 26/Feb/20 ]

Confirm whether this fix also fixes SERVER-45060

Comment by Maria van Keulen [ 24/Feb/20 ]

We should also consider the case in which a new index is created on an empty collection created earlier in the same transaction. A potential solution to cover both the case described in this ticket and in my comment above can be to register a pre commit hook instead of an onCommit handler to make the index visible. The collections themselves shouldn't be visible until after all pre commit hooks are called as of SERVER-46285.
Pre-commit hooks are not presently aware of the commit timestamp that gets passed to onCommit handlers. It is fine to have a window in which an index does not have a minimum visible snapshot but its owning collection does, since the reader must have access to the collection in order to view its indexes.

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