-
Notifications
You must be signed in to change notification settings - Fork 510
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
sotw: Ordered ADS mode #544
Conversation
This PR branches off the work found here: #461 and brings it up to speed with the current state of go-control-plane. Credit to the original algorithm author @fxposter (would be great if he could review)/ We've found quite a few resource ordering issues in upstream xDS conformance test suites and this will hopefully provide a remedy to some of those problems. I tried to introduce the change in a non intrusive way, if no |
@@ -31,14 +31,11 @@ func (log logger) Warnf(format string, args ...interface{}) { log.t.Logf(format | |||
func (log logger) Errorf(format string, args ...interface{}) { log.t.Logf(format, args...) } | |||
|
|||
func TestTTLResponse(t *testing.T) { | |||
|
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.
Ran this file through a formatter hence these changes.
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.
Can we make a separate PR with this, and just land it?
c52e874
to
1016a43
Compare
This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
Haven’t had much bandwidth to work this recently will get back to it soon. |
any progress on this? |
if w, ok := sw.watches.responders[typeURL]; ok { | ||
// We've found a pre-existing watch, lets check and update if needed. | ||
// If these requirements aren't satisfied, leave an open watch. | ||
if w.nonce == "" || w.nonce == nonce { |
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.
If we get a mismatching nonce we just discard the new request. Shouldn't we close the stream then? This seems like a silent failure that could be very impactful if nodes are not aware their requests are ignored
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.
Um that's a good question, I left this as the previous behavior but maybe worth an issue?
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.
Yes I think an issue would be good to avoid missing this
} | ||
lastDiscoveryResponses[resp.GetRequest().TypeUrl] = lastResponse | ||
// increment nonce and convert it to base10 | ||
out.Nonce = strconv.FormatInt(atomic.AddInt64(&s.nonce, 1), 10) |
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.
Minor: do we need this atomic increase here? The rest of this method is not synchronized anyway
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.
I think we do need this since N number of "sends" can increment the nonce counter which is shared. I could be wrong though I ported that from the previous code
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.
My understanding is that all the "sends" run in the same goroutine on a stream, so I do not expect the need to synchronize, but might be wrong
DebugFunc: log.Printf, | ||
InfoFunc: log.Printf, | ||
WarnFunc: log.Printf, | ||
ErrorFunc: log.Printf, |
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.
Why do we need this change? Can we make a separate PR?
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.
I think the linter was complaining about this? Honestly can't remember haha
// utilized through the functional opts pattern | ||
type Opts struct { | ||
// If true respond to ADS requests with a guaranteed resource ordering | ||
Ordered bool |
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.
TBH, I haven't looked at ordering for a long time. My recollection was that for ADS, the client was supposed to make requests in the order that was correct for it? If that's the case, do we really need to order anything in the server?
My other query is that, if ordering is a correctess issue, then shouldn't we be correct by default?
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.
That's what I thought, the bug this closes out shows that envoy sometimes requests things out of order even in ADS.
IMO for ADS we always want to be ordered so yes. If I recall correctly when a user configures the server to run in ADS mode it'll be ordered by default (but you can override that).
Signed-off-by: Alec Holmes <[email protected]>
Signed-off-by: Alec Holmes <[email protected]>
…dynamic channels in ordered ads Signed-off-by: Alec Holmes <[email protected]>
Signed-off-by: Alec Holmes <[email protected]>
Signed-off-by: Alec Holmes <[email protected]>
Signed-off-by: Alec Holmes <[email protected]>
Signed-off-by: Alec Holmes <[email protected]>
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.
Nothing blocking, just a comment for potential order issue would be nice
Signed-off-by: Alec Holmes <[email protected]>
introduce optional resource ordering for guaranteed eventual consistency in ADS mode. closes #526