[SERVER-37241] Add testing to verify proper expiration of sessions in the sessions collection Created: 21/Sep/18 Updated: 29/Oct/23 Resolved: 31/Oct/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 3.6.10, 4.0.6, 4.1.5 |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Blake Oler | Assignee: | Blake Oler |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Backwards Compatibility: | Fully Compatible | ||||
| Backport Requested: |
v4.0, v3.6
|
||||
| Sprint: | Sharding 2018-10-22, Sharding 2018-11-05 | ||||
| Participants: | |||||
| Description |
| Comments |
| Comment by Githook User [ 28/Dec/18 ] |
|
Author: {'username': 'BlakeIsBlake', 'email': 'blake.oler@mongodb.com', 'name': 'Blake Oler'}Message: (cherry picked from commit 3caa3c4a4be7b84823f22f481365f58b124d6d00) |
| Comment by Githook User [ 26/Dec/18 ] |
|
Author: {'username': 'BlakeIsBlake', 'email': 'blake.oler@mongodb.com', 'name': 'Blake Oler'}Message: (cherry picked from commit 3caa3c4a4be7b84823f22f481365f58b124d6d00) |
| Comment by Githook User [ 31/Oct/18 ] |
|
Author: {'name': 'Blake Oler', 'email': 'blake.oler@mongodb.com', 'username': 'BlakeIsBlake'}Message: |
| Comment by Misha Tyulenev [ 29/Oct/18 ] |
|
blake.oler i see 2 distinct phases in the refresh: |
| Comment by Blake Oler [ 29/Oct/18 ] |
|
misha.tyulenev I think the new approach might actually be simpler... when working with the sessions collection in isolation, we can dictate exactly what we want the TTL behavior to be. Since expiration from a TTL index can be modeled as a deletion, we can just blanket delete necessary documents to simulate expiration. At any given time, the logical session cache's refresh is relying upon the existence (or non-existence) of documents in the sessions collection. The logical session cache by design can't distinguish between a manual deletion and expiration. It assumes that if a document no longer exists in the collection, it has expired. It wouldn't need to know the difference between expiration and deletion, anyway – manual deletion of sessions records on-disk is undefined behavior to an end user. We're taking advantage of the lack of distinction between deletion and expiration much to our advantage. I foresee this approach being many fewer lines of code than the previous approach, with the added benefit of forgoing the need for server code or parameter changes. |
| Comment by Misha Tyulenev [ 29/Oct/18 ] |
|
blake.oler I agree with the new plan. It's a bit more elaborate than the original because the test must now reimplement part of the TTL index functionality - namely check and remove documents that are "expired" in order to get the logical sessions refresh work as designed. |
| Comment by Misha Tyulenev [ 29/Oct/18 ] |
|
Thank you max.hirschhorn yes looks like this is what's needed. |