Skip to content

fix(shard-distributor): return executor metadata for ephemeral shard assignments#7501

Merged
jakobht merged 4 commits intocadence-workflow:masterfrom
jakobht:bugNewShardMetaData
Dec 1, 2025
Merged

fix(shard-distributor): return executor metadata for ephemeral shard assignments#7501
jakobht merged 4 commits intocadence-workflow:masterfrom
jakobht:bugNewShardMetaData

Conversation

@jakobht
Copy link
Member

@jakobht jakobht commented Dec 1, 2025

What changed?
Modified ephemeral shard assignment to return executor metadata in the GetShardOwner response. Added GetExecutor method to retrieve executor information, including metadata.

Why?
When ephemeral shards were assigned to executors, the response only included the executor ID but not the metadata.

How did you test it?
Unit tests, and local testing

Potential risks

Release notes

Documentation Changes

…ormation

Signed-off-by: Jakob Haahr Taankvist <jht@uber.com>
Signed-off-by: Jakob Haahr Taankvist <jht@uber.com>
n.RUnlock()

if ok {
shardOwner, err := n.getShardOwnerInMap(ctx, n.shardOwners, shardID)
Copy link
Contributor

Choose a reason for hiding this comment

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

GetShardOwner and GetExecutor use the n.ShardOwners for the second argument, but shardID and executorID for the third argument. I think you wanted to use n.shardToExecutor. Would it be possible to cover it by tests, so that we expect GetShardOwner and GetExecutor use appropriate maps?

Copy link
Contributor

Choose a reason for hiding this comment

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

However, I also don't see where n.shardToExecutor is populated...

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch! It was acctually caught by tests, sadly CI was broken, I fixed it here: #7502

I have fixed it, and also updated the signature to take a pointer instead of a map, as refresh overwrites the variable

Copy link
Member Author

Choose a reason for hiding this comment

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

However, I also don't see where n.shardToExecutor is populated...

It was already populated, just not saved on the struct. You can see where I changed shardToExecutor to n.shardToExecutor

…type issue

Signed-off-by: Jakob Haahr Taankvist <jht@uber.com>
Signed-off-by: Jakob Haahr Taankvist <jht@uber.com>
@jakobht jakobht enabled auto-merge (squash) December 1, 2025 14:55
@jakobht jakobht merged commit ed6f932 into cadence-workflow:master Dec 1, 2025
57 of 58 checks passed
@jakobht jakobht deleted the bugNewShardMetaData branch March 2, 2026 11:31
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