Skip to content

xds: Clarify NACK detection in protocol spec.#14841

Merged
htuch merged 5 commits intoenvoyproxy:mainfrom
markdroth:xds_protocol_nack
Feb 2, 2021
Merged

xds: Clarify NACK detection in protocol spec.#14841
htuch merged 5 commits intoenvoyproxy:mainfrom
markdroth:xds_protocol_nack

Conversation

@markdroth
Copy link
Copy Markdown
Contributor

Signed-off-by: Mark D. Roth roth@google.com

Commit Message: xds: Clarify NACK detection in protocol spec.
Additional Description: Clarify that NACKs should be detected via the presence of the error_details field, rather than by looking at nonce and version; the latter approach does not work for APIs other than LDS or CDS, where the client can change the set of resources it is subscribing to independently of the resource type instance version changing on the server. Also clarify semantics of nonce handling.
Risk Level: Low
Testing: N/A
Docs Changes: Included in PR
Release Notes: N/A
Platform Specific Features: N/A

CC @htuch

Signed-off-by: Mark D. Roth <roth@google.com>
@markdroth
Copy link
Copy Markdown
Contributor Author

For reference, here is an example of where the server cannot detect a NACK by looking at the version and nonce for an API other than LDS and CDS:

  • C: sends resource_names=[A]
  • S: sends resources=[A], version=1, nonce=1
  • C: sends resource_names=[A], version=1, nonce=1 (this is an ACK)
  • C: sends resource_names=[A, B], version=1, nonce=1 (client is adding subscription to B)
  • S: sends resources=[B], version=1, nonce=2 (server sends B but system version does not change because server has not gotten a new config)
  • C: sends resource_names=[A, B], version=1, nonce=2, error_detail="B is invalid" (client intended to NACK B, but server will interpret this as an ACK)

Copy link
Copy Markdown
Member

@htuch htuch left a comment

Choose a reason for hiding this comment

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

Appreciate the clarifications!
/wait

The preferred mechanism for a server to detect a NACK is to look for the presence of the
:ref:`error_detail <envoy_api_field_DiscoveryRequest.error_detail>` field in the request sent by
the client. Some older servers may instead detect a NACK by looking at both the version and the
nonce in the request: if the version in the request is lower than the one sent by the server with
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There isn't really a notion of lower, instead equal/not-equal, since version is an opaque string.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

:ref:`error_detail <envoy_api_field_DiscoveryRequest.error_detail>` field. The :ref:`version_info
<envoy_api_field_DiscoveryResponse.version_info>` indicates the most recent version that the
client is using, although that may not be an older version in the case where the client has
subscribed to a new resource from an existing version and that new resource is invalid.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This last sentence is a bit unclear. I think I get at what you mean based on our earlier conversation but not sure other readers will.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

To clarify this, I've added an example above and referred back to it here.

Signed-off-by: Mark D. Roth <roth@google.com>
Signed-off-by: Mark D. Roth <roth@google.com>
htuch
htuch previously approved these changes Jan 29, 2021
Copy link
Copy Markdown
Member

@htuch htuch left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@htuch
Copy link
Copy Markdown
Member

htuch commented Jan 29, 2021

@markdroth see CI.

Signed-off-by: Mark D. Roth <roth@google.com>
@markdroth
Copy link
Copy Markdown
Contributor Author

The CI failure showing now looks unrelated to the PR. Harvey, can you (or someone else knowledgeable) please take a look? Thanks!

@htuch
Copy link
Copy Markdown
Member

htuch commented Jan 31, 2021

@markdroth can you merge master and push? Thanks.

Signed-off-by: Mark D. Roth <roth@google.com>
@htuch htuch merged commit 502d9cb into envoyproxy:main Feb 2, 2021
@markdroth markdroth deleted the xds_protocol_nack branch February 2, 2021 17:49
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