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

DRIVERS-2761 do not apply readConcern or writeConcern to search index commands #1474

Merged
merged 9 commits into from
Dec 12, 2023

Conversation

kevinAlbs
Copy link
Contributor

Summary

  • Require not applying read and write concern to search index commands.
  • Add unit and integration tests to ensure readConcern and writeConcern is not applied to search index commands.

Tests were run in the C++ driver in this PR: mongodb/mongo-cxx-driver#1055

Background & Motivation

This PR proposes adding tests to ensure each search index command does not include readConcern or writeConcern.

Unit tests apply a non-default readConcern and writeConcern to the collection:

# Set a non-default read and write concern.
uriOptions:
    readConcernLevel: local
    w: 1

Unit tests verify the command started event is checked:

# Expect no writeConcern or readConcern to be sent.
writeConcern: { $$exists: false }
readConcern: { $$exists: false }

The integration test is as an extra precaution to test against a live Atlas instance.

The C++ driver failed unit and integration tests prior to fixes applied in mongodb/mongo-cxx-driver#1055.


Please complete the following before merging:

  • Update changelog.
  • Make sure there are generated JSON files from the YAML test files.
  • Test changes in at least one language driver. Tested in C++
  • Test these changes against all server versions and topologies (including standalone, replica set, sharded clusters, and serverless).

@kevinAlbs kevinAlbs changed the title DRIVERS-2761 DRIVERS-2761 do not apply readConcern or writeConcern to search index commands Nov 8, 2023
@kevinAlbs kevinAlbs requested a review from vbabanin November 8, 2023 13:30
@kevinAlbs kevinAlbs marked this pull request as ready for review November 8, 2023 13:30
@kevinAlbs kevinAlbs requested a review from a team as a code owner November 8, 2023 13:30
@kevinAlbs kevinAlbs requested review from dariakp and removed request for a team November 8, 2023 13:30
@kevinAlbs kevinAlbs removed the request for review from dariakp December 8, 2023 21:08
source/index-management/index-management.rst Outdated Show resolved Hide resolved
Aggregate with $listSearchIndexes accepts a `local` read concern.

Use `majority` to ensure test fails if driver incorrectly applies read concern.
@kevinAlbs kevinAlbs requested a review from vbabanin December 12, 2023 16:53
Copy link
Member

@vbabanin vbabanin left a comment

Choose a reason for hiding this comment

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

LGTM!

@kevinAlbs kevinAlbs merged commit 0b47194 into mongodb:master Dec 12, 2023
4 checks passed
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.

4 participants