[SERVER-84560] collMod output should be compatible with replica-set when called against unsplittable collections Created: 04/Jan/24  Updated: 07/Feb/24

Status: In Progress
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Enrico Golfieri Assignee: David Dominguez Sal
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Catalog and Routing
Operating System: ALL
Sprint: CAR Team 2024-02-19
Participants:

 Description   

Running collmod on a sharded collection returns the following fields:

  • raw
  • ok
  • $clusterTime
  • operationTime

However, In order to guarantee output parity between replicaset and sharded cluster, the collmod coordinator enforces raw + single field output when working on an unsharded collection 

Example:

`
{collMod: "x", index: {keyPattern:

{type: 1}

, expireAfterSeconds: 3600}
`
will return

  • { raw,ok,$clusterTime,operationTime }

    on a sharded cluster for a sharded collection

  • expireAfterSeconds_new,ok,$clusterTime,operationTime in a replica-set 
  • raw, expireAfterSeconds_new,ok,$clusterTime,operationTime  on a unsharded collection in a sharded cluster

Unsplittable collection are now treated as sharded collection, and they are currently missing the *_new *_old fields that guaranteed the parity. 

The goal for the ticket is to reintroduced those fields in case of unsplittable collection. 

Note: You can easily replicate the issue by adding a {createUnsplittableCollection : x } in the setup phase of mongos_unsharded_commands_interface_parity_with_replica_set.js 
 
 


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