-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Create remote site cache based on remote auth version #12130
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some comments.
@jakule Could you also take a look ?
@rosstimothy I was using this logic in my other PR, but this PR won't make a huge difference #12040. |
This PR needs to be backported as far as possible. It was actually found by a customer upgrading from v6 -> v7. I don't think any of the changes introduced here really change the logic in which clusters you can connect to. It simply changes which service in the remote cluster is used to determine its version. Using the agent version is incorrect both for determining the cache policy, and for the new use case that you added in #12040. Since the cache is generated by connecting to the auth server, and the remote watchers are all created from the cache we need to know the auth version. Things only work as is if the auth version and agent version are the same. |
In this case can we rename the function |
Yeah this could probably be named better. I believe it was initially added in v7 due to the need to support resource changes in the backend which introduced the two different remote cache policies. It looks like over the course of newer versions the name teleport/lib/reversetunnel/srv.go Line 1069 in ec82941
|
134451a
to
fbd3278
Compare
The cache policy used for a remote site is determined based on the response from a version request. However the version response was only returning the proxy version. If the remote site was not running the same version for both auth and proxy, then the cache policy chosen could be invalid. The reverse tunnel agent now pings its auth server and reports both the auth and proxy version in response to a version request. To maintain backward compatability the reverse tunnel server will fallback to using the proxy version if the response does not contain an auth version. Fixes #12010
ff7d0cb
to
ac35e46
Compare
lib/reversetunnel/agent.go
Outdated
if err != nil { | ||
log.Debugf("Failed to reply to %v request: %v.", r.Type, err) | ||
a.log.WithError(err).Debugf("Failed to ping auth server.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we increase severity level to INFO ?
In case where the ping call failed it hole addRemoteCluster operation fails so it would be nice to have insight about this.
lib/reversetunnel/agent.go
Outdated
log.Debugf("Failed to reply to %v request: %v.", r.Type, err) | ||
a.log.WithError(err).Debugf("Failed to ping auth server.") | ||
if err := r.Reply(false, []byte("Failed to retrieve auth version")); err != nil { | ||
a.log.Debugf("Failed to reply to %version request: %v.", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a.log.Debugf("Failed to reply to %version request: %v.", err) | |
a.log.Debugf("Failed to reply to %v request: %v.", r.Type, err) |
* Create remote site cache based on remote auth version The cache policy used for a remote site is determined based on the response from a version request. However the version response was only returning the proxy version. If the remote site was not running the same version for both auth and proxy, then the cache policy chosen could be invalid. The reverse tunnel agent now pings its auth server and reports both the auth version in response to a version request. Fixes #12010 (cherry picked from commit 4f2ad1f) # Conflicts: # lib/reversetunnel/srv.go
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation |
* Create remote site cache based on remote auth version The cache policy used for a remote site is determined based on the response from a version request. However the version response was only returning the proxy version. If the remote site was not running the same version for both auth and proxy, then the cache policy chosen could be invalid. The reverse tunnel agent now pings its auth server and reports both the auth version in response to a version request. Fixes #12010 (cherry picked from commit 4f2ad1f)
* Create remote site cache based on remote auth version The cache policy used for a remote site is determined based on the response from a version request. However the version response was only returning the proxy version. If the remote site was not running the same version for both auth and proxy, then the cache policy chosen could be invalid. The reverse tunnel agent now pings its auth server and reports both the auth version in response to a version request. Fixes #12010 (cherry picked from commit 4f2ad1f)
* Create remote site cache based on remote auth version The cache policy used for a remote site is determined based on the response from a version request. However the version response was only returning the proxy version. If the remote site was not running the same version for both auth and proxy, then the cache policy chosen could be invalid. The reverse tunnel agent now pings its auth server and reports both the auth version in response to a version request. Fixes #12010 (cherry picked from commit 4f2ad1f) # Conflicts: # lib/reversetunnel/srv.go
* Create remote site cache based on remote auth version The cache policy used for a remote site is determined based on the response from a version request. However the version response was only returning the proxy version. If the remote site was not running the same version for both auth and proxy, then the cache policy chosen could be invalid. The reverse tunnel agent now pings its auth server and reports both the auth version in response to a version request. Fixes #12010 (cherry picked from commit 4f2ad1f)
* Create remote site cache based on remote auth version The cache policy used for a remote site is determined based on the response from a version request. However the version response was only returning the proxy version. If the remote site was not running the same version for both auth and proxy, then the cache policy chosen could be invalid. The reverse tunnel agent now pings its auth server and reports both the auth version in response to a version request. Fixes #12010 (cherry picked from commit 4f2ad1f)
The cache policy used for a remote site is determined based on
the response from a version request. However the version response
was only returning the proxy version. If the remote site was not
running the same version for both auth and proxy, then the cache
policy chosen could be invalid.
The reverse tunnel agent now pings its auth server and reports
both the auth and proxy version in response to a version request.
To maintain backward compatibility the reverse tunnel server will
fallback to using the proxy version if the response does not
contain an auth version.
Fixes #12010