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

Fix router bug where cookie is not set correctly when dynamic changes are enabled #20557

Merged

Conversation

ramr
Copy link
Contributor

@ramr ramr commented Aug 6, 2018

fixes bugz #1610712 - lil' bit of caveat here mentioned in the bugz.

/cc @openshift/sig-network-edge

@openshift-ci-robot openshift-ci-robot added sig/network-edge size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 6, 2018
@ironcladlou
Copy link
Contributor

@pravisankar PTAL

Copy link

@pravisankar pravisankar left a comment

Choose a reason for hiding this comment

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

Changes looks good but for the caveat, do you think that will be an issue when client caches cookie derived from blueprint route(pre-reload)?
Is this feasible?

  • disable dynamic-cookie backend <blueprint-route>
  • set dynamic-cookie-key backend <route-backend> ...
  • enable dynamic-cookie backend <route-backend>

@ramr
Copy link
Contributor Author

ramr commented Aug 8, 2018

@pravisankar so the problem is the cookie name is tied to the backend and we can't change it dynamically(and there's the value part issue too).
When the route is added, a candidate route from the pool of available matching blueprint routes is picked up - let's say the cookie name N1 is basically the one associated with that backend _hapcm_blueprint_<name>_route_<nn>.
Example in bugz: d4bee9152b34dbe72ebd486a984a2809

Now when the router reloads, a new actual backend is added for the route with a different
cookie name say N2.
Example in bugz: 7ffbbf18807d0b625cf2fe2e2fe0ccf4

N1 != N2
And similarly for the value of that cookie -- which is really the hash for the backend server/pod which the session will stick to - that would change as well.

As re: the changes suggested - disabling the dynamic cookies on the blueprint route disable dynamic-cookie backend <blueprint-route> will make the session go to any of the backend server pods (remember the route is associated with a service and a service can have n pods backing it).
So that disables session stickiness while we are using a blueprint pooled route (for whatever the commit interval is set to - default 1 hour). And only enables it past the reload.

So my 2c here were:

  1. Whilst we are using a blueprint route - let the session be sticky with one server pod.
  2. And once the commit/reload happens, the session will still be sticky (but it could be to another server).
    The good part on 2 is that the stickiness name and value stays forever across any future
    reloads. Could change if a pod dies/ip changes etc but that's as normal.

Copy link

@pravisankar pravisankar 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 Ram for the detailed explanation!

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 8, 2018
@ironcladlou
Copy link
Contributor

/lgtm

@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ironcladlou, pravisankar, ramr

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 8, 2018
@pravisankar
Copy link

/retest

3 similar comments
@ironcladlou
Copy link
Contributor

/retest

@ramr
Copy link
Contributor Author

ramr commented Aug 9, 2018

/retest

@ironcladlou
Copy link
Contributor

/retest

@openshift-merge-robot openshift-merge-robot merged commit 0ac9443 into openshift:master Aug 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. sig/network-edge size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants