[SERVER-43857] Only use a MODE_IX collection lock for index creation on an empty collection Created: 07/Oct/19  Updated: 15/Oct/19  Resolved: 15/Oct/19

Status: Closed
Project: Core Server
Component/s: Catalog, Index Maintenance
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Major - P3
Reporter: Geert Bosch Assignee: Geert Bosch
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Sprint: Execution Team 2019-11-04
Participants:

 Description   
  • Register new indexes with the IndexCatalog after getting the commit OpTime in the OpObserver. Set the minVisibleSnapshot to the commit time before registering.
  • As it is now possible for concurrent creations of the same collection name to race, throw a WriteConflictException if registration fails due to an already existing collection of the same name. Test that conflicts that happen before registration time still return IndexKeySpecsConflict.
  • Ensure that operations that do not read at a timestamp cannot see an index that has been observed by the OpObserver but that not yet has committed, or has been committed in a newer storage snapshot than that of the reader.
  • Ensure that the above mechanism also works for non-replicated collections, or keep using MODE_X collection locks for those.


 Comments   
Comment by Geert Bosch [ 15/Oct/19 ]

Checking whether a collection is empty or not is meaningless without locking. The real intent is support for creating indexes on newly created collections, so opening a ticket for that instead.

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