From e409ae491c8346c1e8ab52af0abd5da2a328f3da Mon Sep 17 00:00:00 2001 From: Michal-Leszczynski <74614433+Michal-Leszczynski@users.noreply.github.com> Date: Wed, 30 Oct 2024 08:36:26 +0100 Subject: [PATCH] feat(managerclient): display SM 3.4 restore flags in dry run (#4085) * feat(go.mod): bump SM submodules deps * feat(managerclient): display new restore flags in dry run Fixes #4066 --- go.mod | 6 +++--- v3/pkg/managerclient/go.mod | 5 ++--- v3/pkg/managerclient/go.sum | 16 ++++------------ v3/pkg/managerclient/model.go | 11 +++++++++++ .../scylla-manager/v3/pkg/managerclient/model.go | 11 +++++++++++ .../gen/scylla-manager/models/restore_target.go | 12 ++++++++++++ vendor/modules.txt | 6 +++--- 7 files changed, 46 insertions(+), 21 deletions(-) diff --git a/go.mod b/go.mod index 00f607d5c3..71dbcbfddc 100644 --- a/go.mod +++ b/go.mod @@ -29,9 +29,9 @@ require ( github.com/scylladb/go-reflectx v1.0.1 github.com/scylladb/go-set v1.0.2 github.com/scylladb/gocqlx/v2 v2.8.0 - github.com/scylladb/scylla-manager/v3/pkg/managerclient v0.0.0-20241017140216-d044b1738488 - github.com/scylladb/scylla-manager/v3/pkg/util v0.0.0-20241017140216-d044b1738488 - github.com/scylladb/scylla-manager/v3/swagger v0.0.0-20241017140216-d044b1738488 + github.com/scylladb/scylla-manager/v3/pkg/managerclient v0.0.0-20241028110806-78e39cceec83 + github.com/scylladb/scylla-manager/v3/pkg/util v0.0.0-20241028110806-78e39cceec83 + github.com/scylladb/scylla-manager/v3/swagger v0.0.0-20241028110806-78e39cceec83 github.com/spf13/cobra v1.8.0 github.com/spf13/pflag v1.0.5 github.com/stoewer/go-strcase v1.3.0 diff --git a/v3/pkg/managerclient/go.mod b/v3/pkg/managerclient/go.mod index 76e99f4de1..c8d246ac12 100644 --- a/v3/pkg/managerclient/go.mod +++ b/v3/pkg/managerclient/go.mod @@ -10,8 +10,8 @@ require ( github.com/lnquy/cron v1.1.1 github.com/pkg/errors v0.9.1 github.com/scylladb/go-set v1.0.2 - github.com/scylladb/scylla-manager/v3/pkg/util v0.0.0-20240926142436-6d27036d615d - github.com/scylladb/scylla-manager/v3/swagger v0.0.0-20240926142436-6d27036d615d + github.com/scylladb/scylla-manager/v3/pkg/util v0.0.0-20241028110806-78e39cceec83 + github.com/scylladb/scylla-manager/v3/swagger v0.0.0-20241028110806-78e39cceec83 github.com/scylladb/termtables v0.0.0-20191203121021-c4c0b6d42ff4 ) @@ -48,7 +48,6 @@ require ( go.uber.org/atomic v1.11.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/sync v0.8.0 // indirect - golang.org/x/tools v0.24.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/v3/pkg/managerclient/go.sum b/v3/pkg/managerclient/go.sum index 53527193d3..e0c5dd2952 100644 --- a/v3/pkg/managerclient/go.sum +++ b/v3/pkg/managerclient/go.sum @@ -84,16 +84,10 @@ github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDN github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= github.com/scylladb/go-set v1.0.2 h1:SkvlMCKhP0wyyct6j+0IHJkBkSZL+TDzZ4E7f7BCcRE= github.com/scylladb/go-set v1.0.2/go.mod h1:DkpGd78rljTxKAnTDPFqXSGxvETQnJyuSOQwsHycqfs= -github.com/scylladb/scylla-manager/v3/pkg/util v0.0.0-20240902115944-7914bb0d3b80 h1:M6M3mnFawPskN4nBnZ9MJ+k89Mqhd26xubww07uN72w= -github.com/scylladb/scylla-manager/v3/pkg/util v0.0.0-20240902115944-7914bb0d3b80/go.mod h1:+sPCx2oaOXmMpy/ODNNEDGJ7vCghBeKP4S7xEfMI+eA= -github.com/scylladb/scylla-manager/v3/pkg/util v0.0.0-20240926142436-6d27036d615d h1:9hQ+509JUYSlNyR/1C2Iy1gc36Y4Z4V+On3pn2pzcqg= -github.com/scylladb/scylla-manager/v3/pkg/util v0.0.0-20240926142436-6d27036d615d/go.mod h1:+sPCx2oaOXmMpy/ODNNEDGJ7vCghBeKP4S7xEfMI+eA= -github.com/scylladb/scylla-manager/v3/pkg/util v0.0.0-20241002155706-385fb1b05b1e h1:VFDbDzyCbFTOfJYLmLC68sIF0sWVZPos19m7RZ+U1Z8= -github.com/scylladb/scylla-manager/v3/pkg/util v0.0.0-20241002155706-385fb1b05b1e/go.mod h1:+sPCx2oaOXmMpy/ODNNEDGJ7vCghBeKP4S7xEfMI+eA= -github.com/scylladb/scylla-manager/v3/swagger v0.0.0-20240902115944-7914bb0d3b80 h1:MS2Lir2OkmpvFzfwroJC31NLLVHc8m/76SBz7+ayj1A= -github.com/scylladb/scylla-manager/v3/swagger v0.0.0-20240902115944-7914bb0d3b80/go.mod h1:Oxfuz1XcXi9iV4ggSGfQdn+p6gPz6djPOegRMMe/6/s= -github.com/scylladb/scylla-manager/v3/swagger v0.0.0-20240926142436-6d27036d615d h1:eR9FrNQLeaaBfHYlQxDJCQ3LS6Zo92ut0G+aYbzy7UQ= -github.com/scylladb/scylla-manager/v3/swagger v0.0.0-20240926142436-6d27036d615d/go.mod h1:Oxfuz1XcXi9iV4ggSGfQdn+p6gPz6djPOegRMMe/6/s= +github.com/scylladb/scylla-manager/v3/pkg/util v0.0.0-20241028110806-78e39cceec83 h1:yy3k0OEYbsmgDenYuJd7B/nftAUI7VMB/WUoX1Iv/6I= +github.com/scylladb/scylla-manager/v3/pkg/util v0.0.0-20241028110806-78e39cceec83/go.mod h1:+sPCx2oaOXmMpy/ODNNEDGJ7vCghBeKP4S7xEfMI+eA= +github.com/scylladb/scylla-manager/v3/swagger v0.0.0-20241028110806-78e39cceec83 h1:cCbhUYGzQ/xbjSN+w3g/H2ZcIoEn6OGRu3l5a+et/vs= +github.com/scylladb/scylla-manager/v3/swagger v0.0.0-20241028110806-78e39cceec83/go.mod h1:Oxfuz1XcXi9iV4ggSGfQdn+p6gPz6djPOegRMMe/6/s= github.com/scylladb/termtables v0.0.0-20191203121021-c4c0b6d42ff4 h1:8qmTC5ByIXO3GP/IzBkxcZ/99VITvnIETDhdFz/om7A= github.com/scylladb/termtables v0.0.0-20191203121021-c4c0b6d42ff4/go.mod h1:C1a7PQSMz9NShzorzCiG2fk9+xuCgLkPeCvMHYR2OWg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -118,8 +112,6 @@ golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24= -golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= diff --git a/v3/pkg/managerclient/model.go b/v3/pkg/managerclient/model.go index 7b33fa6386..68566846ad 100644 --- a/v3/pkg/managerclient/model.go +++ b/v3/pkg/managerclient/model.go @@ -461,6 +461,17 @@ Locations: Snapshot Tag: {{ .SnapshotTag }} Batch Size: {{ .BatchSize }} Parallel: {{ .Parallel }} +Transfers: {{ .Transfers }} +Compaction: {{ if .AllowCompaction -}} allowed {{ else -}} not allowed {{ end }} +Agent CPU: {{ if .UnpinAgentCPU -}} unpinned {{ else -}} pinned {{ end }} +Download Rate Limits: +{{- if .RateLimit -}} +{{ range .RateLimit }} + - {{ . }} MiB/s +{{- end }} +{{- else }} + - Unlimited +{{- end }} ` // Render implements Renderer interface. diff --git a/vendor/github.com/scylladb/scylla-manager/v3/pkg/managerclient/model.go b/vendor/github.com/scylladb/scylla-manager/v3/pkg/managerclient/model.go index fad3142ba2..d7d920f1fe 100644 --- a/vendor/github.com/scylladb/scylla-manager/v3/pkg/managerclient/model.go +++ b/vendor/github.com/scylladb/scylla-manager/v3/pkg/managerclient/model.go @@ -461,6 +461,17 @@ Locations: Snapshot Tag: {{ .SnapshotTag }} Batch Size: {{ .BatchSize }} Parallel: {{ .Parallel }} +Transfers: {{ .Transfers }} +Download Rate Limits: +{{- if .RateLimit -}} +{{ range .RateLimit }} + - {{ . }} MiB/s +{{- end }} +{{- else }} + - Unlimited +{{- end }} +Compaction Allowed: {{ .AllowCompaction }} +Agent CPU Unpinned: {{ .UnpinAgentCPU }} ` // Render implements Renderer interface. diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/restore_target.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/restore_target.go index 6fcd07fb1b..f8024c7a3a 100644 --- a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/restore_target.go +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/restore_target.go @@ -18,6 +18,9 @@ import ( // swagger:model RestoreTarget type RestoreTarget struct { + // allow compaction + AllowCompaction bool `json:"allow_compaction,omitempty"` + // batch size BatchSize int64 `json:"batch_size,omitempty"` @@ -30,15 +33,24 @@ type RestoreTarget struct { // parallel Parallel int64 `json:"parallel,omitempty"` + // rate limit + RateLimit []string `json:"rate_limit"` + // size Size int64 `json:"size,omitempty"` // snapshot tag SnapshotTag string `json:"snapshot_tag,omitempty"` + // transfers + Transfers int64 `json:"transfers,omitempty"` + // units Units []*RestoreUnit `json:"units"` + // unpin agent cpu + UnpinAgentCPU bool `json:"unpin_agent_cpu,omitempty"` + // views Views []*RestoreView `json:"views"` } diff --git a/vendor/modules.txt b/vendor/modules.txt index ebc34418b5..30af046c4d 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -395,11 +395,11 @@ github.com/scylladb/gocqlx/v2/dbutil github.com/scylladb/gocqlx/v2/migrate github.com/scylladb/gocqlx/v2/qb github.com/scylladb/gocqlx/v2/table -# github.com/scylladb/scylla-manager/v3/pkg/managerclient v0.0.0-20241017140216-d044b1738488 => ./v3/pkg/managerclient +# github.com/scylladb/scylla-manager/v3/pkg/managerclient v0.0.0-20241028110806-78e39cceec83 => ./v3/pkg/managerclient ## explicit; go 1.21.1 github.com/scylladb/scylla-manager/v3/pkg/managerclient github.com/scylladb/scylla-manager/v3/pkg/managerclient/table -# github.com/scylladb/scylla-manager/v3/pkg/util v0.0.0-20241017140216-d044b1738488 => ./v3/pkg/util +# github.com/scylladb/scylla-manager/v3/pkg/util v0.0.0-20241028110806-78e39cceec83 => ./v3/pkg/util ## explicit; go 1.21.1 github.com/scylladb/scylla-manager/v3/pkg/util github.com/scylladb/scylla-manager/v3/pkg/util/certutil @@ -431,7 +431,7 @@ github.com/scylladb/scylla-manager/v3/pkg/util/timeutc github.com/scylladb/scylla-manager/v3/pkg/util/uuid github.com/scylladb/scylla-manager/v3/pkg/util/version github.com/scylladb/scylla-manager/v3/pkg/util/workerpool -# github.com/scylladb/scylla-manager/v3/swagger v0.0.0-20241017140216-d044b1738488 => ./v3/swagger +# github.com/scylladb/scylla-manager/v3/swagger v0.0.0-20241028110806-78e39cceec83 => ./v3/swagger ## explicit; go 1.21.1 github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations