HA: Disable persistent context cache layer in HA enabled instances
- Dominant language
- JavaScript
- Stars
- 400
- Forks
- 89
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 146
Description
The initial iteration of HA did not modify how persistent context is handled by the replicas. This has been documented as a limitation of the current Preview, but we need to address it in a future release.
Copying over comments from 2156:
We added a caching layer to our persistent context implementation for two reasons:
- performance
- it allows the api to operate in synchronous mode - which is what most users expect. Removing the caching layer will require the API to be asynchronous. This will require all Function nodes accessing context to be modified to use the async api Node-RED provides.
If HA is enabled, we will need to disable the caching layer.
However, we have https://github.com/flowforge/flowforge-nr-persistent-context/issues/16 when the store is async-only. This has been fixed upstream in Node-RED 3.1.
We need to figure out our approach on this once Node-RED 3.1 is available - there could be further gotchas with the async context approach, particularly around atomic updates to context values. It may simply be an anti-pattern for HA mode.
Contributor guide
Assessment
This issue has not been assessed yet.