[SERVER-63239] Do not throw exception in AutoSplitVector on empty ranges Created: 03/Feb/22  Updated: 29/Oct/23  Resolved: 04/Feb/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.3.0, 5.0.7, 5.2.2

Type: Task Priority: Major - P3
Reporter: Allison Easton Assignee: Tommaso Tocci
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Backwards Compatibility: Fully Compatible
Backport Requested:
v5.2, v5.0, v4.4, v4.2, v4.0
Sprint: Sharding EMEA 2022-02-07
Participants:

 Description   

Because the move and merge chunk phase has no guarantees that all small chunks will be merged, there is a possibility that there are empty chunks left in the split chunk phase (this could also happen on cancellation of defragmentation). The AutoSplitVectorCommand fails with this error when called on an empty range. Currently, the defragmentation algorithm treats this as a non-retryable error, rebuilds phase 3, and then executes the same command causing defragmentation to get stuck. We need to ignore this specific error response as though it was a success since there is no need to split an empty range.

Another possible solution would be to modify the auto split vector command to return success with no split points if a range is empty.



 Comments   
Comment by Githook User [ 16/Feb/22 ]

Author:

{'name': 'Tommaso Tocci', 'email': 'tommaso.tocci@mongodb.com', 'username': 'toto-dev'}

Message: SERVER-63239 Do not throw exception in AutoSplitVector on empty ranges

(cherry picked from commit 1bbb1d0c7ef1844c20571183df8ca98055e10b5b)
Branch: v5.0
https://github.com/mongodb/mongo/commit/227fea5dfb7c1b313411a54c51534059386fdc53

Comment by Githook User [ 15/Feb/22 ]

Author:

{'name': 'Tommaso Tocci', 'email': 'tommaso.tocci@mongodb.com', 'username': 'toto-dev'}

Message: SERVER-63239 Do not throw exception in AutoSplitVector on empty ranges
Branch: v5.2
https://github.com/mongodb/mongo/commit/1bbb1d0c7ef1844c20571183df8ca98055e10b5b

Comment by Githook User [ 04/Feb/22 ]

Author:

{'name': 'Tommaso Tocci', 'email': 'tommaso.tocci@mongodb.com', 'username': 'toto-dev'}

Message: SERVER-63239 Test defragmenting collection with empty chunks
Branch: master
https://github.com/mongodb/mongo/commit/2549aaadb6665856b7f971fd62128db5b9cdb916

Comment by Githook User [ 04/Feb/22 ]

Author:

{'name': 'Tommaso Tocci', 'email': 'tommaso.tocci@mongodb.com', 'username': 'toto-dev'}

Message: SERVER-63239 Do not throw exception in AutoSplitVector on empty ranges
Branch: master
https://github.com/mongodb/mongo/commit/e221ce7f62fc9fa22c11544525f49759eb003c43

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