-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(backup): check when Scylla backup API can be used
Scylla backup API can be used when: - node exposes Scylla backup API - s3 is the used provider - backup won't create versioned files
- Loading branch information
1 parent
46c246d
commit 1229264
Showing
5 changed files
with
80 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright (C) 2024 ScyllaDB | ||
|
||
package backup | ||
|
||
import ( | ||
"slices" | ||
|
||
. "github.com/scylladb/scylla-manager/v3/pkg/service/backup/backupspec" | ||
) | ||
|
||
// Decides whether we should use Scylla backup API for uploading the files. | ||
func (w *worker) useScyllaBackupAPI(d snapshotDir, hi hostInfo) (bool, error) { | ||
// Scylla backup API does not handle creation of versioned files. | ||
if d.willCreateVersioned { | ||
return false, nil | ||
} | ||
// List of object storage providers supported by Scylla backup API. | ||
scyllaSupportedProviders := []Provider{ | ||
S3, | ||
} | ||
if !slices.Contains(scyllaSupportedProviders, hi.Location.Provider) { | ||
return false, nil | ||
} | ||
nc, ok := w.NodeConfig[hi.IP] | ||
if !ok { | ||
return false, errors.Errorf("no config for node %s", hi.IP) | ||
} | ||
return nc.SupportsScyllaBackupRestoreAPI() | ||
} |