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

[v14] Handle resource cleanup on termination within the inventory control stream #44224

Merged
merged 1 commit into from
Jul 18, 2024

Conversation

rosstimothy
Copy link
Contributor

Backport #43644 to branch/v14

@rosstimothy rosstimothy added backport no-changelog Indicates that a PR does not require a changelog entry labels Jul 15, 2024
@rosstimothy rosstimothy force-pushed the tross/backport-43644/v14 branch from 9c79e24 to 9366941 Compare July 17, 2024 12:29
…tream (#43644)

Historically, each component responsible for managing a particular
resource has been responsible for deleting said resources if
Teleport was shutting down for good. This is done to provide a
better user experience by trying to eliminate the chance of a
stale resource from being present for the full TTL of the backend
item. However, the mechanism to do so requires the process
responsible for the resources to delete each resource individually.
For dynamic resources this could require several thousand Delete RPCs
during shutdown. Since the shutdown process is time bound this could
result in some deletions from being successful and lead to the same
stale resource issues. This also poses a problem and races with any
inbound heartbeats being sent via the inventory control stream. All
resource deletion mechanism are unary RPCs that get processed
outside of the inventory control stream, which without careful
coordination could result in all the deletions occurring before any
in flight heartbeats are processed by the inventory control stream.

In an attempt to simplify the deletion process a new
UpstreamInventoryGoodbye message has been added to the inventory
control stream in order to allow deletion to occur in-band.
Instead of sending individual delete RPCs when a process is
terminating it can now send a single UpstreamInventoryGoodbye via
the inventory control stream. Any control streams that receive a
GoodBye prior to being terminated indicate to auth that it should
remove all resources that were being represented by said stream.
Additionally, the DownstreamInventoryHello was updated to include
supported capabilities to better coordinate backward compatibility
and supported features by the auth server. This allows the agent
to get a better understanding of what the auth server supports
without having to do a series of version checks.
@rosstimothy rosstimothy force-pushed the tross/backport-43644/v14 branch from 9366941 to 5711136 Compare July 17, 2024 12:45
@rosstimothy rosstimothy marked this pull request as ready for review July 17, 2024 13:15
@rosstimothy rosstimothy enabled auto-merge July 18, 2024 16:30
@rosstimothy rosstimothy added this pull request to the merge queue Jul 18, 2024
Merged via the queue into branch/v14 with commit 38687e1 Jul 18, 2024
34 checks passed
@rosstimothy rosstimothy deleted the tross/backport-43644/v14 branch July 18, 2024 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
application-access backport no-changelog Indicates that a PR does not require a changelog entry size/md
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants