Skip to content

Conversation

@kevinAlbs
Copy link
Collaborator

@kevinAlbs kevinAlbs commented Nov 8, 2023

Summary

Do not apply readConcern or writeConcern to search index commands

Tests verified with this patch: https://spruce.mongodb.com/version/654b89333e8e86f7a940c6e3

Background & Motivation

This is a follow-up to #986

Search index commands return an error if readConcern or writeConcern is included.

Prior to the fix, applying a non-default readConcern or writeConcern to the mongocxx::collection, mongocxx::database, or mongocxx::client resulted in the readConcern or writeConcern being included in the search index command.

Prior to the fix, the added test "create and list search indexes with non-default readConcern and writeConcern" fails when run against an Atlas cluster:

/Users/kevin.albertson/code/tasks/mongo-cxx-driver-CXX-2697/src/mongocxx/test/search_index_view.cpp:246: FAILED:
  REQUIRE( siv.create_one(name, definition.view()) == "test-search-index-case6" )
due to unexpected exception with message:
  Command does not support writeConcern: generic server error

These changes are intended to be included in 3.9.0. The API added in #986 has not yet been released. The error may give a poor user experience.

The new tests are specified in mongodb/specifications#1474.

Apply the default read and write concern. The default read and write concern is not
sent in the outgoing command.
@kevinAlbs kevinAlbs changed the title CXX-2697 apply default read/write concerns to Search Index operations CXX-2697 do not apply readConcern or writeConcern to search index commands Nov 8, 2023
@kevinAlbs kevinAlbs marked this pull request as ready for review November 8, 2023 13:36
@kevinAlbs kevinAlbs requested a review from kkloberdanz November 8, 2023 13:36
Copy link
Contributor

@kkloberdanz kkloberdanz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@kevinAlbs kevinAlbs changed the title CXX-2697 do not apply readConcern or writeConcern to search index commands CXX-2785 do not apply readConcern or writeConcern to search index commands Nov 8, 2023
@kevinAlbs kevinAlbs merged commit 8dcc51f into mongodb:master Nov 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants