[SERVER-65429] Balancer defragmentation policy should be cleared on step down Created: 11/Apr/22  Updated: 29/Oct/23  Resolved: 13/Apr/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.3.2, 6.0.0-rc0

Type: Bug Priority: Major - P3
Reporter: Allison Easton Assignee: Paolo Polato
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:
v5.3
Sprint: Sharding EMEA 2022-04-18
Participants:
Linked BF Score: 24

 Description   

The in memory state of the defragmentation policy isn't being cleared on step down. We are stopping the balancer threads, which prevents defragmentation from continuing after the node has stepped down, but leaving the in memory state intact can cause defragmentation to resume on re-step-up of an old primary when it should not be resumed (for example, when defragmentation has completed with a different primary). As part of the step down of the balancer, we should clear the _defragmentationStates map in the balancer defragmentation policy.



 Comments   
Comment by Githook User [ 14/Apr/22 ]

Author:

{'name': 'Paolo Polato', 'email': 'paolo.polato@mongodb.com', 'username': 'ppolato'}

Message: SERVER-65429 Clean up defragmentation policy memory on stepdown

(cherry picked from commit b4384a6a6774ae494e57adc0c625769fec107828)
Branch: v5.3
https://github.com/mongodb/mongo/commit/3484840e3a1eb6203f29cc04cb3e2459c53991dd

Comment by Githook User [ 12/Apr/22 ]

Author:

{'name': 'Paolo Polato', 'email': 'paolo.polato@mongodb.com', 'username': 'ppolato'}

Message: SERVER-65429 Clean up defragmentation policy memory on stepdown
Branch: master
https://github.com/mongodb/mongo/commit/b4384a6a6774ae494e57adc0c625769fec107828

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