[SERVER-37621] Move logging in transaction command bodies to after checking that the command was sent with session info Created: 12/Oct/18  Updated: 29/Oct/23  Resolved: 15/Oct/18

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 4.1.5

Type: Bug Priority: Major - P3
Reporter: Esha Maharishi (Inactive) Assignee: Esha Maharishi (Inactive)
Resolution: Fixed Votes: 0
Labels: ShardedTxn:DistributedCommit
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-37615 Assert that txnNum and lsid are initi... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Sharding 2018-10-22
Participants:

 Description   

Because the log lines assume the OperationContext has txnNumber and lsid set.



 Comments   
Comment by Esha Maharishi (Inactive) [ 24/Oct/18 ]

Filed SERVER-37732 and put it into code review.

Comment by William Schultz (Inactive) [ 24/Oct/18 ]

Thanks. The messages currently appear for both commitTransaction and abortTransaction.

Comment by Esha Maharishi (Inactive) [ 24/Oct/18 ]

Eh, actually I will just remove "participant shard" from the line for now.

Comment by Esha Maharishi (Inactive) [ 24/Oct/18 ]

william.schultz, you are right, the "participant shard" phrase is a bit misleading, because it makes it sound like the transaction was a cross-shard transaction.

Before logging the line, the server could check if the participant believes the transaction was a cross-shard transaction or not by checking if the TransactionParticipant has a coordinatorId.

I'll link this ticket to SERVER-36839 and add that check once the TransactionParticipant stores the coordinatorId.

Comment by William Schultz (Inactive) [ 24/Oct/18 ]

esha.maharishi During local testing I noticed these log messages that seem sharding specific but are printed even if we are not running as a shard server i.e. a plain replica set. These messages are at a high logging level but they're a bit confusing if we're not running a sharded cluster. 

Comment by Githook User [ 12/Oct/18 ]

Author:

{'name': 'Esha Maharishi', 'email': 'esha.maharishi@mongodb.com', 'username': 'EshaMaharishi'}

Message: SERVER-37621 Move logging in transaction command bodies to after checking that the command was sent with session info
Branch: master
https://github.com/mongodb/mongo/commit/89b1e783fa3d5aac034b5af51ef6c1732bef5310

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