Add active directory management for snapshot operations

Introduced `GetActiveDir` and `CleanActiveDir` methods in the blob store to manage a dedicated directory for active snapshot operations. This ensures a clean working state before starting new operations and prevents conflicts. Updated related logic in snapshot creation and restoration to utilize the active directory.
This commit is contained in:
2025-05-10 00:57:34 +03:00
parent 9d04f43104
commit b05058b5cd
4 changed files with 376 additions and 9 deletions

View File

@ -71,4 +71,11 @@ type BlobStore interface {
// Это может быть полезно для функций пакета archive, которые работают с путями.
// Возвращает agate.ErrNotFound, если блоб не найден.
GetBlobPath(ctx context.Context, snapshotID string) (string, error)
// GetActiveDir возвращает путь к директории для активных операций (создание и восстановление).
GetActiveDir() string
// CleanActiveDir очищает директорию для активных операций.
// Это полезно перед началом новых операций, чтобы избежать конфликтов.
CleanActiveDir(ctx context.Context) error
}