[SERVER-34639] Background indexes on primaries should advance the minimumVisibleSnapshot when they begin Created: 24/Apr/18  Updated: 29/Oct/23  Resolved: 25/Apr/18

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 3.7.5
Fix Version/s: 4.0.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
is depended on by SERVER-33374 Add snapshot read concurrency testing Closed
Related
is related to SERVER-34580 Plumb operation time to `getMinimumVi... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Storage NYC 2018-05-07
Participants:
Linked BF Score: 56

 Description   

Starting a background index build on a primary does not set the minimumVisibleSnapshot on the collection until the index build finishes. If a reader reads at a timestamp A before an index build timestamped for B, a reader may iterate through the indexes for a collection and reach this invariant.

From SERVER-34494:

The problem is that _setupInMemoryStructures is called before the actual catalog entry is updated on disk, so a reader may see an in-memory state inconsistent with the state on disk. This can be prevented by updating the minimumVisibleSnapshot on the collection to force readers to wait for a later timestamp.

This should be changed for all background index builds, not just on secondaries.



 Comments   
Comment by Githook User [ 25/Apr/18 ]

Author:

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

Message: SERVER-34639 Background indexes on primaries should advance the minimumVisibleSnapshot when they begin
Branch: master
https://github.com/mongodb/mongo/commit/2deac715b6345a8103acc1da6187f77e65843019

Comment by Judah Schvimer [ 24/Apr/18 ]

The attached code review calls setMinimumVisibleSnapshot in an onCommit handler, so this will work nicely with SERVER-34580.

Comment by Spencer Brody (Inactive) [ 24/Apr/18 ]

FYI daniel.gottlieb judah.schvimer

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