[SERVER-46640] The TTLMonitor can remove the cached index information from the TTLCollectionCache for a newly created index before the implicitly created collection is registered in the CollectionCatalog Created: 05/Mar/20 Updated: 29/Oct/23 Resolved: 13/Mar/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Storage |
| Affects Version/s: | 4.4.0-rc0, 4.5.1 |
| Fix Version/s: | 4.4.0-rc0, 4.7.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Gregory Wlodarek | Assignee: | Gregory Wlodarek |
| 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
|
||||||||
| Steps To Reproduce: | Remove these lines in ttl.cpp: https://github.com/mongodb/mongo/blob/3e30e2f0705cbb167d28cfe6f5344c354f2e9442/src/mongo/db/ttl.cpp#L94-L97 Run `resmoke --suites=no_passthrough jstests/noPassthrough/ttl_partial_index.js` It should fail on the first execution, if not, just run it again with --opt=on. |
||||||||
| Sprint: | Execution Team 2020-03-23 | ||||||||
| Participants: | |||||||||
| Linked BF Score: | 13 | ||||||||
| Description |
|
The TTLMonitor uses the CollectionCatalog to look-up the collection namespace given a UUID here (prior to obtaining any collection locks). If the collection with the given UUID does not exist in the CollectionCatalog, the cached information gets removed from the TTLCollectionCache for that index. This will prevent the TTLMonitor from ever running on that index, and as a consequence, the TTLMonitor won't remove any expired documents in the collection for the given index unless it is recreated, which would cause it to be registered in the TTLCollectionCache again.
Based on these logs, when creating a new index that requires the collection to be created implicitly, the index will be registered in the TTLCollectionCache before the collection is registered with the CollectionCatalog. If the TTLMonitor were to run between these two events, it would think that the collection for that index was dropped, and so it will deregister that index from the TTLCollectionCache.
|
| Comments |
| Comment by Githook User [ 13/Mar/20 ] |
|
Author: {'name': 'Gregory Wlodarek', 'username': 'GWlodarek', 'email': 'gregory.wlodarek@mongodb.com'}Message: (cherry picked from commit df0272716ae3a6767e33adf98392dddea494e587) |
| Comment by Githook User [ 13/Mar/20 ] |
|
Author: {'name': 'Gregory Wlodarek', 'username': 'GWlodarek', 'email': 'gregory.wlodarek@mongodb.com'}Message: (cherry picked from commit 7ce09a820efeceb4f0a3a70140748aaf88309452) |
| Comment by Githook User [ 13/Mar/20 ] |
|
Author: {'name': 'Gregory Wlodarek', 'username': 'GWlodarek', 'email': 'gregory.wlodarek@mongodb.com'}Message: |
| Comment by Githook User [ 13/Mar/20 ] |
|
Author: {'name': 'Gregory Wlodarek', 'username': 'GWlodarek', 'email': 'gregory.wlodarek@mongodb.com'}Message: |