AllowStale and RequireConsistent are mutually exclusive.#1500
Conversation
If you speficy RequireConsistent: false, then you actually saying use the default - which is consistent. You need to set AllowState: true. Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
|
I can see that during ordinary reads you don't mind seeing out-of-date info from other ingesters, but when you insert one into the ring that should be a real CAS, no? |
|
The CAS will always be consistent, yeah. More: the read before the CAS can be stale, then the CAS will fail. The idea is that eventually it will succeed. Whats more with a single consul node, there is no such thing as a stale read. If you run a clustered consul you probably want consistent reads. |
|
|
Why are there two bools to control one thing? |
gouthamve
left a comment
There was a problem hiding this comment.
See comment. Otherwise LGTM
|
Explained offline that the consistent reads will use raft log while stale ones dont. |
I couldn't say, but the docs say:
If you look at the code, setting either to true adds a parameter to the HTTP call: if q.AllowStale {
r.params.Set("stale", "")
}
if q.RequireConsistent {
r.params.Set("consistent", "")
} |
Unfortunately the code has a fixed limit of 10 retries, and those complete in about 90ms on my system, so I re-assert that this is a bad idea. #3259 |
If you specify RequireConsistent: false, then you actually saying use the default - which is consistent. You need to set AllowState: true.
Signed-off-by: Tom Wilkie tom.wilkie@gmail.com