diff --git a/docs/architecture/config_apply.md b/docs/architecture/config_apply.md index 69f9883ae..6a65f3b37 100644 --- a/docs/architecture/config_apply.md +++ b/docs/architecture/config_apply.md @@ -64,21 +64,22 @@ sequenceDiagram File Manager Service -->>- File Plugin: writeStatus, error alt no file changes rect rgb(66, 129, 164) - File Plugin ->> File Plugin: ClearCache() File Plugin -) Message Bus: ConfigApplySuccessfulTopic - Message Bus -) File Plugin: ConfigApplySuccessfulTopic Message Bus -) Watcher Plugin: ConfigApplySuccessfulTopic Watcher Plugin ->> Watcher Plugin: FileWatcherService.SetEnabled(true) + Message Bus -) File Plugin: ConfigApplySuccessfulTopic + File Plugin ->> File Plugin: ClearCache() File Plugin -) Message Bus: DataPlaneResponseTopic Command_Status_OK Message Bus -) Command Plugin: DataPlaneResponseTopic Command_Status_OK end else has error rect rgb(166, 128, 140) - File Plugin ->> File Plugin: ClearCache() File Plugin -) Message Bus: ConfigApplyCompleteTopic Message Bus -) Watcher Plugin: ConfigApplyCompleteTopic Watcher Plugin ->> Watcher Plugin: FileWatcherService.SetEnabled(true) + Message Bus -) File Plugin: ConfigApplyCompleteTopic + File Plugin ->> File Plugin: ClearCache() File Plugin -) Message Bus: DataPlaneResponseTopic Command_Status_FAILURE Message Bus -) Command Plugin: DataPlaneResponseTopic Command_Status_FAILURE end @@ -87,10 +88,11 @@ sequenceDiagram File Plugin -) Message Bus: DataPlaneResponseTopic Command_Status_ERROR Message Bus -) Command Plugin: DataPlaneResponseTopic Command_Status_ERROR File Plugin ->> File Manager Service: Rollback(ctx, instanceID) - File Plugin ->> File Plugin: ClearCache() File Plugin -) Message Bus: ConfigApplyCompleteTopic Message Bus -) Watcher Plugin: ConfigApplyCompleteTopic Watcher Plugin ->> Watcher Plugin: FileWatcherService.SetEnabled(true) + Message Bus -) File Plugin: ConfigApplyCompleteTopic + File Plugin ->> File Plugin: ClearCache() File Plugin -) Message Bus: DataPlaneResponseTopic Command_Status_FAILURE Message Bus -) Command Plugin: DataPlaneResponseTopic Command_Status_FAILURE end @@ -137,4 +139,5 @@ sequenceDiagram + ``` diff --git a/docs/architecture/config_apply_rollback.md b/docs/architecture/config_apply_rollback.md index 1e70ecf6f..1d56542b2 100644 --- a/docs/architecture/config_apply_rollback.md +++ b/docs/architecture/config_apply_rollback.md @@ -25,66 +25,77 @@ flowchart TB # Config Apply Rollback Sequence Diagram ```mermaid sequenceDiagram - participant Command Plugin as Command Plugin - participant Message Bus as Message Bus - participant File Plugin as File Plugin - participant File Manager Service as File Manager Service - participant File Operator as File Operator - participant Resource Plugin as Resource Plugin - participant Resource Service as Resource Service - participant Instance Operator as Instance Operator - participant Log Tailer Operator as Log Tailer Operator + participant Command Plugin as Command Plugin + participant Message Bus as Message Bus + participant File Plugin as File Plugin + participant File Manager Service as File Manager Service + participant File Operator as File Operator + participant Resource Plugin as Resource Plugin + participant Resource Service as Resource Service + participant Instance Operator as Instance Operator + participant Log Tailer Operator as Log Tailer Operator - Message Bus -)+ File Plugin: ConfigApplyFailedTopic - File Plugin ->>+ File Manager Service: Rollback(ctx, instanceID) - File Manager Service ->> File Operator: Write() - File Operator -->> File Manager Service: error - File Manager Service -->>- File Plugin: error - alt error - rect rgb(166, 128, 140) - File Plugin -) Message Bus: DataPlaneResponseTopic Command_Status_ERROR - File Plugin -) Message Bus: DataPlaneResponseTopic Command_Status_FAILURE - Message Bus -) Command Plugin: DataPlaneResponseTopic Command_Status_ERROR - Message Bus -) Command Plugin: DataPlaneResponseTopic Command_Status_FAILURE + Message Bus -)+ File Plugin: ConfigApplyFailedTopic + File Plugin ->>+ File Manager Service: Rollback(ctx, instanceID) + File Manager Service ->> File Operator: Write() + File Operator -->> File Manager Service: error + File Manager Service -->>- File Plugin: error + alt error + rect rgb(166, 128, 140) + File Plugin -) Message Bus: DataPlaneResponseTopic Command_Status_ERROR + Message Bus -) Command Plugin: DataPlaneResponseTopic Command_Status_ERROR + File Plugin -) Message Bus: ConfigApplyCompleteTopic + Message Bus -) Watcher Plugin: ConfigApplyCompleteTopic + Watcher Plugin ->> Watcher Plugin: FileWatcherService.SetEnabled(true) + Message Bus -) File Plugin: ConfigApplyCompleteTopic + File Plugin ->> File Plugin: ClearCache() + File Plugin -) Message Bus: DataPlaneResponseTopic Command_Status_FAILURE + Message Bus -) Command Plugin: DataPlaneResponseTopic Command_Status_FAILURE + end + else no error + rect rgb(66, 129, 164) + File Plugin -)- Message Bus: RollbackWriteTopic + end end - else no error - rect rgb(66, 129, 164) - File Plugin -)- Message Bus: RollbackWriteTopic + Message Bus -)+ Resource Plugin: WriteConfigSuccessfulTopic + Resource Plugin ->>+ Resource Service: ApplyConfig(ctx, instanceID) + Resource Service ->>+ Instance Operator: Validate(ctx, instance) + Instance Operator ->> Instance Operator: validateConfigCheckResponse() + Instance Operator -->>- Resource Service: error + Resource Service ->>+ Instance Operator: Reload(ctx, instance) + loop monitorLogs() + Instance Operator ->>+ Log Tailer Operator: Tail(ctx, errorLog, errorChannel) + loop Tail() + Log Tailer Operator ->>- Log Tailer Operator: doesLogLineContainError(line) + Log Tailer Operator -->> Instance Operator: error + end end - end - Message Bus -)+ Resource Plugin: WriteConfigSuccessfulTopic - Resource Plugin ->>+ Resource Service: ApplyConfig(ctx, instanceID) - Resource Service ->>+ Instance Operator: Validate(ctx, instance) - Instance Operator ->> Instance Operator: validateConfigCheckResponse() - Instance Operator -->>- Resource Service: error - Resource Service ->>+ Instance Operator: Reload(ctx, instance) - loop monitorLogs() - Instance Operator ->>+ Log Tailer Operator: Tail(ctx, errorLog, errorChannel) - loop Tail() - Log Tailer Operator ->>- Log Tailer Operator: doesLogLineContainError(line) - Log Tailer Operator -->> Instance Operator: error - end - end - Instance Operator -->>- Resource Service: error - Resource Service -->>- Resource Plugin: error - alt no error - rect rgb(66, 129, 164) - Resource Plugin -) Message Bus: RollbackCompleteTopic - Resource Plugin -) Message Bus: DataPlaneResponseTopic Command_Status_FAILURE - Message Bus -) Command Plugin: DataPlaneResponseTopic Command_Status_FAILURE - Message Bus -)+ File Plugin: RollbackCompleteTopic - File Plugin ->>- File Plugin: clearCache() - end - else error - rect rgb(166, 128, 140) - Resource Plugin -) Message Bus: RollbackCompleteTopic - Resource Plugin -) Message Bus: DataPlaneResponseTopic Command_Status_ERROR - Resource Plugin -) Message Bus: DataPlaneResponseTopic Command_Status_FAILURE - Message Bus -) Command Plugin: DataPlaneResponseTopic Command_Status_ERROR - Message Bus -) Command Plugin: DataPlaneResponseTopic Command_Status_FAILURE - Message Bus -)+ File Plugin: RollbackCompleteTopic - File Plugin ->>- File Plugin: clearCache() + Instance Operator -->>- Resource Service: error + Resource Service -->>- Resource Plugin: error + alt no error + rect rgb(66, 129, 164) + Resource Plugin -) Message Bus: ConfigApplyCompleteTopic + Message Bus -) Watcher Plugin: ConfigApplyCompleteTopic + Watcher Plugin ->> Watcher Plugin: FileWatcherService.SetEnabled(true) + Message Bus -)+ File Plugin: ConfigApplyCompleteTopic + File Plugin ->>- File Plugin: clearCache() + File Plugin -) Message Bus: DataPlaneResponseTopic Command_Status_FAILURE + Message Bus -) Command Plugin: DataPlaneResponseTopic Command_Status_FAILURE + end + else error + rect rgb(166, 128, 140) + Resource Plugin -) Message Bus: ConfigApplyCompleteTopic + Message Bus -) Watcher Plugin: ConfigApplyCompleteTopic + Watcher Plugin ->> Watcher Plugin: FileWatcherService.SetEnabled(true) + Resource Plugin -) Message Bus: DataPlaneResponseTopic Command_Status_ERROR + Message Bus -) Command Plugin: DataPlaneResponseTopic Command_Status_ERROR + Message Bus -)+ File Plugin: ConfigApplyCompleteTopic + File Plugin ->> File Plugin: clearCache() + File Plugin -)- Message Bus: DataPlaneResponseTopic Command_Status_FAILURE + Message Bus -) Command Plugin: DataPlaneResponseTopic Command_Status_FAILURE + + end end - end + ```