[SERVER-81312] cannot import collection with hidden index Created: 21/Sep/23  Updated: 29/Oct/23  Resolved: 26/Sep/23

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

Type: Bug Priority: Critical - P2
Reporter: Eric Milkie Assignee: Gregory Wlodarek
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Assigned Teams:
Storage Execution
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v7.1, v7.0
Steps To Reproduce:

1. Make a collection with a hidden secondary index
2. Run exportCollection on the collection
3. Attempt to re-import that collection with importCollection (drop existing collection first)
4. Expected behavior: success Actual behavior: command returns error detailed in the Description.

Sprint: Execution NAMR Team 2023-10-02
Participants:

 Description   

Running the importCollection command with a collection with a hidden index results in an error from the validation code:

Validated index spec { v: 2, hidden: true, key: { xxx: 1 }, name: "xxx_1" } does not match original { v: 2, key: { xxx: 1 }, name: "xxx_1", hidden: true })

This is apparently because we are using woCompare in the validate logic here:
https://github.com/10gen/mongo-enterprise-modules/blob/master/src/live_import/import_collection.cpp#L272
but I'm not sure why the order of the fields is changing after prepareSpecForCreate().


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