完善部署事务持久化与中断恢复
接入任务上下文、部署事务日志、启动恢复流程及恢复回归测试,保留无法证明归属时的人工核查状态。
This commit is contained in:
1 parent
3a0e1d8769
commit
918e3f6d25
6 files changed
+380
-8
No files matched your search
@@ -8,8 +8,9 @@ import (
|
||||
|
||||
// TransactionBackup 描述一次部署事务保存的旧文件。
|
||||
type TransactionBackup struct {
|
||||
Original string `json:"original"`
|
||||
Saved string `json:"saved"`
|
||||
Original string `json:"original"`
|
||||
Saved string `json:"saved"`
|
||||
OriginalExists bool `json:"original_exists"`
|
||||
}
|
||||
|
||||
// TransactionRecord 保存远程部署事务的可恢复现场,不包含证书内容或凭据。
|
||||
@@ -41,6 +42,21 @@ type TransactionJournal interface {
|
||||
ListPendingDeploymentTransactions(context.Context) ([]TransactionRecord, error)
|
||||
}
|
||||
|
||||
const (
|
||||
TransactionStatusPending = "pending"
|
||||
TransactionStatusCommitted = "committed"
|
||||
TransactionStatusRolledBack = "rolled_back"
|
||||
TransactionStatusRecoveryRequired = "recovery_required"
|
||||
|
||||
TransactionPhaseLocked = "locked"
|
||||
TransactionPhaseUploaded = "uploaded"
|
||||
TransactionPhaseReplacing = "replacing"
|
||||
TransactionPhaseInstalled = "installed"
|
||||
TransactionPhaseReloadAttempted = "reload_attempted"
|
||||
TransactionPhaseCommitted = "committed"
|
||||
TransactionPhaseRolledBack = "rolled_back"
|
||||
)
|
||||
|
||||
type transactionContextKey struct{}
|
||||
|
||||
// TransactionContext 保存任务与尝试标识,供部署层建立可追溯事务记录。
|
||||
|
||||
Reference in new issue
Block a user