[SERVER-21456] Improve closing connection behavior when stepping down from primary Created: 13/Nov/15  Updated: 03/Nov/19  Resolved: 28/Nov/17

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: None
Fix Version/s: 3.6.3, 3.7.1

Type: Improvement Priority: Major - P3
Reporter: Siyuan Zhou Assignee: Siyuan Zhou
Resolution: Done Votes: 0
Labels: bkp, todo_in_code
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Related
related to SERVER-31265 Do not terminate connections on endAl... Closed
related to SERVER-24574 Tag internal connections KeepOpen to ... Closed
related to SERVER-42557 Complete TODO listed in SERVER-21456 Closed
related to SERVER-43512 Complete TODO listed in SERVER-21456 Closed
related to SERVER-44228 Complete TODO listed in SERVER-21456 Closed
related to SERVER-44336 Complete TODO listed in SERVER-21456 Closed
related to SERVER-44386 Complete TODO listed in SERVER-21456 Closed
Backwards Compatibility: Fully Compatible
Backport Requested:
v3.6, v3.4
Sprint: Repl 2017-12-04
Participants:
Linked BF Score: 19

 Description   

There is a race of tagging and closing connections when stepping down. After the connection is established but before it gets tagged, there's a small window where the connection may be closed on stepdown.

We could fix this by having internal connections tagged in other ways than _isMaster for every incoming connections (maybe logical session?), or only hanging up connections that have locked the database / issued any commands, or not hanging up connections at all but instead just returning a stepdown error.



 Comments   
Comment by Githook User [ 12/Jan/18 ]

Author:

{'email': 'siyuan.zhou@mongodb.com', 'name': 'Siyuan Zhou', 'username': 'visualzhou'}

Message: SERVER-21456 Only rely on isMaster to set kKeepOpen tag on transport sessions.

(cherry picked from commit b7c69773419d69237f932ac7cc8b48661f593efe)
Branch: v3.6
https://github.com/mongodb/mongo/commit/5341815b88862c7506500dad9d844a94a82e4a0c

Comment by Githook User [ 28/Nov/17 ]

Author:

{'name': 'Siyuan Zhou', 'username': 'visualzhou', 'email': 'siyuan.zhou@mongodb.com'}

Message: SERVER-21456 Only rely on isMaster to set kKeepOpen tag on transport sessions.
Branch: master
https://github.com/mongodb/mongo/commit/b7c69773419d69237f932ac7cc8b48661f593efe

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