-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pkg/endpoint: make state synchronization atomic
BPF regeneration writes state into a new temporary directory. Once it has succeeded we need to swap the old and new directory. This is currently achieved by "backing up" the current state by renaming the directory. This code has a bunch of corner cases around cleaning up old directories and so on which are necessary since the synchronization isn't truly atomic. Instead, use the RENAME_EXCHANGE flag to atomically exchange the two existing directories. Also use hard links to retain existing state so that killing the agent during a synchronization doesn't lead to corruption. Signed-off-by: Lorenz Bauer <[email protected]>
- Loading branch information
Showing
2 changed files
with
15 additions
and
53 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
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