[SERVER-31648] isMaster should unset the kPending tag and set the kLatestVersionInternalClientKeepOpen tag in one operation Created: 19/Oct/17  Updated: 30/Oct/23  Resolved: 06/Nov/17

Status: Closed
Project: Core Server
Component/s: Networking
Affects Version/s: None
Fix Version/s: 3.6.0-rc3

Type: Bug Priority: Major - P3
Reporter: Justin Seyster Assignee: Justin Seyster
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
is related to SERVER-31265 Do not terminate connections on endAl... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Query 2017-11-13
Participants:
Linked BF Score: 0

 Description   

Before a 3.6 internal client has issued its initial isMaster command, its SessionHandle is protected from being terminated by the kPending tag. The isMaster command removes the kPending status but (when the client is new enough) adds kLatestVersionInternalClientKeepOpen status, which protects the session from being terminated by a featureCompatibilityVersion upgrade.

However, there is a small window between the unset and the set during which there is nothing to stop a featureCompatibilityVersion upgrade from terminating the session, which is causing failed updates and inserts in the toggle_feature_compatibility.js test.



 Comments   
Comment by Githook User [ 06/Nov/17 ]

Author:

{'name': 'Justin Seyster', 'username': 'jseyster', 'email': 'justin.seyster@mongodb.com'}

Message: SERVER-31648 Perform sets/unsets to session tags atomically.

As described in the SERVER ticket, there is a window in
CmdIsMaster::run() during which there is no flag set to prevent a
session from being closed by an FCV update (even when the session is
one that should stay open through the upgrade). This change closes
that window.

As part of the fix, this change also replaces the replaceTags()
function with functions that can atomically update the session tags.
Branch: master
https://github.com/mongodb/mongo/commit/df03dc67fa491b944dd1e6c366f4a19cf6b38032

Generated at Thu Feb 08 04:27:44 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.