Skip to content

Conversation

@jprieto-temporal
Copy link
Contributor

What changed?

Add watch support to the namespace registry. When persistence supports namespace watches, the registry receives real-time updates via a channel instead of periodic polling. On startup, the registry attempts to establish a watch. If successful, it processes create/update/delete events as they arrive. If watches aren't supported (ErrWatchNotSupported), it falls back to the existing polling behavior.

Other changes:

  • Add WatchNamespaces method to the Persistence interface used by the registry
  • Change stateChangeCallbacks from map to sync.Map to simplify callback handling from watches
  • Add various namespace registry metrics

Why?

Watch-based updates provide lower latency for namespace changes compared to polling, and reduce load on the persistence layer.

How did you test it?

  • built
  • run locally and tested manually
  • covered by existing tests
  • added new unit test(s)
  • added new functional test(s)

Potential risks

  • Persistence implementations that don't support watches will continue using polling (no behavior change)
  • Watch reconnection uses unlimited retries after initial startup succeeds, which could cause log spam if persistence becomes permanently unavailable

@jprieto-temporal jprieto-temporal requested review from a team as code owners January 5, 2026 21:40
@jprieto-temporal jprieto-temporal requested a review from dnr January 5, 2026 21:40
@jprieto-temporal jprieto-temporal removed the request for review from dnr January 6, 2026 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant