forked from PaloAltoNetworks/a3s
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update: Rework orphan deletion for scale (PaloAltoNetworks#83)
Our current orphan deletion logic does not scale due to its not in approach. This rework swaps the logic to an in approach by doing the following: - On namespace deletion, a deletion record is created that will stick around for 1 day (mongo expiration time) - When an orphan job starts, it will pull all existing deletion records and delete any related objects that the service manages that are - In the namespace in the deletion record AND - Have a create time that is less than the deletion time of the record, or no create time at all Fixes: https://redlock.atlassian.net/browse/CNS-7191
- Loading branch information
Eric Powers
authored
Apr 12, 2023
1 parent
9ee31b5
commit bea9a5a
Showing
12 changed files
with
1,165 additions
and
57 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package processors | ||
|
||
import ( | ||
"go.aporeto.io/a3s/pkgs/api" | ||
"go.aporeto.io/a3s/pkgs/crud" | ||
"go.aporeto.io/bahamut" | ||
"go.aporeto.io/manipulate" | ||
) | ||
|
||
// A NamespaceDeletionRecordsProcessor is a bahamut processor for NamespaceDeletionRecord. | ||
type NamespaceDeletionRecordsProcessor struct { | ||
manipulator manipulate.Manipulator | ||
} | ||
|
||
// NewNamespaceDeletionRecordsProcessor returns a new NamespaceDeletionRecordsProcessor. | ||
func NewNamespaceDeletionRecordsProcessor(manipulator manipulate.Manipulator) *NamespaceDeletionRecordsProcessor { | ||
return &NamespaceDeletionRecordsProcessor{ | ||
manipulator: manipulator, | ||
} | ||
} | ||
|
||
// ProcessRetrieveMany handles the retrieve many requests for NamespaceDeletionRecord. | ||
func (p *NamespaceDeletionRecordsProcessor) ProcessRetrieveMany(bctx bahamut.Context) error { | ||
return crud.RetrieveMany(bctx, p.manipulator, &api.NamespaceDeletionRecordsList{}) | ||
} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.