feat(matching): Invalidate TaskListPartitionConfig on Attempted Writes to Read-Only Partitions#7618
Merged
natemort merged 5 commits intocadence-workflow:masterfrom Jan 26, 2026
Conversation
natemort
reviewed
Jan 20, 2026
client/matching/client.go
Outdated
| resp, err := c.client.AddActivityTask(ctx, request, append(opts, yarpc.WithShardKey(peer))...) | ||
| if err != nil { | ||
| // ReadOnlyPartitionError indicates the partition is being drained - invalidate cache to force next request to route to root partition | ||
| if _, ok := err.(*types.ReadOnlyPartitionError); ok { |
Member
There was a problem hiding this comment.
While we're not consistent within the repo, we should use errors.As to check error types to ensure we correctly handle wrapped errors. There's an example in the package documentation.
Shaddoll
reviewed
Jan 20, 2026
Signed-off-by: Joanna Lau <118241363+joannalauu@users.noreply.github.com>
Signed-off-by: Joanna Lau <118241363+joannalauu@users.noreply.github.com>
…dOnlyPartitionError is returned Signed-off-by: Joanna Lau <118241363+joannalauu@users.noreply.github.com>
Signed-off-by: Joanna Lau <118241363+joannalauu@users.noreply.github.com>
c0773ac to
5a1f966
Compare
Shaddoll
approved these changes
Jan 26, 2026
Member
|
Awesome work, thanks for your contribution! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed?
ReadOnlyPartitionErrorAddTaskfunction to returnReadOnlyPartitionErroron attempted writes to read-only partitionsInvalidatePartitionCachefunction that deletes the partition cacheInvalidatePartitionCachewhenReadOnlyPartitionErroris returnedWhy?
We want to invalidate the TaskListPartitionConfig cache if it is read-only. The history host should then route the request to the partition root, which will return the new config. This prevents the history host from accidentally picking the read-only partition again, which causes wasted task processing attempts.
Fixes: #7560
How did you test it?
Potential risks
Release notes
Documentation Changes