Skip to content

Conversation

@jakobht
Copy link
Member

@jakobht jakobht commented Nov 24, 2025

What changed?
Changed GetShardOwner to return an ExecutorOwnership struct containing both executor ID and metadata map, instead of just the executor ID string.
Also adds a Spectators group so we can easily pass around all spectators.
Why?
Enables callers to access additional executor information like gRPC address for peer routing, without requiring separate lookups. This is needed for implementing canary peer chooser that routes requests to executors based on their addresses.

How did you test it?
Updated all tests to verify metadata is included in responses. Verified locally that ownership information includes metadata.

Potential risks
Low - this is an API enhancement that maintains backward compatibility by returning the same executor ID, just with additional metadata.

Release notes

Documentation Changes
None

Previously GetShardOwner only returned the executor ID string. Now it
returns an ExecutorOwnership struct containing both the executor ID and
the full metadata map. This allows callers to access additional executor
information like the gRPC address needed for peer routing.

Changes:
- Add ExecutorOwnership struct with ExecutorID and Metadata fields
- Update GetShardOwner signature to return *ExecutorOwnership
- Update spectatorImpl to build and return ownership info
- Update tests to verify metadata is included in responses

Signed-off-by: Jakob Haahr Taankvist <[email protected]>
Use BlockUntil() to properly synchronize with the fake clock before
advancing time. This prevents the test from hanging while waiting for
the goroutine to process the time advancement.

Signed-off-by: Jakob Haahr Taankvist <[email protected]>
@jakobht jakobht force-pushed the spectator-return-metadata branch from fc14633 to 2e5ff6c Compare November 25, 2025 07:52
Encapsulate the spectators map in a struct to hide implementation details
and make it easier to extend in the future without breaking the API.

Signed-off-by: Jakob Haahr Taankvist <[email protected]>
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