[SERVER-34057] Update onPrimaryTransactionalWrite fail point for multi-statement transactions Created: 21/Mar/18  Updated: 19/Apr/18  Resolved: 19/Apr/18

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

Type: Improvement Priority: Major - P3
Reporter: A. Jesse Jiryu Davis Assignee: Spencer Brody (Inactive)
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-34551 Add failpoint to fail commands with n... Closed
Related
related to SERVER-29606 Implement failpoint to aid testing re... Closed
related to SERVER-34187 FailPoint to hang up on client in abo... Closed
Sprint: Repl 2018-04-23
Participants:

 Description   

For the sake of driver testing, let's make the onPrimaryTransactionalWrite fail point work the same within a multi-statement transaction as it does for retryable writes. It looks like this fail point still works in 3.7 as expected for retryable writes, but we can't currently use it for testing multi-statement transactions because it has no effect for commands that include "autocommit: false"?

Here's some mongoreplay output:

driver sends configureFailPoint and server replies ok: 1
 
21 Mar 18 17:22 -0400 (Connection: 407:1817129560)  command configureFailPoint admin.$cmd Request:{"$clusterTime":{"clusterTime":{"$timestamp":{"t":1521667353,"i":1}},"signature":{"hash":{"$binary":"AAAAAAAAAAAAAAAAAAAAAAAAAAA=","$type":"00"},"keyId":{"$numberLong":"0"}}},"configureFailPoint":"onPrimaryTransactionalWrite","data":{"closeConnection":false,"failBeforeCommitExceptionCode":17},"lsid":{"id":{"$binary":"mekpcqQ5QaKw66XYtFR4bg==","$type":"04"}},"mode":{"times":2}}
 
21 Mar 18 17:22 -0400 (Connection: 407:1817129560) +158µs reply    Response:{"$clusterTime":{"clusterTime":{"$timestamp":{"t":1521667354,"i":2}},"signature":{"hash":{"$binary":"AAAAAAAAAAAAAAAAAAAAAAAAAAA=","$type":"00"},"keyId":{"$numberLong":"0"}}},"ok":1.0,"operationTime":{"$timestamp":{"t":1521667354,"i":2}}}
 
Driver sends an insert with autocommit: false:
 
21 Mar 18 17:22 -0400 (Connection: 406:1131570933)  insert  transaction-tests.$cmd Request:{"$clusterTime":{"clusterTime":{"$timestamp":{"t":1521667354,"i":2}},"signature":{"hash":{"$binary":"AAAAAAAAAAAAAAAAAAAAAAAAAAA=","$type":"00"},"keyId":{"$numberLong":"0"}}},"autocommit":false,"documents":[{"_id":1}],"insert":"test","lsid":{"id":{"$binary":"yXw7GM3+T3mtzKDW6+vsQA==","$type":"04"}},"ordered":true,"readConcern":{"level":"snapshot"},"stmtId":0,"txnNumber":{"$numberLong":"1"}}
 
It succeeds, unexpectedly:
 
21 Mar 18 17:22 -0400 (Connection: 406:1131570933) +332µs reply    Response:{"$clusterTime":{"clusterTime":{"$timestamp":{"t":1521667354,"i":3}},"signature":{"hash":{"$binary":"AAAAAAAAAAAAAAAAAAAAAAAAAAA=","$type":"00"},"keyId":{"$numberLong":"0"}}},"electionId":{"$oid":"7fffffff000000000000000d"},"n":1,"ok":1.0,"opTime":{"t":{"$numberLong":"13"},"ts":{"$timestamp":{"t":1521667354,"i":2}}},"operationTime":{"$timestamp":{"t":1521667354,"i":2}}}



 Comments   
Comment by Spencer Brody (Inactive) [ 19/Apr/18 ]

We will do SERVER-34551 instead

Comment by Spencer Brody (Inactive) [ 02/Apr/18 ]

Same question as I asked on SERVER-34187 - could a test command that hangs up all connections into the server be used to satisfy both use cases?

Comment by A. Jesse Jiryu Davis [ 30/Mar/18 ]

Thanks Shane. Spencer I'm requesting this is reopened, thanks!

Comment by Shane Harvey [ 30/Mar/18 ]

Yes. That's what I had in mind to test.

Comment by A. Jesse Jiryu Davis [ 30/Mar/18 ]

Good point. Why do we need to test network errors — to ensure drivers do not attempt retryable single-statement writes within a transaction?

Comment by Shane Harvey [ 30/Mar/18 ]

jesse, how would we use a duplicate key error to test the behavior of network errors?

Comment by A. Jesse Jiryu Davis [ 27/Mar/18 ]

I think we can use duplicate key errors and write conflicts instead, thanks.

Comment by Spencer Brody (Inactive) [ 27/Mar/18 ]

jesse, how critical is this for you to be able to test your work? Is this blocking your testing?

Comment by A. Jesse Jiryu Davis [ 21/Mar/18 ]

shane.harvey we can't test all error types within transactions yet.

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