[SERVER-56937] upgradeSet() in multi_rs.js may lose authentication state while upgrading primary Created: 13/May/21  Updated: 29/Oct/23  Resolved: 14/May/21

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: None
Fix Version/s: 4.0.25, 4.2.15, 4.4.7, 5.0.0-rc0

Type: Bug Priority: Major - P3
Reporter: Max Hirschhorn Assignee: Max Hirschhorn
Resolution: Fixed Votes: 0
Labels: sharding-wfbf-day
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Related
is related to SERVER-52955 KeysCollectionClientDirect should che... Closed
is related to SERVER-53812 replsettest.awaitReplication does not... Closed
is related to SERVER-53029 Port the changes for SERVER-52955 to ... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.4, v4.2, v4.0
Sprint: Sharding 2021-05-17
Participants:
Linked BF Score: 20

 Description   

jstests/multiVersion/libs/multi_rs.js has two distinct issues around authentication:

  1. ReplSetTest.prototype.reconnect() replaces the connection in the nodes array with a new connection. Any non-function properties on the original connection object are copied over to the new connection object. This includes the '_defaultSession' property which is a DriverSession object bound to the original connection object and leads to commands being sent through the original connection object despite methods being called on DB objects from the new connection object.
  2. ReplSetTest.prototype.upgradePrimary() calls waitForState() which internally uses asCluster() on the current primary or first node in the replica set and will run the logout command. This has been addressed on more recent branches via SERVER-53812 by having asCluster() not call authutil.asCluster() when the connection is already authenticated.


 Comments   
Comment by Githook User [ 15/May/21 ]

Author:

{'name': 'Max Hirschhorn', 'email': 'max.hirschhorn@mongodb.com', 'username': 'visemet'}

Message: SERVER-56937 Restore authentication state before upgrading primary.

(cherry picked from commit 1ab98f5e384deca4eddacbfed26cc05e2c5e72d1)
Branch: v4.0
https://github.com/mongodb/mongo/commit/38257810d14f182540d3d9cfd06bb73881b0632d

Comment by Githook User [ 14/May/21 ]

Author:

{'name': 'Max Hirschhorn', 'email': 'max.hirschhorn@mongodb.com', 'username': 'visemet'}

Message: SERVER-56937 Restore authentication state before upgrading primary.

(cherry picked from commit 1ab98f5e384deca4eddacbfed26cc05e2c5e72d1)
Branch: v4.4
https://github.com/mongodb/mongo/commit/9049b34155ee36106ae8987adc041c20afd4f358

Comment by Githook User [ 14/May/21 ]

Author:

{'name': 'Max Hirschhorn', 'email': 'max.hirschhorn@mongodb.com', 'username': 'visemet'}

Message: SERVER-56937 Restore authentication state before upgrading primary.

(cherry picked from commit 1ab98f5e384deca4eddacbfed26cc05e2c5e72d1)
Branch: v4.2
https://github.com/mongodb/mongo/commit/99b2782aa296596714c348bd7b7efae21b76af68

Comment by Githook User [ 14/May/21 ]

Author:

{'name': 'Max Hirschhorn', 'email': 'max.hirschhorn@mongodb.com', 'username': 'visemet'}

Message: SERVER-56937 Restore authentication state before upgrading primary.
Branch: master
https://github.com/mongodb/mongo/commit/1ab98f5e384deca4eddacbfed26cc05e2c5e72d1

Generated at Thu Feb 08 05:40:34 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.