-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
etcd serves stale read requests before log is caught up during recovery/startup #3879
Comments
@spacejam If you want to prevent stale read, you need to specify quorum=true. |
I think people are looking for an SLA for how "fresh" the results are. For example if we can give someone a GET request that only succeeds if the last successful heartbeat RPC was X seconds ago. |
Is there a case where it is desirable to serve read requests before the local state is fully recovered? This is likely to involve serving state that is far older than typical follower lag. |
@spacejam I am curious about the use case. If user really care about the "freshness" more than linearizability, it might make sense to add a feature to block on the client request until:
Or user can simply specify quorum=true. But I am not convinced that user needs this fine grained control. |
I think people are generally fine with some slave lag, and would prefer stale data to no data in the presence of partitions, but I don't think many people are willing to trade extremely stale reads for a few moments of acausal availability in the rare case of server start-up. This is why many databases will not serve requests until they have fully recovered their local state upon initialization. |
@spacejam Oh. Yea. For startup initialization, it is an easy fix and should be fixed.
Your original issue is border than initialization if I understand it correctly. A server can recover from snapshot at runtime too. Shall we wait until it catches up with the leader? A server might be partitioned and is far behind the leader. Shall we wait again? I have some rough answers in my mind. But I do not have to plan to address them immediately. |
From #3300: etcd serves stale read requests before log is caught up during startup. |
Closed by #5196 |
Steps to reproduce:
It should wait until the log has caught up before serving reads.
The text was updated successfully, but these errors were encountered: