fix crash in layout computation when changing all nodes of a zone to gateway mode #937

Merged
lx merged 1 commit from baptiste/garage:fix_layout_crash into main 2025-02-19 17:09:11 +00:00

1 commit

Author SHA1 Message Date
Baptiste Jonglez
6d798c640f WIP: fix crash in layout computation when changing all nodes of a zone to gateway mode
All checks were successful
ci/woodpecker/pr/debug Pipeline was successful
This change is probably not a proper fix, somebody with more expertise on
this code should look at it.

Here is how to reproduce the crash:

- start with a layout with two zones
- move all nodes of a zone to gateway mode: `garage layout assign fea54bcc081f318 -g`
- `garage layout show` will panic with a backtrace

Fortunately, the crash is only on the RPC client side, not on the Garage
server itself, and `garage layout revert` still works to go back to the
previous state.

As far as I can tell, this bug is present since Garage 0.9.0 which
includes the new layout assignation algorithm:

  #296
2025-01-27 19:33:57 +01:00