-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle resource cleanup on termination within the inventory control s…
…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.
- Loading branch information
1 parent
e22c004
commit 5205396
Showing
12 changed files
with
2,565 additions
and
1,004 deletions.
There are no files selected for viewing
This file contains 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
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.