[SERVER-24703] DBClientWithCommands::ensureIndex() doesn't report errors Created: 21/Jun/16  Updated: 19/Jul/16  Resolved: 27/Jun/16

Status: Closed
Project: Core Server
Component/s: Index Maintenance, Write Ops
Affects Version/s: None
Fix Version/s: 3.3.10

Type: Bug Priority: Major - P3
Reporter: Spencer Brody (Inactive) Assignee: J Rassi
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 Description   

Observed while writing a unit test for SERVER-23096. You can call DBDirectClient::ensureIndex() twice with the same keys, but once passing true for 'unique' and once passing false, and both calls to ensureIndex() return success.

When running the createIndexes command it correctly errors with an IndexOptionsConflict error.



 Comments   
Comment by Githook User [ 27/Jun/16 ]

Author:

{u'username': u'jrassi', u'name': u'J. Rassi', u'email': u'rassi@10gen.com'}

Message: SERVER-24703 Improve usage comment for BSONField
Branch: master
https://github.com/mongodb/mongo/commit/130a4ae963b8f8e53a91c2904c98c6795b2910e5

Comment by Githook User [ 27/Jun/16 ]

Author:

{u'username': u'jrassi', u'name': u'J. Rassi', u'email': u'rassi@10gen.com'}

Message: SERVER-24703 Improved DBClientWithCommands index creation method

C++ driver SHAs cherry-picked (with modifications) into this commit:

d67f5b5
Branch: master
https://github.com/mongodb/mongo/commit/cd9cef182e0e9046df6233380350c5009278f8aa

Comment by J Rassi [ 22/Jun/16 ]

This is indeed a separate issue from SERVER-769. SERVER-769 describes an issue where the createIndexes command does not reject invalid options. This ticket is about the server's client driver failing to check whether or not attempting to create an index was successful.

I can confirm that the there is a caller of DBClientWithCommands::ensureIndex() from benchRun, and that all other callers are in test code. This does not seem worth backporting, to me.

This issue was fixed in the legacy C++ driver by CXX-189. Assigning to self to cross-port the CXX-189 work to the server repo.

Generated at Thu Feb 08 04:07:10 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.