Closed cretz closed 1 hour ago
Hi Cretz, just want to understand. For current behavior, eviction only happens when the memory runs out? or after hitting MAX_CACHED_WORKFLOWS ?
Also issues like this in this repo, is it normally for Temporal maintainers to keep track and pick up?
With current behavior, eviction only happens if the spot is needed (so the cache size never decreases). We have this tracked on our near-term backlog.
Describe the solution you'd like
Like Go and Java, Core should evict cached workflows when server accepts workflow completion. Since post-close queries don't use the sticky queue anyways, Core was saving lang some steps, but full history was being downloaded anyways and it was just luck if the query landed on the same worker as the cache anyways. It was decided that we might as well save users memory in the common case. After discussion, there was not enough concern for reliance on existing behavior to need to have an option.
This also means Core needs to support the
temporal_sticky_cache_total_forced_eviction
metric now like Go and JAva.