[SERVER-62000] Do not generate "unique" field in oplog if collMod "unique" parameter is a no-op Created: 13/Dec/21  Updated: 29/Oct/23  Resolved: 15/Dec/21

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

Type: Bug Priority: Major - P3
Reporter: Benety Goh Assignee: Benety Goh
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Related
is related to SERVER-48047 Do not generate "hidden" field in opl... Closed
is related to SERVER-61980 collMod does not consider unique opti... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.2
Sprint: Execution Team 2021-12-13, Execution Team 2021-12-27
Participants:

 Description   

If we use the collMod "unique" parameter, which currently has to be set to true, on a index that is already unique, the primary still generates the following oplog entry that will cause oplog application on a secondary to fail:

{collMod: 'mycoll', index: {name: 'myidx', unique: false}}

For a no-op "unique" collMod request, we should apply a strategy similar to that implemented in SERVER-48047.

This is follow-up work to SERVER-61980 where we addressed a gap in the no-op "hidden" parameter when "unique" is also provided.

This applies to a flag-guarded feature that is still under development.



 Comments   
Comment by Benety Goh [ 15/Dec/21 ]

Author:

{'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}

Message: SERVER-62000 SERVER-61980 migrate ParsedCollModIndexRequest::indexUnique away from BSONElement
Branch: master
https://github.com/mongodb/mongo/commit/46dff5cfba21cd1692c600a312904afa9cd71e43

(incorrectly committed under SERVER-61980)

Comment by Githook User [ 15/Dec/21 ]

Author:

{'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}

Message: SERVER-62000 rename hidden_index_noop.js to reflect new test cases that do not include hidden indexes
Branch: master
https://github.com/mongodb/mongo/commit/88390273fec728b8b655697cc5d44e369116c6e6

Comment by Githook User [ 15/Dec/21 ]

Author:

{'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}

Message: SERVER-62000 Do not generate "unique" field in oplog if collMod "unique" parameter is a no-op
Branch: master
https://github.com/mongodb/mongo/commit/a4387740aa411d55014e1468ae360a724fe3ead9

Comment by Githook User [ 15/Dec/21 ]

Author:

{'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}

Message: SERVER-62000 minimize BSONElement references in collMod index options parsing
Branch: master
https://github.com/mongodb/mongo/commit/5e5230ee102f10460ff12f3f70a23c1cccc34bef

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