Skip to content

Commit

Permalink
update rollback diagrams
Browse files Browse the repository at this point in the history
  • Loading branch information
aphralG committed Oct 25, 2024
1 parent 73eb814 commit c426bee
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 61 deletions.
11 changes: 7 additions & 4 deletions docs/architecture/config_apply.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -137,4 +139,5 @@ sequenceDiagram
```
125 changes: 68 additions & 57 deletions docs/architecture/config_apply_rollback.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

0 comments on commit c426bee

Please sign in to comment.