[SERVER-78703] Remove check in the analyzeShardKey command that expects number of orphaned documents <= total number of documents Created: 06/Jul/23  Updated: 29/Oct/23  Resolved: 07/Jul/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.1.0-rc0, 7.0.0-rc7

Type: Bug Priority: Major - P3
Reporter: Pierlauro Sciarelli Assignee: Cheahuychou Mao
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Assigned Teams:
Sharding NYC
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v7.0
Sprint: Sharding NYC 2023-07-10
Participants:
Linked BF Score: 135

 Description   

This assertion checks that the number of orphaned documents for a collection is always at most equal to the total number of documents in the collection itself.

The assertion must be removed because it is transiently allowed for the tracked number of orphaned docs to be greater than the number of documents actually contained in the collection. The reason behind that is that the number of orphaned documents is not decremented during a range deletion but only when it finishes.

Example:

  1. Collection has 1K documents in total, all belonging to a single chunk being migrated off (numOrphans = 0, numDocs=1K)
  2. Migration ends (numOrphans = 1K, numDocs=1K)
  3. Range deletion starts (numOrphans = 1K, numDocs=1K)
  4. Range deletion is ongoing, half orphans were deleted (numOrphans = 1K, numDocs=500)
  5. Range deletion ends (numOrphans = 0, numDocs=0)


 Comments   
Comment by Githook User [ 08/Jul/23 ]

Author:

{'name': 'Cheahuychou Mao', 'email': 'mao.cheahuychou@gmail.com', 'username': 'cheahuychou'}

Message: SERVER-78703 Fix typos in analyze_shard_key.js

(cherry picked from commit 4aaa31e58960aa1e3340abb57b88dc0ee2dbb152)
Branch: v7.0
https://github.com/mongodb/mongo/commit/1aed47df6f7b2027b7f7cb804a85270319310428

Comment by Githook User [ 08/Jul/23 ]

Author:

{'name': 'Cheahuychou Mao', 'email': 'mao.cheahuychou@gmail.com', 'username': 'cheahuychou'}

Message: SERVER-78703 Remove check in the analyzeShardKey command that expects number of orphaned documents <= total number of documents

(cherry picked from commit 74b77ed4017710c197913ece67de73d09fba578c)
Branch: v7.0
https://github.com/mongodb/mongo/commit/d53bb216e819d33fabe97eb31def16bd6651d8fa

Comment by Githook User [ 07/Jul/23 ]

Author:

{'name': 'Cheahuychou Mao', 'email': 'mao.cheahuychou@gmail.com', 'username': 'cheahuychou'}

Message: SERVER-78703 Fix typos in analyze_shard_key.js
Branch: master
https://github.com/mongodb/mongo/commit/4aaa31e58960aa1e3340abb57b88dc0ee2dbb152

Comment by Githook User [ 07/Jul/23 ]

Author:

{'name': 'Cheahuychou Mao', 'email': 'mao.cheahuychou@gmail.com', 'username': 'cheahuychou'}

Message: SERVER-78703 Remove check in the analyzeShardKey command that expects number of orphaned documents <= total number of documents
Branch: master
https://github.com/mongodb/mongo/commit/74b77ed4017710c197913ece67de73d09fba578c

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