[SERVER-56787] Move the uuid and empty fields of create sharded collection logging to the end event Created: 10/May/21  Updated: 29/Oct/23  Resolved: 13/May/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.0.0-rc0

Type: Improvement Priority: Major - P3
Reporter: Marcos José Grillo Ramirez Assignee: Marcos José Grillo Ramirez
Resolution: Fixed Votes: 0
Labels: PM-1965-Cleanup
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Sprint: Sharding EMEA 2021-05-17
Participants:

 Description   

When creating a sharded collection there are two events being reported:

  • shardCollection.start with the shardKey, uuid, a flag to check if the collection is empty and the shardId
  • shardCollection.end with two parameters: number of chunks created and the collection version

The uuid and the empty flag can only be determined after the _createCollectionAndIndexes step is executed, because we can check if the collection is empty after taking the critical section, and if there was no collection, that's the point where the uuid is created. If we move both parameters to the shardCollection.end event, then we can move the logging to the beginning kCommit phase (or maybe even to the kCheck phase). However, right now we don't know if this logging is being used, so, before doing the change we should do a quick check who's possibly using it.



 Comments   
Comment by Marcos José Grillo Ramirez [ 13/May/21 ]

Previously in the presence of stepdowns there were no guarantees regarding shardCollection.start or shardCollection.end. Now the guarantee is the following:

  • There will be at least one pair of (shardCollection.start, shardCollection.end) events after a successful shardCollection execution.

Additionally:

  • The uuid and the collectionIsEmpty flags are being moved from the start to the end event.
  • The collectionIsEmpty and numChunks are now optional, they'll be reported only when the event comes from a primary that haven't stepped down during the command execution.
Comment by Githook User [ 13/May/21 ]

Author:

{'name': 'Marcos José Grillo Ramirez', 'email': 'marcos.grillo@mongodb.com', 'username': 'm4nti5'}

Message: SERVER-56787 Move the uuid and empty fields of create sharded collection logging to the end event
Branch: master
https://github.com/mongodb/mongo/commit/d9fbcf0e3985dc751a259c2e8ca4713283b22aba

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