Open MarianRaphael opened 1 year ago
If the assumption is incorrect, the issue can be closed.
@hardillb and I have been discussing how we will approach this at length to start building an implementation plan.
Our working notes are in https://www.figma.com/file/upA7oHb9seloP74kTMyegN/FlowForge-High-Availability-Design-notes?node-id=0%3A1&t=bZVnNEZIeQBpxH12-1
There is a lot of technical work required it isn't something you can do half the job, but we are starting to identify the steps needed to work towards it.
The key criteria is whether we can build a failover system that operates faster than it takes k8s to restart a crashed pod.
Lots more detail at the figma link above... copying here for reference
Key points
Restarting Node-RED
If the platform asks the HA Controller to restart Node-RED (could be updating settings or a staged deployment rollout), the HA Controller will notify the inactive instance to restart first - once it is ready, HA Controller will trigger a failover so the newly updated inactive instance becomes the active instance. It will then tell the newly inactive instance to restart. This will minimise the downtime of rolling out new flows.
There are a few different scenarios like this - some already documented in the figma doc.
Two immediate tasks have been identified that can be got underway now:
while(true){}
loop is deployed in a function node, the instance's event loop will be stuck. The launcher can monitor responsiveness of the instance and trigger a restart if needed. Even without the HA work, this will improve the resilience and recovery time for this particular failure mode.From there, we then have to build the HA Controller. There's no short-cutting that piece - a finer grained task breakdown will follow for that.
Activities paused, based on workshop discussion. Alternative first approach: https://github.com/flowforge/flowforge/issues/2156
Description
Implement a robust automatic failover mechanism for Node-RED instances that focuses solely on high availability without considering scalability. This feature will monitor the active Node-RED instance and seamlessly switch to a hot-spare instance if the primary instance fails or becomes unresponsive, thus ensuring reliability without the added complexity of load balancing and scaling.
Related Epic
https://github.com/flowforge/flowforge/issues/1678
Assumption
Automatic failover without scaling is assumed to be easier to implement than a complete high availability solution with scaling, as it omits the complexities associated with load balancing, state management, and other challenges tied to scaling.
Motivation
As a customer of FlowForge, I would like to have the option to utilize high availability instances. This allows me to run business-critical processes within Node-RED and ensure that they are always available.
Key considerations