fix(host): backup guest dirty shutdown (#19620)

backup guest dirty shutdown master request sync status,
slave request dirty start.
This commit is contained in:
wanyaoqi
2024-03-06 02:21:49 +08:00
committed by GitHub
parent 3e1e6a736b
commit 023c365c60
+5 -2
View File
@@ -920,8 +920,11 @@ func (s *SKVMGuestInstance) ImportServer(pendingDelete bool) {
if s.IsDirtyShotdown() && !pendingDelete {
log.Infof("Server dirty shutdown or a daemon %s", s.GetName())
if s.Desc.IsMaster || s.Desc.IsSlave ||
len(s.GetNeedMergeBackingFileDiskIndexs()) > 0 {
if len(s.GetNeedMergeBackingFileDiskIndexs()) > 0 {
go s.DirtyServerRequestStart()
} else if s.Desc.IsMaster {
go s.SyncStatus("Server dirty shutdown")
} else if s.Desc.IsSlave {
go s.DirtyServerRequestStart()
} else {
s.StartGuest(context.Background(), nil, jsonutils.NewDict())