[CDRIVER-3405] Creating a change stream after retryable error fails even with retryReads=true Created: 21/Oct/19  Updated: 28/Oct/23  Resolved: 05/Nov/19

Status: Closed
Project: C Driver
Component/s: None
Affects Version/s: 1.15.1
Fix Version/s: 1.15.2

Type: Bug Priority: Major - P3
Reporter: Patrick Freed Assignee: Clyde Bazile III (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by CXX-1876 Assert "watch" retryable reads tests ... Backlog
Problem/Incident

 Description   

When implementing the retryable read spec tests for the Swift driver, we were unable to pass the "client.watch succeeds on second attempt" case, which tests that watch will succeed if the underlying aggregate fails once.

I tried a basic replication of this in C to confirm this was a libmongoc issue not a Swift one:

    mongoc_change_stream_t *stream = mongoc_client_watch(client, bson_new(), NULL);
    bson_error_t error;
    if (mongoc_change_stream_error_document(stream, &error, NULL)) {
        printf("%s\n", error.message);
    }

with the following failPoint (same as the spec test)

{
    configureFailPoint: "failCommand",
    mode: {
        times: 1
    },
    data: {
        failCommands: [
            "aggregate"
        ],
        closeConnection: true
    }
}

and it prints:

"Failed to send "aggregate" command with database "test": Failed to read 4 bytes: socket error or timeout"

which is the same error we see in swift.



 Comments   
Comment by Githook User [ 05/Nov/19 ]

Author:

{'name': 'Clyde Bazile', 'username': 'bazile-clyde', 'email': 'bazileclyde@gmail.com'}

Message: CDRIVER-3405 change stream after retryable error fails
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/6bfa23281fc70266b8ebbc6ed809129a80965e04

Generated at Wed Feb 07 21:17:56 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.