[SERVER-24033] createIndexes command should write the spec of the index as created to the oplog Created: 03/May/16  Updated: 06/Dec/16  Resolved: 16/Sep/16

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: None
Fix Version/s: 3.3.14

Type: Bug Priority: Critical - P2
Reporter: Andy Schwerin Assignee: Max Hirschhorn
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
related to SERVER-24032 When processing createIndexes (on V2 ... Closed
related to SERVER-769 Validate top-level & index spec field... Closed
Backwards Compatibility: Minor Change
Operating System: ALL
Sprint: Query 2016-09-19
Participants:
Linked BF Score: 0

 Description   

Currently, the createIndexes code passes the requested index specification to the operation observer instead of the specification of the index as built. If the primary of the replica set made choices based on defaults, it needs to make those choices explicit in the spec it passes to secondaries so that they build the same index, in the presence of mixed-version replica sets.



 Comments   
Comment by Githook User [ 16/Sep/16 ]

Author:

{u'username': u'visemet', u'name': u'Max Hirschhorn', u'email': u'max.hirschhorn@mongodb.com'}

Message: SERVER-24033 Handle error with "compact" on ephemeral storage engines.
Branch: master
https://github.com/mongodb/mongo/commit/2c15ad73fb47d7697e05fb2b7972021b87a56452

Comment by Max Hirschhorn [ 15/Sep/16 ]

Re-opening to address a test failure when running index_version_autoupgrade.js on an ephemeral storage engine because it doesn't support the "compact" command.

Comment by Max Hirschhorn [ 15/Sep/16 ]

The changes required for this ticket became tied up with how the "collation" field was being injected into the index specification. The only pieces that are actually relevant to backport to the 3.2 branch (should we decide to go through with it) are making MultiIndexBlock::init() return the index specifications that were actually created and updating the call to OpObserver::onCreateIndex() in create_indexes.cpp.

Comment by Githook User [ 15/Sep/16 ]

Author:

{u'username': u'visemet', u'name': u'Max Hirschhorn', u'email': u'max.hirschhorn@mongodb.com'}

Message: SERVER-24033 Write full index spec in oplog entry for index creation.

This ensures that the index version (aka the "v" field) is always
present in the oplog entry when creating indexes on a 3.4 primary.
We can therefore assume that if the "v" field isn't present in the
corresponding oplog entry, then a v=1 index should be built.

Changes MultiBlockIndex::init() to return the index specifications
that were actually created.

The "repairDatabase", "compact", "copydb", and "cloneCollection"
commands no longer automatically upgrade the index version to the
current default version. Instead, the only command that does so is
the "reIndex" command.
Branch: master
https://github.com/mongodb/mongo/commit/8302d0735b34a16cac000e5e345722487536e5bc

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