Running an FBP pipeline where each node is a GenServer. Need to move a segment of the running pipeline (multiple connected nodes) from one BEAM node to another without losing messages or breaking the flow.
Example: nodes A → B → C → D running on server 1. Want to move B → C to server 2 while pipeline is processing.
Questions:
Drain and restart, or something smarter?
How to handle in-flight messages during migration?
Coordinate the cutover so upstream (A) starts sending to new location?
Is there a pattern for this, or just stop/migrate/restart?
Using Pulsar/Artemis as message broker, so could potentially buffer there during migration. But curious about pure BEAM approaches too (mailbox draining, etc).
I haven’t done this using FBP, or BEAM. So I am drawing my answer from my experience in just database migrations ( postgres ) from one cloud to another with near zero downtime ( very little buffered draining )
The way I have done something similar in the past was via WAL streaming both with a timed syncronization window where queries timed out for a small bit while the buffers drained over.
Proxy stream original B → C to the 2nd B → C
verify 2nd B matches 1st B, then stop sending to 1st B