[SERVER-77254] Make analyzeShardKey monotonicity tests more robust Created: 18/May/23  Updated: 29/Oct/23  Resolved: 18/May/23

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

Type: Bug Priority: Major - P3
Reporter: Cheahuychou Mao 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
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v7.0
Sprint: Sharding NYC 2023-05-29
Participants:
Linked BF Score: 59

 Description   

There have been multiple BFs for the monotonicity tests where the analyzeShardKey command incorrectly reports that a shard key is not monotonic although it is. Simply increasing the number of documents (i.e. data points for the correlation coefficient calculation) like in SERVER-71361 does not fully solve the issue since the OplogApplier is able to batch a lot of inserts together (replWriterThreadCount itself defaults to 16) so it is unclear what the minimum number of documents is in order to smooth out the noise from parallel oplog application. Further investigation suggests that the cause might just be that each monotonicity test inserts the documents all at once which is not realistic because in practice those documents are likely inserted across a larger timespan so there is unlikely to be this level of batching that we have been seeing in the test. So the fix should be to make the test instead insert the documents in multiple insert commands and wait for the secondaries to catch up after each command.



 Comments   
Comment by Githook User [ 18/May/23 ]

Author:

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

Message: SERVER-77254 Make analyzeShardKey monotonicity tests more robust

(cherry picked from commit c38058e7f6da3d16004a39faacd8580a811d10d9)
Branch: v7.0
https://github.com/mongodb/mongo/commit/95a074ae89b63e1b3643f6d71d589c4879dff2b0

Comment by Githook User [ 18/May/23 ]

Author:

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

Message: SERVER-77254 Make analyzeShardKey monotonicity tests more robust
Branch: master
https://github.com/mongodb/mongo/commit/c38058e7f6da3d16004a39faacd8580a811d10d9

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