bastion
bastion copied to clipboard
Support for hot code swapping
Describe the solution you'd like For systems that are intended to never stop, it's helpful if components of running systems, or perhaps additionally entire systems proper, may be updated gracefully.
If components are updated, associated message queues should not lose messages. What other guarantees should be expected?
Would it be beneficial to add support for hot code swapping via WebAssembly-based components until Rust has a [more] stable ABI and Rust-based support becomes more practical?
Original comment "HCS (hot-code-swap)" by @vertexclique at https://lobste.rs/s/mhky0b/announcing_bastion_0_3_highly_available#c_u1w0jg
For this feature will be necessary to implement a method for handling code updates. In Elixir / Erlang language exists the special method for handling. It described in docs, like here
We are still thinking for a feasible and reliable implementation for HCS. Though it is a very hard to implement feature we had a basic design document before. Sharing here so we can use it as reference: https://paper.dropbox.com/doc/L50Ptr6lv8H7NjjomMeav
One of the ways to make it easier for implementation / usage / integration is to have a universal default registry (which is described in the issue #158) and available only for the main server (=handler/root supervisor?).
However, it also requires that any existing actor / supervisor must provide at least some minimal information for the default registry, such as used id /module_name. This kind of information will eliminate a lot of excessive work, so that the supervisor could update only the requested code with minimal memory footprint and shortest delays.