[SERVER-81055] $listSearchIndexes does not throw when used outside of atlas in 7.2 alpha releases Created: 13/Sep/23  Updated: 05/Feb/24  Resolved: 02/Oct/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.1.1, 7.2.0-rc0, 7.0.3

Type: Bug Priority: Major - P3
Reporter: Bailey Pearson Assignee: Ted Tuckman
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
is depended on by CSHARP-4736 Enable Atlas Search Index management ... Blocked
is depended on by PYTHON-3951 [Build Failure] test.test_index_manag... Scheduled
Documented
is documented by DOCS-16413 Investigate changes in SERVER-81055: ... Closed
Related
is related to SERVER-83003 $listSearchIndexes should throw on no... Closed
is related to SERVER-78831 Make $listSearchIndexes throw an Exce... Closed
Backwards Compatibility: Minor Change
Operating System: ALL
Backport Requested:
v7.1, v7.0
Steps To Reproduce:

Execute `db.bar.getSearchIndexes()` against a 7.2 alpha release.

Sprint: QI 2023-10-02, QI 2023-10-16
Participants:

 Description   

https://jira.mongodb.org/browse/SERVER-78831 recently fixed a bug with the $listSearchIndexes aggregation pipeline stage to cause it to throw an error when not connected to an Atlas cluster. Example output from 7.0.1:

>  db.adminCommand({ buildInfo: 1 }).version
7.0.1
> db.bar.getSearchIndexes()
MongoServerError: PlanExecutor error during aggregation :: caused by :: Search index commands are only supported with Atlas.

There appears to be a regression in the 7.2 alpha releases. This fix is no longer present and $listSearchIndexes returns an empty array when executed against a non-Atlas cluster. Example from 7.2.0-alpha-39-g3e9f147:

>  db.adminCommand({buildInfo: 1}).version
7.2.0-alpha-39-g3e9f147
>  db.bar.getSearchIndexes()
[]

 

 



 Comments   
Comment by Boris Dogadov [ 09/Nov/23 ]

Hi ted.tuckman@mongodb.com 
I've tested this in win32-x86_64-enterprise-windows-7.0.3, locally:

{{$listSearchIndexes }}now throws non existing collections, but only when the database already contains or contained another collection.
Does not throw on newly created databases for non existing collection.

Comment by Steve Silvester [ 03/Oct/23 ]

Is there a new issue we can track?  For the record the docs still say: "This command can only be run on a deployment hosted on MongoDB Atlas, and requires an Atlas cluster tier of at least M10."  https://www.mongodb.com/docs/manual/reference/operator/aggregation/listSearchIndexes/

Comment by Steve Silvester [ 03/Oct/23 ]

7.0.2 appears to also have the incorrect behavior:  https://spruce.mongodb.com/task/mongo_python_driver_tests_python_version_rhel8_test_ssl__platform~rhel8_auth_ssl~auth_ssl_python_version~3.10_coverage~coverage_test_7.0_replica_set_42d87e2c9c65232941257539091b7a0b185444d7_23_10_03_17_29_04?execution=0&sortBy=STATUS&sortDir=ASC

Comment by Steve Silvester [ 03/Oct/23 ]

We're also still seeing this error as of v7.2.0-alpha-498-ge335d91 in the Python Driver

Generated at Thu Feb 08 06:45:20 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.