[SERVER-42457] Check if cluster time has been set on TransactionRouter before observing from an external thread Created: 26/Jul/19  Updated: 29/Oct/23  Resolved: 31/Jul/19

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 4.2.1, 4.3.1

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

Issue Links:
Backports
Depends
Gantt Dependency
has to be done before SERVER-40983 Track and log relevant single transac... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.2
Sprint: Sharding 2019-08-12
Participants:
Linked BF Score: 11

 Description   

Background

If we try to check the logical time in the TransactionRouter before the time is set, it will hit an invariant that the logical time isn't set (obviously).

This wasn't previously an issue until a method was introduced that can check the cluster time from an external thread. This happens due to the new method that attempts to abort all transactions on a mongos. This will hit the invariant that the logical time is set, because we try to log the cluster time when we abort (and we're on log level 1 or higher).

Proposed Fix

Create an clusterTimeHasBeenSet function on the TransactionRouter, that we can check explicitly for the path that tries to log the transaction.



 Comments   
Comment by Githook User [ 15/Aug/19 ]

Author:

{'name': 'Blake Oler', 'email': 'blake.oler@mongodb.com', 'username': 'BlakeIsBlake'}

Message: SERVER-42457 Check if atClusterTime has been set on TransactionRouter before observing from an external thread

(cherry picked from commit 381bb2c51c74b82f01b269b0f187d75b9b5c8adc)
Branch: v4.2
https://github.com/mongodb/mongo/commit/e6043509190edd57632e458bdc6c1ff16e32ae66

Comment by Githook User [ 31/Jul/19 ]

Author:

{'name': 'Blake Oler', 'username': 'BlakeIsBlake', 'email': 'blake.oler@mongodb.com'}

Message: SERVER-42457 Check if atClusterTime has been set on TransactionRouter before observing from an external thread
Branch: master
https://github.com/mongodb/mongo/commit/381bb2c51c74b82f01b269b0f187d75b9b5c8adc

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