[SERVER-55382] Ignore error from retryable write being converted to transaction and that transaction failing in random_moveChunk_update_shard_key.js Created: 20/Mar/21  Updated: 29/Oct/23  Resolved: 08/Nov/21

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 5.2.0, 4.4.11, 5.0.5, 5.1.1

Type: Task Priority: Major - P3
Reporter: Max Hirschhorn Assignee: Luis Osta (Inactive)
Resolution: Fixed Votes: 0
Labels: sharding-nyc-subteam1, sharding-wfbf-day
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Backwards Compatibility: Fully Compatible
Backport Requested:
v5.1, v5.0, v4.4
Sprint: Sharding 2021-11-15
Participants:
Linked BF Score: 23
Story Points: 1

 Description   

The $config.data.isUpdateShardKeyErrorAcceptable() function in the random_moveChunk_update_shard_key.js FSM workload is meant to swallow this error. However, it currently only ignores that error accompanied by a NoSuchTransaction code when running in the stepdown suites. We should move ErrorCodes.NoSuchTransaction into the skippableErrors array to reflect the server's new behavior.

const otherErrorsInChangeShardKeyMsg = "was converted into a distributed transaction";
...
// Some return paths will strip out the TransientTransactionError label. We want to still
// filter out those errors.
let skippableErrors = [
    ErrorCodes.StaleConfig,
    ErrorCodes.WriteConflict,
    ErrorCodes.LockTimeout,
    ErrorCodes.PreparedTransactionInProgress,
    ErrorCodes.ShardInvalidatedForTargeting
];
 
// If we're running in a stepdown suite, then attempting to update the shard key may
// interact with stepdowns and transactions to cause the following errors. We only expect
// these errors in stepdown suites and not in other suites, so we surface them to the test
// runner in other scenarios.
const stepdownErrors =
    [ErrorCodes.NoSuchTransaction, ErrorCodes.ConflictingOperationInProgress];
 
if (this.runningWithStepdowns) {
    skippableErrors.push(...stepdownErrors);
}
 
// Failed in the document shard key path, but not with a duplicate key error
if (errMsg.includes(otherErrorsInChangeShardKeyMsg)) {
    return skippableErrors.includes(errCode);
}



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

Author:

{'name': 'Luis Osta', 'email': 'luis.osta@mongodb.com', 'username': 'LuisOsta'}

Message: SERVER-55382 Move NoSuchTransaction error to skippableErrors

(cherry picked from commit 801a0f84afb7f22c91f93e1a67463181a8e032b9)
Branch: v4.4
https://github.com/mongodb/mongo/commit/61b69938264acd046f0cd9ad2d21a19556497d3f

Comment by Githook User [ 09/Nov/21 ]

Author:

{'name': 'Luis Osta', 'email': 'luis.osta@mongodb.com', 'username': 'LuisOsta'}

Message: SERVER-55382 Move NoSuchTransaction error to skippableErrors

(cherry picked from commit 801a0f84afb7f22c91f93e1a67463181a8e032b9)
Branch: v5.1
https://github.com/mongodb/mongo/commit/6f4bfea2772b42ac8c344a74d4292044c907fcfe

Comment by Githook User [ 09/Nov/21 ]

Author:

{'name': 'Luis Osta', 'email': 'luis.osta@mongodb.com', 'username': 'LuisOsta'}

Message: SERVER-55382 Move NoSuchTransaction error to skippableErrors

(cherry picked from commit 801a0f84afb7f22c91f93e1a67463181a8e032b9)
Branch: v5.0
https://github.com/mongodb/mongo/commit/4259736c4a0c05d3967fa52051e6c07db16ee84c

Comment by Githook User [ 08/Nov/21 ]

Author:

{'name': 'Luis Osta', 'email': 'luis.osta@mongodb.com', 'username': 'LuisOsta'}

Message: SERVER-55382 Move NoSuchTransaction error to skippableErrors
Branch: master
https://github.com/mongodb/mongo/commit/801a0f84afb7f22c91f93e1a67463181a8e032b9

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