| 1 |
description: mongos-unpin |
| 2 |
|
| 3 |
schemaVersion: '1.4' |
| 4 |
|
| 5 |
runOnRequirements: |
| 6 |
- minServerVersion: '4.2' |
| 7 |
|
| 8 |
maxServerVersion: "7.99" |
| 9 |
topologies: [ sharded-replicaset ] |
| 10 |
|
| 11 |
createEntities: |
| 12 |
- client: |
| 13 |
id: &client0 client0 |
| 14 |
useMultipleMongoses: true |
| 15 |
- database: |
| 16 |
id: &database0 database0 |
| 17 |
client: *client0 |
| 18 |
databaseName: &database0Name mongos-unpin-db |
| 19 |
- collection: |
| 20 |
id: &collection0 collection0 |
| 21 |
database: *database0 |
| 22 |
collectionName: &collection0Name test |
| 23 |
- session: |
| 24 |
id: &session0 session0 |
| 25 |
client: *client0 |
| 26 |
|
| 27 |
initialData: |
| 28 |
- collectionName: *collection0Name |
| 29 |
databaseName: *database0Name |
| 30 |
documents: [] |
| 31 |
|
| 32 |
_yamlAnchors: |
| 33 |
anchors: |
| 34 |
|
| 35 |
&lockTimeoutErrorCode 24 |
| 36 |
|
| 37 |
tests: |
| 38 |
- description: unpin after TransientTransactionError error on commit |
| 39 |
runOnRequirements: |
| 40 |
|
| 41 |
|
| 42 |
- serverless: "forbid" |
| 43 |
operations: |
| 44 |
- &startTransaction |
| 45 |
name: startTransaction |
| 46 |
object: *session0 |
| 47 |
- &insertOne |
| 48 |
name: insertOne |
| 49 |
object: *collection0 |
| 50 |
arguments: |
| 51 |
document: { x: 1 } |
| 52 |
session: *session0 |
| 53 |
- name: targetedFailPoint |
| 54 |
object: testRunner |
| 55 |
arguments: |
| 56 |
session: *session0 |
| 57 |
failPoint: |
| 58 |
configureFailPoint: failCommand |
| 59 |
mode: { times: 1 } |
| 60 |
data: |
| 61 |
failCommands: [ commitTransaction ] |
| 62 |
errorCode: *lockTimeoutErrorCode |
| 63 |
- name: commitTransaction |
| 64 |
object: *session0 |
| 65 |
expectError: |
| 66 |
|
| 67 |
errorCode: *lockTimeoutErrorCode |
| 68 |
errorLabelsContain: [ TransientTransactionError ] |
| 69 |
errorLabelsOmit: [ UnknownTransactionCommitResult ] |
| 70 |
- &assertNoPinnedServer |
| 71 |
name: assertSessionUnpinned |
| 72 |
object: testRunner |
| 73 |
arguments: |
| 74 |
session: *session0 |
| 75 |
|
| 76 |
|
| 77 |
- *startTransaction |
| 78 |
- *insertOne |
| 79 |
- &abortTransaction |
| 80 |
name: abortTransaction |
| 81 |
object: *session0 |
| 82 |
|
| 83 |
- description: unpin on successful abort |
| 84 |
operations: |
| 85 |
- *startTransaction |
| 86 |
- *insertOne |
| 87 |
- *abortTransaction |
| 88 |
- *assertNoPinnedServer |
| 89 |
|
| 90 |
- description: unpin after non-transient error on abort |
| 91 |
runOnRequirements: |
| 92 |
|
| 93 |
|
| 94 |
- serverless: "forbid" |
| 95 |
operations: |
| 96 |
- *startTransaction |
| 97 |
- *insertOne |
| 98 |
- name: targetedFailPoint |
| 99 |
object: testRunner |
| 100 |
arguments: |
| 101 |
session: *session0 |
| 102 |
failPoint: |
| 103 |
configureFailPoint: failCommand |
| 104 |
mode: { times: 1 } |
| 105 |
data: |
| 106 |
failCommands: [ abortTransaction ] |
| 107 |
errorCode: *lockTimeoutErrorCode |
| 108 |
- *abortTransaction |
| 109 |
- *assertNoPinnedServer |
| 110 |
|
| 111 |
|
| 112 |
- *startTransaction |
| 113 |
- *insertOne |
| 114 |
- *abortTransaction |
| 115 |
|
| 116 |
- description: unpin after TransientTransactionError error on abort |
| 117 |
operations: |
| 118 |
- *startTransaction |
| 119 |
- *insertOne |
| 120 |
- name: targetedFailPoint |
| 121 |
object: testRunner |
| 122 |
arguments: |
| 123 |
session: *session0 |
| 124 |
failPoint: |
| 125 |
configureFailPoint: failCommand |
| 126 |
mode: { times: 1 } |
| 127 |
data: |
| 128 |
failCommands: [ abortTransaction ] |
| 129 |
errorCode: 91 |
| 130 |
- *abortTransaction |
| 131 |
- *assertNoPinnedServer |
| 132 |
|
| 133 |
|
| 134 |
- *startTransaction |
| 135 |
- *insertOne |
| 136 |
- *abortTransaction |
| 137 |
|
| 138 |
- description: unpin when a new transaction is started |
| 139 |
operations: |
| 140 |
- *startTransaction |
| 141 |
- *insertOne |
| 142 |
- name: commitTransaction |
| 143 |
object: *session0 |
| 144 |
- &assertPinnedServer |
| 145 |
name: assertSessionPinned |
| 146 |
object: testRunner |
| 147 |
arguments: |
| 148 |
session: *session0 |
| 149 |
- *startTransaction |
| 150 |
- *assertNoPinnedServer |
| 151 |
|
| 152 |
- description: unpin when a non-transaction write operation uses a session |
| 153 |
operations: |
| 154 |
- *startTransaction |
| 155 |
- *insertOne |
| 156 |
- name: commitTransaction |
| 157 |
object: *session0 |
| 158 |
- *assertPinnedServer |
| 159 |
- *insertOne |
| 160 |
- *assertNoPinnedServer |
| 161 |
|
| 162 |
- description: unpin when a non-transaction read operation uses a session |
| 163 |
operations: |
| 164 |
- *startTransaction |
| 165 |
- *insertOne |
| 166 |
- name: commitTransaction |
| 167 |
object: *session0 |
| 168 |
- *assertPinnedServer |
| 169 |
- name: find |
| 170 |
object: *collection0 |
| 171 |
arguments: |
| 172 |
filter: { x: 1 } |
| 173 |
session: *session0 |
| 174 |
- *assertNoPinnedServer |