Skip to content

V2 callback, interface changes#9772

Closed
michaely520 wants to merge 5 commits intomainfrom
registry-v2-callback
Closed

V2 callback, interface changes#9772
michaely520 wants to merge 5 commits intomainfrom
registry-v2-callback

Conversation

@michaely520
Copy link
Copy Markdown
Contributor

@michaely520 michaely520 commented Apr 1, 2026

What changed?

Adding a callback that allows us to inspect the old and new namespace to understand what changed

Why?

For handovers we may want to inspect the old state for finer grained tracking

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)

@michaely520 michaely520 marked this pull request as ready for review April 1, 2026 21:40
@michaely520 michaely520 requested review from a team as code owners April 1, 2026 21:40
Comment thread service/frontend/fx.go
interceptor.ServiceErrorInterceptor,
interceptor.NewFrontendServiceErrorInterceptor(logger),
// BusinessID interceptor extracts business ID and adds it to context for use by redirection policy
businessIDInterceptor.Intercept,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the reason to move this?

func (e *historyEngineImpl) registerNamespaceStateChangeCallback() {

e.shardContext.GetNamespaceRegistry().RegisterStateChangeCallback(e, func(ns *namespace.Namespace, deletedFromDb bool) {
e.shardContext.GetNamespaceRegistry().RegisterStateChangeCallbackV2(e, func(oldNs *namespace.Namespace, newNs *namespace.Namespace, deletedFromDb bool) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oldNs is not used?

// When updatedViaWatch is true, we skip adding to stateChangedDuringReadthrough since watch events
// trigger callbacks immediately and don't need to be queued for later delivery.
func (r *registry) updateSingleNamespace(ns *namespace.Namespace, updatedViaWatch bool) bool {
func (r *registry) updateSingleNamespace(ns *namespace.Namespace, updatedViaWatch bool) (*namespace.Namespace, bool) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we chat about the use case? Return the old namespace seems unnecessary.

@michaely520 michaely520 closed this Apr 6, 2026
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.

2 participants