Skip to content

Fixes loss of updates after multiple on-demand vhds requests#12819

Merged
htuch merged 18 commits intoenvoyproxy:masterfrom
dmitri-d:fix-vhds-updates
Sep 9, 2020
Merged

Fixes loss of updates after multiple on-demand vhds requests#12819
htuch merged 18 commits intoenvoyproxy:masterfrom
dmitri-d:fix-vhds-updates

Conversation

@dmitri-d
Copy link
Contributor

Please see #12158 for more details about the issue.

Dmitri Dolguikh added 2 commits August 25, 2020 14:29
Signed-off-by: Dmitri Dolguikh <ddolguik@redhat.com>
Signed-off-by: Dmitri Dolguikh <ddolguik@redhat.com>
@dmitri-d dmitri-d marked this pull request as draft August 25, 2020 21:48
@dmitri-d
Copy link
Contributor Author

dmitri-d commented Aug 25, 2020

The idea of this PR is to watch on prefixes used in on-demand vhds. On subscription start a watch is created using route config name as the prefix. New requests update a watch with an alias, which is removed when a reply is received; the watch retains the prefix at all times, however. Any spontaneous update for an already resolved vhost, or an update that adds a new vhost will be handled by a watch that matches the prefix in resource names contained in the update.

This bit is ugly and done to prevent sending of prefixes instead of resource names on subscription start: https://github.com/envoyproxy/envoy/pull/12819/files#diff-050ecb76fd3d458fd208a27e7c1a4e23R141. Instead, we send an empty request. This has implications on server ability to respond with a non-empty initial state.

This needs more tests.

ping @htuch, @stevenzzzz

Signed-off-by: Dmitri Dolguikh <ddolguik@redhat.com>
@dmitri-d
Copy link
Contributor Author

Also ping @chaoqin-li1123

Signed-off-by: Dmitri Dolguikh <ddolguik@redhat.com>
Copy link
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.

@dmitri-d thanks for working on this bug. I'm trying to grok the logic here, the main question I have is why do we need to go through the alias subscribe/unsubscribe dance for new resources when we don't need to do this for resource updates? If we're going to propagate all prefix matched updates to the VHDS provider, can't the VHDS provider maintain all the alias information locally? I.e. we can get watches out of the business of reasoning about aliases.

SubscriptionCallbacks& callbacks,
OpaqueResourceDecoder& resource_decoder) PURE;
OpaqueResourceDecoder& resource_decoder,
const bool use_prefix_matching) PURE;
Copy link
Member

Choose a reason for hiding this comment

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

@chaoqin-li1123 some variant of this might be useful for glob matching when subscribing to glob collections in the work you are doing. For udpa:// URLs, it's not a prefix on the path component (ignoring context parameters, which should be exact match).

@htuch htuch self-assigned this Aug 26, 2020
@dmitri-d
Copy link
Contributor Author

the main question I have is why do we need to go through the alias subscribe/unsubscribe dance for new resources when we don't need to do this for resource updates?

The thought did occur to me; delta xds is tightly coupled with watch_map and subscription-state, the dance you are referring to is a way to create xds requests without changing watch-map and subscription-state interfaces. Let me see if I can skip creation of an alias watch without changing the interfaces much.

Dmitri Dolguikh added 2 commits August 26, 2020 13:33
Signed-off-by: Dmitri Dolguikh <ddolguik@redhat.com>
Signed-off-by: Dmitri Dolguikh <ddolguik@redhat.com>
@dmitri-d
Copy link
Contributor Author

  • added requestOnDemandUpdate() grpc-mux interface that bypasses watch-map completely

@htuch: is this what you had in mind?

Copy link
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.

@dmitri-d yes, exactly, this is a really nice simplification. Can you clean up the PR for review, e.g. comments, and get CI passing? I'll give a detailed review then, but this approach looks like the right stepping stone for glob collections and fixes the VHDS issue.
/wait

Dmitri Dolguikh added 3 commits August 31, 2020 14:10
Signed-off-by: Dmitri Dolguikh <ddolguik@redhat.com>
Signed-off-by: Dmitri Dolguikh <ddolguik@redhat.com>
Signed-off-by: Dmitri Dolguikh <ddolguik@redhat.com>
Dmitri Dolguikh added 4 commits September 1, 2020 10:59
Signed-off-by: Dmitri Dolguikh <ddolguik@redhat.com>
Signed-off-by: Dmitri Dolguikh <ddolguik@redhat.com>
Signed-off-by: Dmitri Dolguikh <ddolguik@redhat.com>
Signed-off-by: Dmitri Dolguikh <ddolguik@redhat.com>
@dmitri-d dmitri-d marked this pull request as ready for review September 1, 2020 21:53
@dmitri-d dmitri-d changed the title WIP: Fixes loss of updates after multiple on-demand vhds requests Fixes loss of updates after multiple on-demand vhds requests Sep 1, 2020
@dmitri-d
Copy link
Contributor Author

dmitri-d commented Sep 1, 2020

@htuch: I think this is ready for a review.

Dmitri Dolguikh added 2 commits September 2, 2020 10:33
Signed-off-by: Dmitri Dolguikh <ddolguik@redhat.com>
Signed-off-by: Dmitri Dolguikh <ddolguik@redhat.com>
Signed-off-by: Dmitri Dolguikh <ddolguik@redhat.com>
@dmitri-d
Copy link
Contributor Author

dmitri-d commented Sep 3, 2020

  • responded to feedback

Dmitri Dolguikh added 2 commits September 3, 2020 11:16
Signed-off-by: Dmitri Dolguikh <ddolguik@redhat.com>
Signed-off-by: Dmitri Dolguikh <ddolguik@redhat.com>
@dmitri-d
Copy link
Contributor Author

dmitri-d commented Sep 4, 2020

ping @htuch

Copy link
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. @chaoqin-li1123 can you take a pass to see if this aligns with your plans around udpa:// support?

@htuch
Copy link
Member

htuch commented Sep 9, 2020

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
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 htuch merged commit 894e02a into envoyproxy:master Sep 9, 2020
@dmitri-d dmitri-d deleted the fix-vhds-updates branch September 9, 2020 16:44
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.

3 participants