feat: add sync checkpoint restore for last successful sync

Capture rolling online DB snapshots after push/drain/reconcile and expose SyncPage 数据恢复 plus checkpoint/restore APIs; mark Z12h and restore done in coop docs.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
whm
2026-08-06 11:49:00 +08:00
parent 75622a728e
commit 680d2b8cde
11 changed files with 860 additions and 16 deletions

View File

@@ -120,6 +120,7 @@ func (m *Manager) loop(ctx context.Context, id string) {
now := time.Now().UTC()
c.LastReconcileAt = &now
})
ScheduleCheckpoint(m.store, ch, "reconcile")
}
}
}
@@ -176,6 +177,10 @@ func (m *Manager) tick(ctx context.Context, ch *Channel) error {
c.LastError = ""
}
})
// 成功且本批有变更 → 防抖打线上库快照(数据恢复)
if err == nil && n > 0 {
ScheduleCheckpoint(m.store, ch, "drain")
}
return err
}