move client policy discovery out of HTTP logical stack#2035
Merged
hawkw merged 6 commits intoeliza/client-policy-apifrom Dec 6, 2022
Merged
move client policy discovery out of HTTP logical stack#2035hawkw merged 6 commits intoeliza/client-policy-apifrom
hawkw merged 6 commits intoeliza/client-policy-apifrom
Conversation
Base automatically changed from
eliza/route-splitting
to
eliza/client-policy-api
December 6, 2022 17:35
042dda0 to
d893b68
Compare
This branch refactors the prototype client policy code to move the discovery of client policies to still occur after profile discovery, but before the HTTP logical stack. This means that SO_ORIGINAL_DST addresses need not be stored in the `Logical` target type any longer, which I think is significantly nicer, as we no longer have a `Logical` field that's ignored by hashing and equality. Instead, the client policy discovery now occurs in the `switch_logical` stack. This is also not my _favorite_ for it, because now that stack is responsible for more than just switching based on whether or not a logical destination exists...but maybe the solution is just to rename that stack. However, with the current structure of the outbound proxy, if we want `push_switch_logical` to push a stack that outptus a `Logical` target, client policy discovery has to occur there, because we would want to perform client policy lookups prior to constructing the `Logical` target type, while we still have an `OrigDstAddr`. Alternatively, we could have that stack output a different target type, and push a client policy discovery stack that consumes that target type and constructs a `Logical` target, but this felt like the simplest approach that didn't require propagating the `OrigDstAddr` via the `Logical` target (like we were doing previously). Depends on #2029
This seems like the actual correct place...
8eeeb3d to
0e74440
Compare
hawkw
added a commit
that referenced
this pull request
Dec 6, 2022
This branch refactors the prototype client policy code to move the discovery of client policies to still occur after profile discovery, but before the HTTP logical stack. This means that SO_ORIGINAL_DST addresses need not be stored in the `Logical` target type any longer, which I think is significantly nicer, as we no longer have a `Logical` field that's ignored by hashing and equality. Instead, the client policy discovery now occurs in the stack produced by `push_discover`. This is conceptually much more correct. In addition, it allows us to remove the separate caching logic for client policy lookups, and just use the same per-original-destination-address cache that's used for service profile lookups. This simplifies the policy code significantly, and allows moving stuff back out of `linkerd-app-outbound` and into `linkerd-client-policy`, since the policy receiver need no longer be wrapped in a `Cached` handle. Depends on #2034
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This branch refactors the prototype client policy code to move the
discovery of client policies to still occur after profile discovery, but
before the HTTP logical stack. This means that SO_ORIGINAL_DST addresses
need not be stored in the
Logicaltarget type any longer, which Ithink is significantly nicer, as we no longer have a
Logicalfieldthat's ignored by hashing and equality.
Instead, the client policy discovery now occurs in the stack produced by
push_discover. This is conceptually much more correct. In addition, itallows us to remove the separate caching logic for client policy
lookups, and just use the same per-original-destination-address cache
that's used for service profile lookups. This simplifies the policy code
significantly, and allows moving stuff back out of
linkerd-app-outboundand intolinkerd-client-policy, since thepolicy receiver need no longer be wrapped in a
Cachedhandle.Depends on #2034