-
Story
-
Resolution: Done
-
Normal
-
None
-
Product / Portfolio Work
-
8
-
False
-
-
False
-
None
-
Unset
-
None
-
-
-
As a Kessel service owner, I want to ensure requests that have already been processed as part of the replication workflows are only processed once by Inventory API. This will ensure that the version history of resources captured in reporter/common representation tables are accurate and are not filled with superfluous updates that were not requested more than once. This also ensures a better security posture, preventing previously deleted resources from being recreated and deleted again.
What needs changing?
- All outbox writes must include an event id from SP's
- All migration events processed by transforms must be generated an event id
- this ensures we dont reprocess all events if we need an incremental snapshot or if events happen during migration, theyll have unique event ids
- All requests to Inventory API must include an event ID
- Inventory API must accept an event ID as part of the request
- Event ID can be captured in representation.metadata portion of request and should be added as an optional field in proto files
- Whether this should be required in schema is TBD
- common_version is replaced with event_id in reporter_representations table and shall be updated as part of processing requests
- event_id is added to common_representations table and shall be updated as part of processing requests
Expected flow:
1. KIC receives event from SP, calls Inventory API to Report/Delete Resource, providing all data and includes an event ID
2. KIA as part of processing performs the following:
- If resource not found, create it (for ReportResource) or return 404 (for DeleteResource)
- If resource found, check the reporter/common rep tables for the event_id to ensure it has not been processed before
- If it has not – processes the request as normal, with the added step of updating the event_id in common/reporter rep tables
- If it has – does nothing, no updates to DB or outbox, returns 200
Note on event id updates in rep tables
- if only common is updated, a row will be inserted only into common_representation and eventId would be populated
- if only reporter is updated, a row will be inserted only into reporter_representation and eventId would be populated
- if both are updated, rows will be inserted into both common_representation and reporter_representation and eventId would be populated
Done Criteria
- Above required changes are implemented
- Changes are validated and align with the expected flow above
1.
|
Kessel Inventory Consumer supports Event IDs |
|
Release Pending | |
Antony Natale |
2.
|
Inventory API Event ID Processing Logic |
|
Closed | |
Antony Natale |
3.
|
Update Inventory DB schema to include Event IDs |
|
Closed | |
Antony Natale |