Skip to content

Conversation

3vilhamster
Copy link
Contributor

@3vilhamster 3vilhamster commented Jul 30, 2025

What changed?
GetState and AssignShards methods now use shard ownership information that the shard assignment process could change.
Using this information, we can give a read-after-write guarantee, so that we won't have double assignments.
Process never entirely removes assignments, as we must assign all shards to the executor.
Note: rebalanceShards will fail if a conflict happens and will retry either by timer or because any other change will trigger redistribution.

Why?
AssignShards is the main process of the shard-distributor, and it must update shard ownership so it can be consumed with the GetShardOwner call.

How did you test it?
Unit tests

Potential risks

Release notes

Documentation Changes


type ShardState struct {
ExecutorID string
Revision int64
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Probably, this could be extended with more field for ephemeral shards

@3vilhamster 3vilhamster merged commit db50d1f into cadence-workflow:master Jul 31, 2025
25 checks passed
@3vilhamster 3vilhamster deleted the shard-distributor-assign-shards branch July 31, 2025 09:00
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