-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* alter event history table primary key When I originally implemented this I envisioned using a single record for each "workflow" managed by Condition-Orchestrator. For example, if you did a firmware install you would get results only for the sum of the install and the following inventory, instead of a record for each condition we tried. When I started looking at implementing the corresponding changes in Condition-API and Condition-Orchestrator, I found that hooking into the "combination" event was not as natural as providing a history record for each condition being executed. However, adopting that strategy means that I needed to change the table schema. * multiple event history entries with a single id ConditionAPI and Orchestrator have a concept of "composed conditions" where several discrete actions are performed on a server. Each of these actions is tracked individually as a tuple of (condition id, condition type). Originally, I implemented event histories intending that the entry would track only the composite data (i.e. the overall success or failure along with some very limited contextual data). However, within Condition Orchestrator it is actually much easier to track each individual condition being applied. This required a change in FleetDB to remove the uniqueness constraint on event_id, and instead replace it with (event_id, event_type, target_server). This pushed some changes into the query API layer, where now querying by event-id will return all of the conditions applied using that UUID (i.e. a de-facto timeline of that request). The tests are also now adjusted to explicitly test the expected behavior of Condition Orchestrator, creating multiple history entries with different event_types. * update crdb for lint and test
- Loading branch information
Showing
13 changed files
with
171 additions
and
238 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,9 @@ | ||
-- +goose Up | ||
-- +goose StatementBegin | ||
DROP INDEX evt_history_target; | ||
-- +goose StatementEnd | ||
|
||
-- +goose Down | ||
-- +goose StatementBegin | ||
CREATE INDEX evt_history_target ON public.event_history (target_server ASC) INCLUDE (event_type, event_start, event_end); | ||
-- +goose StatementEnd |
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,13 @@ | ||
-- +goose Up | ||
-- +goose StatementBegin | ||
ALTER TABLE public.event_history DROP CONSTRAINT event_history_pkey; | ||
|
||
ALTER TABLE public.event_history ADD PRIMARY KEY (event_id, event_type, target_server); | ||
-- +goose StatementEnd | ||
|
||
-- +goose Down | ||
-- +goose StatementBegin | ||
ALTER TABLE public.event_history DROP CONSTRAINT event_history_pkey; | ||
|
||
ALTER TABLE public.event_history ADD PRIMARY KEY (event_id); | ||
-- +goose StatementEnd |
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.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Oops, something went wrong.