[SERVER-51762] Delete code for old unique index format Created: 20/Oct/20 Updated: 22/Jan/24 Resolved: 15/Jan/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 4.9.0 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Louis Williams | Assignee: | Louis Williams |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||
| Sprint: | Execution Team 2021-01-25 | ||||||||||||||||||||
| Participants: | |||||||||||||||||||||
| Linked BF Score: | 50 | ||||||||||||||||||||
| Description |
|
All non-_id unique indexes since 4.4 should be upgraded to the new format versions 11 or 12. We already fatally assert if that is not the case.
|
| Comments |
| Comment by Githook User [ 19/Jan/21 ] |
|
Author: {'name': 'Louis Williams', 'email': 'louis.williams@mongodb.com', 'username': 'louiswilliams'}Message: |
| Comment by Githook User [ 15/Jan/21 ] |
|
Author: {'name': 'Louis Williams', 'email': 'louis.williams@mongodb.com', 'username': 'louiswilliams'}Message: This refactor makes the following improvements:
|
| Comment by Louis Williams [ 20/Oct/20 ] |
|
Code I think we can delete: In the function _insertTimestampUnsafe, for example, we can remove all of the code that handles WT_DUPLICATE_KEY errors highlighted here. Only _id indexes take this path, and I don't believe it's possible for _id indexes to temporarily have duplicate keys. Code we can't delete: In _insertTimestampSafe, we can't remove any of the code that lazily upgrades the unique key format highlighted here. As you mentioned, this is because the new format (i.e. "timestamp safe") has to know how to read the old format. |
| Comment by Daniel Gottlieb (Inactive) [ 20/Oct/20 ] |
|
Can you link to some of the old code that anticipates multiple record ids? Additional context for this ticket would be useful. It's my understanding that the new unique index format is a "superset" of the old format – it understands all of the old states an index could be in, but only writes out entries in the new format. And I would suspect we've already deleted the code that could write out the old-style entries when the FCV value gating the feature was deleted. |
| Comment by Louis Williams [ 20/Oct/20 ] |
|
I actually don't think my assumption here is correct. _id indexes still take the "timestampUnsafe" code paths. That said, I believe we can still delete some of the code that anticipates there being multiple RecordIDs on the same key, since this should be impossible for the _id index. |