[SERVER-73229] Logical sessions cache refresh ignores write errors from updating session document, leading to cursors being killed early Created: 23/Jan/23  Updated: 17/Dec/23  Resolved: 14/Apr/23

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 4.4.0, 5.0.0, 6.0.0, 6.2.0-rc6
Fix Version/s: 7.0.0-rc0, 4.4.20, 6.0.6, 5.0.17, 6.3.1

Type: Bug Priority: Major - P3
Reporter: Max Hirschhorn Assignee: Abdul Qadeer
Resolution: Fixed Votes: 1
Labels: sharding-nyc-subteam1
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Problem/Incident
is caused by SERVER-42508 Convert SessionsCollection to throw i... Closed
Related
is related to SERVER-47477 Sharded logical sessions cache refres... Closed
Assigned Teams:
Sharding NYC
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v6.3, v6.2, v6.0, v5.0, v4.4
Sprint: Sharding NYC 2023-04-03, Sharding NYC 2023-04-17
Participants:
Case:
Story Points: 2

 Description   

The changes from 46ab40a as part of SERVER-42508 removed the usage of BatchedCommandResponse::toStatus() and left only the usage of getStatusFromCommandResult(). These behaviors aren't equivalent because it means write errors are silently ignored by the LogicalSessionCacheRefresh background job. This leads the LogicalSessionCacheRefresh background job to call killCursorsWithMatchingSessions() and kill cursors which don't have documents in the config.system.sessions collection despite flushing the cache to disk not persisting at least some of the documents to the config.system.sessions collection.

The intended behavior would be for refreshSessions() to thrown an exception and skip calling killCursorsWithMatchingSessions() in that round of the LogicalSessionCacheRefresh background job.



 Comments   
Comment by Githook User [ 13/Apr/23 ]

Author:

{'name': 'Abdul Qadeer', 'email': 'abdul.qadeer@mongodb.com', 'username': 'zorro786'}

Message: SERVER-73229 Throw on write errors in session refresh

(cherry picked from commit 447b425584090e2d11ad11bbd01ecb12c37294f4)
Branch: v6.3
https://github.com/mongodb/mongo/commit/4b14812141b571f7550c7b4b8a7850b2b8c0308e

Comment by Githook User [ 04/Apr/23 ]

Author:

{'name': 'Abdul Qadeer', 'email': 'abdul.qadeer@mongodb.com', 'username': 'zorro786'}

Message: SERVER-73229 Throw on write errors in session refresh

(cherry picked from commit 447b425584090e2d11ad11bbd01ecb12c37294f4)
Branch: v6.0
https://github.com/mongodb/mongo/commit/9ce94ebc82b7bdb87033921e6461cc58027dcb4a

Comment by Githook User [ 04/Apr/23 ]

Author:

{'name': 'Abdul Qadeer', 'email': 'abdul.qadeer@mongodb.com', 'username': 'zorro786'}

Message: SERVER-73229 Throw on write errors in session refresh

(cherry picked from commit 447b425584090e2d11ad11bbd01ecb12c37294f4)
Branch: v5.0
https://github.com/mongodb/mongo/commit/1092edf1cc78103bf9e90cbb2fec24d167dcbae1

Comment by Githook User [ 04/Apr/23 ]

Author:

{'name': 'Abdul Qadeer', 'email': 'abdul.qadeer@mongodb.com', 'username': 'zorro786'}

Message: SERVER-73229 Throw on write errors in session refresh

(cherry picked from commit 447b425584090e2d11ad11bbd01ecb12c37294f4)
Branch: v4.4
https://github.com/mongodb/mongo/commit/5b82316e5017ff76646fd12878079620f9ad4be7

Comment by Githook User [ 31/Mar/23 ]

Author:

{'name': 'Abdul Qadeer', 'email': 'abdul.qadeer@mongodb.com', 'username': 'zorro786'}

Message: SERVER-73229 Throw on write errors in session refresh
Branch: master
https://github.com/mongodb/mongo/commit/447b425584090e2d11ad11bbd01ecb12c37294f4

Generated at Thu Feb 08 06:24:03 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.