Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redirect replication requests when shard count is different #3789

Merged
merged 4 commits into from
Jan 13, 2023

Conversation

yux0
Copy link
Contributor

@yux0 yux0 commented Jan 9, 2023

What changed?
Redirect replication requests when shard count is different

Why?
When replicate workflow between different shard count, it requires redirect to different shards.

How did you test it?
Unit tests

Potential risks

Is hotfix candidate?

@yux0 yux0 requested a review from a team as a code owner January 9, 2023 23:03
@@ -174,7 +170,7 @@ func (e *taskExecutorImpl) handleActivityTask(
ctx, cancel := e.newTaskContext(ctx, attr.NamespaceId)
defer cancel()

err = e.historyEngine.SyncActivity(ctx, request)
_, err = e.shardContext.GetHistoryClient().SyncActivity(ctx, request)
Copy link
Contributor

Choose a reason for hiding this comment

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

Will there be additional cost when we always go through history client? Should we still go through history engine if the request is for the local shard?

Copy link
Contributor

Choose a reason for hiding this comment

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

we can certainly add additional wrapper, but the ROI is low?

Copy link
Contributor

Choose a reason for hiding this comment

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

actually, if we decide to do perf optimization, the optimization should be done within the wrapper of client

Copy link
Contributor Author

Choose a reason for hiding this comment

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

actually, if we decide to do perf optimization, the optimization should be done within the wrapper of client

Yes. There will be additional network cost but I don't think it is a concern at this point. I can also add an additional check for now and move it to the wrapper of client.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok Let's leave it for now and address it in case it becomes an issue in prod.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will add a TODO there.

@yux0 yux0 merged commit b132fc2 into temporalio:master Jan 13, 2023
@yux0 yux0 deleted the redir-replication branch January 13, 2023 04:18
yux0 added a commit that referenced this pull request Jan 13, 2023
* Redirect replication requests when shard count is different
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.

4 participants