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

Include response chunking info in nonce #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

PapaCharlie
Copy link
Member

If a given delta response contains too many resources, the server will break it up into multiple responses. However, this means the client does not know whether it received all the resources for its subscription. This is especially relevant for wildcard subscriptions, for which the client does not know the resources ahead of time and therefore cannot wait for them explicitly. By returning additional metadata in the nonce (there is no field for this in the delta discovery response, though I'm hoping that will change cncf/xds#99), the client can know if the server chunked the response, and react accordingly.

If a given delta response contains too many resources, the server will break it
up into multiple responses. However, this means the client does not know whether
it received all the resources for its subscription. This is especially relevant
for wildcard subscriptions, for which the client does not know the resources
ahead of time and therefore cannot wait for them explicitly. By returning
additional metadata in the nonce (there is no field for this in the delta
discovery response, though I'm hoping that will change
cncf/xds#99), the client can know if the server
chunked the response, and react accordingly.
Comment on lines +23 to +25
// NewNonce creates a new unique nonce based on the current UNIX time in nanos, always returning a
// string of [NonceLength].
func NewNonce(remainingChunks int) string {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a smart yet big change to the nonce. To make sure it's backward compatible, I checked Rest.li xds client is not using the nonce in any way currently. May want to let Xin and Yan know to make sure Envoy is not using it too.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No one is, it's not supposed to be used for anything other than ACKs/NACKs, it's not meant to be interpreted more than that. Envoy doesn't use it at all for sure.

@@ -92,7 +92,7 @@ type deltaSender struct {
queuedUpdates []queuedResourceUpdate
// The minimum size an encoded chunk will serialize to, in bytes. Used to check whether a given
// update can _ever_ be sent, and as the initial size of a chunk. Note that this value only depends
// on utils.NonceLength and the length of typeURL.
// on utils.MaxNonceLength and the length of typeURL.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there seems to be no MaxNonceLength?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops

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

Successfully merging this pull request may close these issues.

2 participants