[SERVER-44978] Make ReadThroughCache support asynchronous loading Created: 06/Dec/19 Updated: 29/Oct/23 Resolved: 04/Mar/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Sharding |
| Affects Version/s: | None |
| Fix Version/s: | 4.3.5 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Kevin Pulo | Assignee: | Kaloian Manassiev |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | PM-1645-Milestone-2 | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||||||||||||||
| Sprint: | Sharding 2020-03-09 | ||||||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||||||
| Description |
|
As part of this change the ReadThroughCache should be made to perform the loading asynchronously, on a separate thread rather than doing it inline on the thread of the caller to acquire. The asynchronous implementation should add the following methods to the API:
If an invalidate is called for a key, which is being concurrently loaded, it is acceptable to interrupt the loading of the key if it is currently in progress, but the acquire should not fail. |
| Comments |
| Comment by Githook User [ 03/Mar/20 ] |
|
Author: {'name': 'Kaloian Manassiev', 'username': 'kaloianm', 'email': 'kaloian.manassiev@mongodb.com'}Message: |
| Comment by Githook User [ 27/Feb/20 ] |
|
Author: {'username': 'kaloianm', 'name': 'Kaloian Manassiev', 'email': 'kaloian.manassiev@mongodb.com'}Message: The "cache generation" concept is something specific to the |
| Comment by Githook User [ 26/Feb/20 ] |
|
Author: {'username': 'kaloianm', 'name': 'Kaloian Manassiev', 'email': 'kaloian.manassiev@mongodb.com'}Message: |
| Comment by Githook User [ 15/Feb/20 ] |
|
Author: {'name': 'Kaloian Manassiev', 'username': 'kaloianm', 'email': 'kaloian.manassiev@mongodb.com'}Message: There are no functional changes to this CR, it just instantiates every |
| Comment by Githook User [ 15/Feb/20 ] |
|
Author: {'username': 'kaloianm', 'name': 'Kaloian Manassiev', 'email': 'kaloian.manassiev@mongodb.com'}Message: |
| Comment by Kevin Pulo [ 17/Dec/19 ] |
|
An additional issue is that if this is done, and the maxTimeMs of the CRUD ops coming in is too short for the (inline) lookup() to succeed, then the cache could be starved. (At the moment, the cache will be populated, and the user CRUD op will then timeout immediately on starting.) So it might also be necessary to make the lookup()s occur in a separate thread. |