Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GODRIVER-2489 Return error if createPipelineOptionsDoc() fails #1035

Merged
merged 3 commits into from Aug 1, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions data/change-streams/change-streams-resume-errorLabels.json
Expand Up @@ -1478,6 +1478,11 @@
},
{
"description": "change stream resumes after StaleShardVersion",
"runOnRequirements": [
{
"maxServerVersion": "6.0.99"
}
],
"operations": [
{
"name": "failPoint",
Expand Down
3 changes: 3 additions & 0 deletions data/change-streams/change-streams-resume-errorLabels.yml
Expand Up @@ -743,6 +743,9 @@ tests:
databaseName: *database0

- description: change stream resumes after StaleShardVersion
runOnRequirements:
# StaleShardVersion is obsolete as of 6.1 and is no longer marked as resumable.
- maxServerVersion: "6.0.99"
operations:
- name: failPoint
object: testRunner
Expand Down
3 changes: 3 additions & 0 deletions mongo/change_stream.go
Expand Up @@ -257,6 +257,9 @@ func (cs *ChangeStream) executeOperation(ctx context.Context, resuming bool) err
cs.replaceOptions(cs.wireVersion)

csOptDoc := cs.createPipelineOptionsDoc()
if cs.err != nil {
return cs.Err()
}
pipIdx, pipDoc := bsoncore.AppendDocumentStart(nil)
pipDoc = bsoncore.AppendDocumentElement(pipDoc, "$changeStream", csOptDoc)
if pipDoc, cs.err = bsoncore.AppendDocumentEnd(pipDoc, pipIdx); cs.err != nil {
Expand Down