spec/spec_tests/data/transactions/error-labels.yml in mongo-2.12.4 vs spec/spec_tests/data/transactions/error-labels.yml in mongo-2.13.0.beta1

- old
+ new

@@ -84,11 +84,11 @@ document: _id: 1 result: # Note, the server will return the errorLabel in this case. errorLabelsContain: ["TransientTransactionError"] - errorLabelsOmit: ["UnknownTransactionCommitResult"] + errorLabelsOmit: ["RetryableWriteError", "UnknownTransactionCommitResult"] - name: abortTransaction object: session0 expectations: - command_started_event: @@ -141,11 +141,11 @@ document: _id: 1 result: # Note, the server will return the errorLabel in this case. errorLabelsContain: ["TransientTransactionError"] - errorLabelsOmit: ["UnknownTransactionCommitResult"] + errorLabelsOmit: ["RetryableWriteError", "UnknownTransactionCommitResult"] - name: abortTransaction object: session0 expectations: - command_started_event: @@ -198,11 +198,11 @@ document: _id: 1 result: # Note, the server will return the errorLabel in this case. errorLabelsContain: ["TransientTransactionError"] - errorLabelsOmit: ["UnknownTransactionCommitResult"] + errorLabelsOmit: ["RetryableWriteError", "UnknownTransactionCommitResult"] - name: abortTransaction object: session0 expectations: - command_started_event: @@ -259,11 +259,11 @@ - name: commitTransaction object: session0 result: # Note, the server will return the errorLabel in this case. errorLabelsContain: ["TransientTransactionError"] - errorLabelsOmit: ["UnknownTransactionCommitResult"] + errorLabelsOmit: ["RetryableWriteError", "UnknownTransactionCommitResult"] expectations: - command_started_event: command: insert: *collection_name @@ -293,11 +293,11 @@ outcome: collection: data: [] - - description: add transient label to connection errors + - description: add TransientTransactionError label to connection errors, but do not add RetryableWriteError label failPoint: configureFailPoint: failCommand mode: { times: 4 } data: @@ -313,11 +313,14 @@ session: session0 document: _id: 1 result: &transient_label_only errorLabelsContain: ["TransientTransactionError"] - errorLabelsOmit: ["UnknownTransactionCommitResult"] + # While a connection error would normally be retryable, these are not because + # they occur within a transaction; ensure the driver does not add the + # RetryableWriteError label to these errors. + errorLabelsOmit: ["RetryableWriteError", "UnknownTransactionCommitResult"] - name: find object: collection arguments: session: session0 result: *transient_label_only @@ -406,11 +409,11 @@ outcome: collection: data: [] - - description: add unknown commit label to connection errors + - description: add RetryableWriteError and UnknownTransactionCommitResult labels to connection errors failPoint: configureFailPoint: failCommand mode: { times: 2 } data: @@ -429,11 +432,11 @@ result: insertedId: 1 - name: commitTransaction object: session0 result: - errorLabelsContain: ["UnknownTransactionCommitResult"] + errorLabelsContain: ["RetryableWriteError", "UnknownTransactionCommitResult"] errorLabelsOmit: ["TransientTransactionError"] - name: commitTransaction object: session0 expectations: @@ -490,18 +493,19 @@ outcome: collection: data: - _id: 1 - - description: add unknown commit label to retryable commit errors + - description: add RetryableWriteError and UnknownTransactionCommitResult labels to retryable commit errors failPoint: configureFailPoint: failCommand mode: { times: 2 } data: failCommands: ["commitTransaction"] - errorCode: 11602 # InterruptedDueToReplStateChange + errorCode: 11602 # InterruptedDueToReplStateChange + errorLabels: ["RetryableWriteError"] operations: - name: startTransaction object: session0 - name: insertOne @@ -513,11 +517,11 @@ result: insertedId: 1 - name: commitTransaction object: session0 result: - errorLabelsContain: ["UnknownTransactionCommitResult"] + errorLabelsContain: ["RetryableWriteError", "UnknownTransactionCommitResult"] errorLabelsOmit: ["TransientTransactionError"] - name: commitTransaction object: session0 expectations: @@ -574,20 +578,21 @@ outcome: collection: data: - _id: 1 - - description: add unknown commit label to writeConcernError ShutdownInProgress + - description: add RetryableWriteError and UnknownTransactionCommitResult labels to writeConcernError ShutdownInProgress failPoint: configureFailPoint: failCommand mode: { times: 2 } data: failCommands: ["commitTransaction"] writeConcernError: code: 91 errmsg: Replication is being shut down + errorLabels: ["RetryableWriteError"] operations: - name: startTransaction object: session0 arguments: @@ -603,11 +608,11 @@ result: insertedId: 1 - name: commitTransaction object: session0 result: - errorLabelsContain: ["UnknownTransactionCommitResult"] + errorLabelsContain: ["RetryableWriteError", "UnknownTransactionCommitResult"] errorLabelsOmit: ["TransientTransactionError"] - name: commitTransaction object: session0 expectations: @@ -666,16 +671,76 @@ outcome: collection: data: - _id: 1 - - description: add unknown commit label to writeConcernError WriteConcernFailed + - description: do not add RetryableWriteError label to writeConcernError ShutdownInProgress that occurs within transaction failPoint: configureFailPoint: failCommand mode: { times: 1 } data: + failCommands: ["insert"] + writeConcernError: + code: 91 + errmsg: Replication is being shut down + + operations: + - name: startTransaction + object: session0 + arguments: + options: + writeConcern: + w: majority + - name: insertOne + object: collection + arguments: + session: session0 + document: + _id: 1 + result: + errorLabelsContain: [] + errorLabelsOmit: ["RetryableWriteError", "TransientTransactionError", "UnknownTransactionCommitResult"] + - name: abortTransaction + object: session0 + + expectations: + - command_started_event: + command: + insert: *collection_name + documents: + - _id: 1 + ordered: true + readConcern: + lsid: session0 + txnNumber: + $numberLong: "1" + startTransaction: true + autocommit: false + command_name: insert + database_name: *database_name + - command_started_event: + command: + abortTransaction: 1 + lsid: session0 + txnNumber: + $numberLong: "1" + startTransaction: + autocommit: false + command_name: abortTransaction + database_name: admin + + outcome: + collection: + data: [] + + - description: add UnknownTransactionCommitResult label to writeConcernError WriteConcernFailed + + failPoint: + configureFailPoint: failCommand + mode: { times: 1 } + data: failCommands: ["commitTransaction"] writeConcernError: code: 64 # WriteConcernFailed without wtimeout errmsg: multiple errors reported @@ -696,11 +761,11 @@ insertedId: 1 - name: commitTransaction object: session0 result: errorLabelsContain: ["UnknownTransactionCommitResult"] - errorLabelsOmit: ["TransientTransactionError"] + errorLabelsOmit: ["RetryableWriteError", "TransientTransactionError"] - name: commitTransaction object: session0 expectations: - command_started_event: @@ -746,11 +811,11 @@ outcome: collection: data: - _id: 1 - - description: add unknown commit label to writeConcernError WriteConcernFailed with wtimeout + - description: add UnknownTransactionCommitResult label to writeConcernError WriteConcernFailed with wtimeout failPoint: configureFailPoint: failCommand mode: { times: 1 } data: @@ -778,11 +843,11 @@ insertedId: 1 - name: commitTransaction object: session0 result: errorLabelsContain: ["UnknownTransactionCommitResult"] - errorLabelsOmit: ["TransientTransactionError"] + errorLabelsOmit: ["RetryableWriteError", "TransientTransactionError"] - name: commitTransaction object: session0 expectations: - command_started_event: @@ -828,11 +893,11 @@ outcome: collection: data: - _id: 1 - - description: omit unknown commit label to writeConcernError UnsatisfiableWriteConcern + - description: omit UnknownTransactionCommitResult label from writeConcernError UnsatisfiableWriteConcern failPoint: configureFailPoint: failCommand mode: { times: 1 } data: @@ -857,11 +922,11 @@ result: insertedId: 1 - name: commitTransaction object: session0 result: - errorLabelsOmit: ["TransientTransactionError", "UnknownTransactionCommitResult"] + errorLabelsOmit: ["RetryableWriteError", "TransientTransactionError", "UnknownTransactionCommitResult"] expectations: - command_started_event: command: insert: *collection_name @@ -893,11 +958,11 @@ outcome: collection: data: - _id: 1 - - description: omit unknown commit label to writeConcernError UnknownReplWriteConcern + - description: omit UnknownTransactionCommitResult label from writeConcernError UnknownReplWriteConcern failPoint: configureFailPoint: failCommand mode: { times: 1 } data: @@ -922,11 +987,11 @@ result: insertedId: 1 - name: commitTransaction object: session0 result: - errorLabelsOmit: ["TransientTransactionError", "UnknownTransactionCommitResult"] + errorLabelsOmit: ["RetryableWriteConcern", "TransientTransactionError", "UnknownTransactionCommitResult"] expectations: - command_started_event: command: insert: *collection_name @@ -957,5 +1022,6 @@ outcome: collection: data: - _id: 1 +