[SERVER-53827] range_deleter_server_status.js should use assert.soon to check the number of range deletion tasks Created: 15/Jan/21  Updated: 29/Oct/23  Resolved: 05/Feb/21

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 4.9.0, 4.4.5

Type: Task Priority: Major - P3
Reporter: Jordi Serra Torrens Assignee: Marcos José Grillo Ramirez
Resolution: Fixed Votes: 0
Labels: sharding-wfbf-day
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Backwards Compatibility: Fully Compatible
Backport Requested:
v4.4
Sprint: Sharding 2021-02-08
Participants:
Linked BF Score: 18

 Description   

The moveChunk command returns before the range deletion is added to the _rangesScheduledForDeletion list because than happens asynchronously when it's set not to wait for delete.

In the range_deleter_server_status.js, we are checking the number of range deletions tasks right after moveChunk returns, so the task may not have been added yet to the list, and thus not reflected in the serverStatus.

We should use an assert.soon instead:

assert.soon(() => {
    let serverStatusRes = shardDB.runCommand({serverStatus: 1});
    return 3 == serverStatusRes.shardingStatistics.rangeDeleterTasks;
}); 



 Comments   
Comment by Githook User [ 18/Feb/21 ]

Author:

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

Message: SERVER-53827 Use assert.soon instead of assert.eq to wait for range deletion task to be scheduled

(cherry picked from commit 78ecf3b9b6ee486e9c2ba440e61c6f497534efb7)
Branch: v4.4
https://github.com/mongodb/mongo/commit/7dedd7278dea4d413aaaafa62655540ed3849fff

Comment by Githook User [ 04/Feb/21 ]

Author:

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

Message: SERVER-53827 Use assert.soon instead of assert.eq to wait for range deletion task to be scheduled
Branch: master
https://github.com/mongodb/mongo/commit/78ecf3b9b6ee486e9c2ba440e61c6f497534efb7

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