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-2768 skip search index tests on 7.1 #1639

Merged
merged 2 commits into from
Aug 27, 2024

Conversation

kevinAlbs
Copy link
Contributor

Summary

Follow-up to #1541

Skip search index tests on server 7.1.

Background & Motivation

This PR is intended to fix failing tests in the C driver using server version 7.1.0 (latest available on Ubuntu 18.04). An example failure logs:

expected error to contain "Atlas", but got: "BSON field 'createSearchIndexes.indexes.type' is an unknown field."

The "unknown field" error message appears in server 7.1.0, but not 7.0.9 or 7.2.1:

With 7.0.5:

% mongosh --eval "print(db.version()); db.runCommand({createSearchIndexes: 'coll', indexes: [{definition: { mappings: { dynamic: true } }, type: 'search' }]});"
7.0.5
MongoServerError: Search index commands are only supported with Atlas.

With 7.1.0:

% mongosh --eval "print(db.version()); db.runCommand({createSearchIndexes: 'coll', indexes: [{definition: { mappings: { dynamic: true } }, type: 'search' }]});"
7.1.0
MongoServerError: BSON field 'createSearchIndexes.indexes.type' is an unknown field.

With 7.2.1:

% mongosh --eval "print(db.version()); db.runCommand({createSearchIndexes: 'coll', indexes: [{definition: { mappings: { dynamic: true } }, type: 'search' }]});"
7.2.1
MongoServerError: Search index commands are only supported with Atlas.

I expect this is because SERVER-83107 was backported to 7.0.5 and 7.2.1, but not to a 7.1 version.

Please complete the following before merging:

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

@kevinAlbs kevinAlbs marked this pull request as ready for review August 22, 2024 20:37
@kevinAlbs kevinAlbs requested a review from a team as a code owner August 22, 2024 20:37
@kevinAlbs kevinAlbs requested review from dariakp and NoahStapp and removed request for a team and dariakp August 22, 2024 20:37
@kevinAlbs kevinAlbs merged commit 8be1189 into mongodb:master Aug 27, 2024
4 checks passed
@jmikola
Copy link
Member

jmikola commented Sep 5, 2024

@kevinAlbs: Was this change only necessary because libmongoc is always sending a value for the type option? I'm specifically curious about the change to searchIndexIgnoresReadWriteConcern.yml since the file was never even modified in @NoahStapp's original commit (39db05c).

While restoring the missing spec documentation in #1650, I clarified that the server applies its own defaults for type and name if they're not specified by the driver. I didn't see any reason for a driver to explicitly apply its own default value(s).

@kevinAlbs
Copy link
Contributor Author

@kevinAlbs: Was this change only necessary because libmongoc is always sending a value for the type option?

No, libmongoc is only passing type for tests that specify.

I'm specifically curious about the change to searchIndexIgnoresReadWriteConcern.yml

My mistake. searchIndexIgnoresReadWriteConcern.yml does not specify a type. Submitted #1651 to revert changes to that file.

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.

3 participants