Skip to content

Commit 2323f8a

Browse files
feat(backupspec): extend manifest with info needed for tablet restore
To support tablet aware restore, we need to back up scylla manifests, so we also need to keep track of them in manager manifest. Aside from that, tablet aware restore works with tablet keyspaces only and with scylla manifests starting from specific scylla version. Fixes https://scylladb.atlassian.net/browse/CLOUD-267
1 parent 91164b9 commit 2323f8a

1 file changed

Lines changed: 15 additions & 5 deletions

File tree

backupspec/manifest.go

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ func (m *ManifestInfo) fileNameParser(v string) error {
114114
// ManifestContent is structure containing information about the backup.
115115
type ManifestContent struct {
116116
Version string `json:"version"`
117+
ScyllaVersion string `json:"scylla_version"`
117118
ClusterName string `json:"cluster_name"`
118119
IP string `json:"ip"`
119120
Size int64 `json:"size"`
@@ -282,6 +283,7 @@ func (m *ManifestContentWithIndex) ForEachIndexIter(keyspace []string, cb func(f
282283
}
283284

284285
// ForEachIndexIterFiles performs an action for each filtered file in the index.
286+
// It targets just the FilesMeta.Files describing sstable components, but not FilesMeta.ScyllaManifests.
285287
func (m *ManifestContentWithIndex) ForEachIndexIterFiles(keyspace []string, mi *ManifestInfo, cb func(dir string, files []string)) error {
286288
return m.ForEachIndexIter(keyspace, func(fm FilesMeta) {
287289
dir := RemoteSSTableVersionDir(mi.ClusterID, mi.DC, mi.NodeID, fm.Keyspace, fm.Table, fm.Version)
@@ -314,11 +316,19 @@ type FilesInfo struct {
314316

315317
// FilesMeta contains information about SST files of particular keyspace/table.
316318
type FilesMeta struct {
317-
Keyspace string `json:"keyspace"`
318-
Table string `json:"table"`
319-
Version string `json:"version"`
320-
Files []string `json:"files"`
321-
Size int64 `json:"size"`
319+
Keyspace string `json:"keyspace"`
320+
Table string `json:"table"`
321+
// ReplicationType of keyspace.
322+
// Either "vnodes" or "tablets".
323+
ReplicationType string `json:"replication_type"`
324+
Version string `json:"version"`
325+
Files []string `json:"files"`
326+
Size int64 `json:"size"`
327+
// ScyllaManifests created by scylla on snapshot.
328+
// They are stored alongside the snapshot-ed sstables.
329+
// To avoid name collisions, their file names are prepended
330+
// with "tag_<snapshot_tag>_node_<node_ID>_" prefix.
331+
ScyllaManifests []string `json:"scylla_manifests"`
322332

323333
Path string `json:"path,omitempty"`
324334
}

0 commit comments

Comments
 (0)