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

Perf improvements for remote read replicas #5005

Merged
merged 30 commits into from
Dec 20, 2022
Merged

Perf improvements for remote read replicas #5005

merged 30 commits into from
Dec 20, 2022

Conversation

zachmu
Copy link
Member

@zachmu zachmu commented Dec 15, 2022

This significantly speeds up the process of syncing a remote-based replica by 1) pulling chunks once, rather than once per branch in the case of replicas that want everything, and 2) by eliminating a bunch of duplicated and wasted work. Latency for up-to-date case is now <100 ms.

@zachmu zachmu requested a review from reltuk December 16, 2022 22:41
@zachmu zachmu marked this pull request as ready for review December 16, 2022 22:41
srcDBCommit, err = actions.FetchRemoteBranch(fetchCtx, rrd.tmpDir, rrd.remote, rrd.srcDB, rrd.ddb, branch, actions.NoopRunProgFuncs, actions.NoopStopProgFuncs)
if err != nil {
return nil, err
err = rrd.ddb.PullChunks(ctx, rrd.tmpDir, rrd.srcDB, srcRoot, nil, nil)
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: It seems more correct, clearer and very marginally more performance to make an interface that will pull more than one addr at once and then to pass all the addrs in remoteRefs to it.

Copy link
Contributor

@reltuk reltuk left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for making that change.

@zachmu zachmu merged commit 2f187be into main Dec 20, 2022
@tbantle22 tbantle22 deleted the zachmu/replica-perf branch March 9, 2023 00:55
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.

None yet

3 participants