[SERVER-47694] fix multikey. again Created: 22/Apr/20 Updated: 29/Oct/23 Resolved: 24/Apr/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Storage |
| Affects Version/s: | None |
| Fix Version/s: | 4.0.20, 4.4.0-rc3, 4.7.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Daniel Gottlieb (Inactive) | Assignee: | Daniel Gottlieb (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||
| Operating System: | ALL | ||||||||||||||||||||
| Backport Requested: |
v4.4, v4.2, v4.0
|
||||||||||||||||||||
| Sprint: | Execution Team 2020-05-04 | ||||||||||||||||||||
| Participants: | |||||||||||||||||||||
| Linked BF Score: | 34 | ||||||||||||||||||||
| Description |
|
The multikey variable on indexes serves a dual purpose:
In the absence of using the storage engine snapshot to determine the multikey state of an index, a single variable is insufficient to satisfy the concurrent reader-writer contract as well as the concurrent writer-writer contract. This setting of multikey in an onCommit prevents the writer-writer contract from being violated. Writers can only skip setting multikey once a storage engine transaction has successfully committed. However it allows a reader-writer error. A reader that slices a writer's storage engine commit and its onCommit handlers can see a snapshot with multikey data, but see an in memory value of false. The alternative of unconditionally setting multikey outside of the onCommit, prior to the storage engine committing leads to a writer-writer problem. A few cases can go wrong. For brevity, we can describe the most egregious case. Suppose the writer that flips multikey in memory rolls back its storage engine transaction. Future writers will never try to correct the multikey value on disk. |
| Comments |
| Comment by Githook User [ 26/Feb/21 ] |
|
Author: {'name': 'Louis Williams', 'email': 'louis.williams@mongodb.com', 'username': 'louiswilliams'}Message: Revert " This reverts commit 46fc6fb233e85538a94dda6eea91cc2ac34cee15. Revert " This reverts commit ecd41f8b3bfe2154921cbcede9040d535a46e0c5. |
| Comment by Githook User [ 08/Feb/21 ] |
|
Author: {'name': 'Louis Williams', 'email': 'louis.williams@mongodb.com', 'username': 'louiswilliams'}Message: Split the single _isMultikey variable on an IndexCatalogEntry(Impl) into two _isMultikeyForReader is flipped as early as possible. Readers concurrent _isMultikeyForWriter is flipped after the storage engine commits a multikey Move logic for optimizing readers (multikey paths, clearing query cache) outside Adds a failpoint widenWUOWChangesWindow which sleeps transaction commit and Have validate assert multikey paths are set correctly for the documents observed (cherry picked from commit 3566db153ea61fb10d3ef11ea917fc7bc93eac4d) |
| Comment by Githook User [ 10/Jun/20 ] |
|
Author: {'name': 'Daniel Gottlieb', 'email': 'daniel.gottlieb@mongodb.com', 'username': 'dgottlieb'}Message: Split the single _isMultikey variable on an IndexCatalogEntry(Impl) into two _isMultikeyForReader is flipped as early as possible. Readers concurrent _isMultikeyForWriter is flipped after the storage engine commits a multikey Move logic for optimizing readers (multikey paths, clearing query cache) outside (cherry picked from commit 3566db153ea61fb10d3ef11ea917fc7bc93eac4d) |
| Comment by Githook User [ 24/Apr/20 ] |
|
Author: {'name': 'Daniel Gottlieb', 'email': 'daniel.gottlieb@mongodb.com', 'username': 'dgottlieb'}Message: Split the single _isMultikey variable on an IndexCatalogEntry(Impl) into two _isMultikeyForReader is flipped as early as possible. Readers concurrent _isMultikeyForWriter is flipped after the storage engine commits a multikey Move logic for optimizing readers (multikey paths, clearing query cache) outside Adds a failpoint widenWUOWChangesWindow which sleeps transaction commit and Have validate assert multikey paths are set correctly for the documents observed (cherry picked from commit 3566db153ea61fb10d3ef11ea917fc7bc93eac4d) |
| Comment by Githook User [ 24/Apr/20 ] |
|
Author: {'name': 'Daniel Gottlieb', 'email': 'daniel.gottlieb@mongodb.com', 'username': 'dgottlieb'}Message: Split the single _isMultikey variable on an IndexCatalogEntry(Impl) into two _isMultikeyForReader is flipped as early as possible. Readers concurrent _isMultikeyForWriter is flipped after the storage engine commits a multikey Move logic for optimizing readers (multikey paths, clearing query cache) outside Adds a failpoint widenWUOWChangesWindow which sleeps transaction commit and Have validate assert multikey paths are set correctly for the documents observed |