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

support write slow down on a single shard. #485

Open
coocood opened this issue May 20, 2021 · 1 comment
Open

support write slow down on a single shard. #485

coocood opened this issue May 20, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@coocood
Copy link
Collaborator

coocood commented May 20, 2021

We should limit the maximum number of L0 tables, otherwise, the shard size will keep growing and never have the chance to split.

@coocood coocood added the enhancement New feature or request label May 20, 2021
@coocood coocood changed the title support write slow down and write stall support write slow down on a single shard. Aug 17, 2021
@coocood
Copy link
Collaborator Author

coocood commented Aug 19, 2021

We can maintain a golang.org/x/time/rate.Limiter in each Shard to limit the write throughput.

The applier doesn't limit the write because that would block other region's write.

The Shard adjusts the limit based on the number of L0 tables and MemTable size, and it provides an API to be used by the MVCCStore.Prewrite method to limit the write throughput, add limit here doesn't block any other threads.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant