FiloDB icon indicating copy to clipboard operation
FiloDB copied to clipboard

fix(coord) Stateful set ShardManager bug fix

Open amolnayak311 opened this issue 2 years ago • 0 comments

Pull Request checklist

  • [x] The commit(s) message(s) follows the contribution guidelines ?
  • [x] Tests for the changes have been added (for bug fixes / features) ?
  • [ ] Docs have been added / updated (for bug fixes / features) ?

Current behavior :

Currently shardAssignments method given a coordinator returns the list of shards the provided coordinator are assigned to. However, the method should just return just the unassigned shards and not a static list. The current implementation returns a static list which works at startup but when nodes go down, all nodes are reported as unassigned despite those nodes serving the data. This the num_active_shards metrics incorrectly reports the shards as assigned and not active.

New behavior :

The shardAssignments's implementation is now changed to return a subset of the unassigned shards the provide coordinator should serve. If there are none, an empty list if returned. The unit tests are updated accordingly.

amolnayak311 avatar Aug 25 '22 05:08 amolnayak311