-
Notifications
You must be signed in to change notification settings - Fork 52
fix(balancer) fix accidental ttl=0 switches #56
Conversation
For reference: the related Kong issue |
I did read the Kong issue but I'm struggling a bit to follow. Could two queries done in the same second cause this situation even with this check-twice fix? |
No, the problem really is an edge problem. It is not that the dns server should count down from I'm not sure whether two consecutive queries within eg. 1ms of each other would be enough to re-trigger the issue. That said, default behaviour is to "synchronise" queries (requesting From there, if we have 2 different queries, we can safely assume that the latency between the 2 will at least be 10ms (and probably more). My guess (no certainty) would be that this would be more than enough to by pass the issue. It worked for the user reporting the problem. |
Makes sense — one last question about this topic: (more for the purposes of documenting this logic in this PR history than anything else) Since the case for |
No, that is exactly the difference between this patch and the one proposed in the Kong issue. Note the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the clarifications!
See #51
Some servers will report ttl=0 when they are on the very edge
of their own cached ttl. This should never happen for a record
that has a non-0 ttl.
This fix makes sure we require ttl=0 reported twice in a row before
we switch the loadbalancer.
Fixes #51