[SERVER-82220] Avoid invariant during assertIsPrimaryShardForDb Created: 16/Oct/23  Updated: 31/Oct/23  Resolved: 26/Oct/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 7.2.0-rc0, 7.0.2, 7.1.0
Fix Version/s: 7.1.1, 7.2.0-rc0, 7.0.4

Type: Bug Priority: Major - P3
Reporter: Tommaso Tocci Assignee: Pol Pinol
Resolution: Fixed Votes: 0
Labels: shardingemea-qw
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Problem/Incident
is caused by SERVER-72869 Push the database metadata from the S... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v7.1, v7.0
Sprint: Sharding EMEA 2023-10-30
Participants:
Linked BF Score: 120
Story Points: 2

 Description   

During assertIsPrimaryShardForDb, it may happen that the node’s cached database info is cleared. Therefore, we must not assume that _dbInfo from the dss is always set:

const auto primaryShardId = scopedDss->_dbInfo->getPrimary();

The goal of this ticket is to guarantee that is safe accessing the node's cached db info in order to check if the node is the db primary node.



 Comments   
Comment by Githook User [ 31/Oct/23 ]

Author:

{'name': 'Pol Pinol Castuera', 'email': 'pol.pinol@mongodb.com', 'username': 'PolPinol'}

Message: SERVER-82220 Avoid invariant during assertIsPrimaryShardForDb

(cherry picked from commit 626e868347d58a9a647a50547533095deed0af96)
Branch: v7.0
https://github.com/mongodb/mongo/commit/c0556d666fc888010c230c392aef1e465249f4ae

Comment by Githook User [ 30/Oct/23 ]

Author:

{'name': 'Pol Pinol Castuera', 'email': 'pol.pinol@mongodb.com', 'username': 'PolPinol'}

Message: SERVER-82220 Avoid invariant during assertIsPrimaryShardForDb

(cherry picked from commit 626e868347d58a9a647a50547533095deed0af96)
Branch: v7.1
https://github.com/mongodb/mongo/commit/59c8c6ca5e7c5480e774176a60e7124b01f29998

Comment by Githook User [ 26/Oct/23 ]

Author:

{'name': 'Pol Pinol Castuera', 'email': 'pol.pinol@mongodb.com', 'username': 'PolPinol'}

Message: SERVER-82220 Avoid invariant during assertIsPrimaryShardForDb
Branch: master
https://github.com/mongodb/mongo/commit/626e868347d58a9a647a50547533095deed0af96

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