[SERVER-59657] Add ErrorExtraInfo for the WriteConflictException and use in transaction_participant.cpp updateSessionEntry() Created: 27/Aug/21  Updated: 29/Oct/23  Resolved: 14/Nov/21

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

Type: Task Priority: Major - P3
Reporter: Andrew Shuvalov (Inactive) Assignee: Andrew Shuvalov (Inactive)
Resolution: Fixed Votes: 0
Labels: sharding-nyc-subteam2, sharding-wfbf-day
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Gantt Dependency
Related
related to SERVER-60976 extend WriteConflictException constru... Closed
Backwards Compatibility: Fully Compatible
Sprint: Sharding 2021-11-01, Sharding 2021-11-15, Sharding 2021-11-29
Participants:
Linked BF Score: 19

 Description   

The WriteConflict error is not informative.

In particular, preparing transactions in the test while refreshing sessions with logical_session_cache_replication_1sec_refresh_jscore_passthrough throws an exception:

assert: command failed: {
[js_test:commit_prepared_transaction_errors] 	"errorLabels" : [
[js_test:commit_prepared_transaction_errors] 		"TransientTransactionError"
[js_test:commit_prepared_transaction_errors] 	],
[js_test:commit_prepared_transaction_errors] 	"ok" : 0,
[js_test:commit_prepared_transaction_errors] 	"errmsg" : "WriteConflict error: this operation conflicted with another operation. Please retry your operation or multi-document transaction.",
[js_test:commit_prepared_transaction_errors] 	"code" : 112,
[js_test:commit_prepared_transaction_errors] 	"codeName" : "WriteConflict",
[js_test:commit_prepared_transaction_errors] 	"$clusterTime" : {
[js_test:commit_prepared_transaction_errors] 		"clusterTime" : Timestamp(1623840426, 4),
[js_test:commit_prepared_transaction_errors] 		"signature" : {
[js_test:commit_prepared_transaction_errors] 			"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
[js_test:commit_prepared_transaction_errors] 			"keyId" : NumberLong(0)
[js_test:commit_prepared_transaction_errors] 		}
[js_test:commit_prepared_transaction_errors] 	},
[js_test:commit_prepared_transaction_errors] 	"operationTime" : Timestamp(1623840426, 4)
[js_test:commit_prepared_transaction_errors] }

was this code thrown from the updateSessionEntry() and if yes, why?

Design WriteConflictExceptionExtraInfo to find out.



 Comments   
Comment by Githook User [ 12/Nov/21 ]

Author:

{'name': 'Andrew Shuvalov', 'email': 'andrew.shuvalov@mongodb.com', 'username': 'shuvalov-mdb'}

Message: SERVER-59657 Annotate some of the WriteConflictExceptions
Branch: master
https://github.com/mongodb/mongo/commit/c27c77c1dd7a50aff15d898016fd73899ed79b5a

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