diff options
author | James Fargher <proglottis@gmail.com> | 2023-02-15 22:22:23 +0300 |
---|---|---|
committer | James Fargher <proglottis@gmail.com> | 2023-02-15 22:22:23 +0300 |
commit | dfcd599808bc659ab4fdf0efaadb606e2fe95542 (patch) | |
tree | 417e8c7546810fc5eec736ab761349aff45ec7ef | |
parent | 9b1bb2480275c22dd2157e08a2ec2f7db835657b (diff) | |
parent | c60ec202b0510b22748633f62901c5aaee0d0d98 (diff) |
Merge branch 'fix_backup_defaults' into 'master'
gitaly-backup: Use pointer layout by default
See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5378
Merged-by: James Fargher <proglottis@gmail.com>
Approved-by: Toon Claes <toon@gitlab.com>
Approved-by: Will Chandler <wchandler@gitlab.com>
Approved-by: Evan Read <eread@gitlab.com>
Reviewed-by: Evan Read <eread@gitlab.com>
Co-authored-by: James Fargher <jfargher@gitlab.com>
-rw-r--r-- | cmd/gitaly-backup/create.go | 2 | ||||
-rw-r--r-- | cmd/gitaly-backup/create_test.go | 4 | ||||
-rw-r--r-- | cmd/gitaly-backup/restore.go | 2 | ||||
-rw-r--r-- | doc/gitaly-backup.md | 6 |
4 files changed, 7 insertions, 7 deletions
diff --git a/cmd/gitaly-backup/create.go b/cmd/gitaly-backup/create.go index 1faa69446..504f17c8b 100644 --- a/cmd/gitaly-backup/create.go +++ b/cmd/gitaly-backup/create.go @@ -37,7 +37,7 @@ func (cmd *createSubcommand) Flags(fs *flag.FlagSet) { fs.StringVar(&cmd.backupPath, "path", "", "repository backup path") fs.IntVar(&cmd.parallel, "parallel", runtime.NumCPU(), "maximum number of parallel backups") fs.IntVar(&cmd.parallelStorage, "parallel-storage", 2, "maximum number of parallel backups per storage. Note: actual parallelism when combined with `-parallel` depends on the order the repositories are received.") - fs.StringVar(&cmd.layout, "layout", "legacy", "determines how backup files are located. One of legacy, pointer. Note: The feature is not ready for production use.") + fs.StringVar(&cmd.layout, "layout", "pointer", "how backup files are located. Either pointer or legacy.") fs.BoolVar(&cmd.incremental, "incremental", false, "creates an incremental backup if possible.") fs.StringVar(&cmd.backupID, "id", time.Now().UTC().Format("20060102150405"), "the backup ID used when creating a full backup.") } diff --git a/cmd/gitaly-backup/create_test.go b/cmd/gitaly-backup/create_test.go index 370291bb6..dd178a540 100644 --- a/cmd/gitaly-backup/create_test.go +++ b/cmd/gitaly-backup/create_test.go @@ -61,13 +61,13 @@ func TestCreateSubcommand(t *testing.T) { fs := flag.NewFlagSet("create", flag.ContinueOnError) cmd.Flags(fs) - require.NoError(t, fs.Parse([]string{"-path", path})) + require.NoError(t, fs.Parse([]string{"-path", path, "-id", "the-new-backup"})) require.EqualError(t, cmd.Run(ctx, &stdin, io.Discard), "create: pipeline: 1 failures encountered:\n - invalid: manager: isEmpty: could not dial source: invalid connection string: \"invalid\"\n") for _, repo := range repos { - bundlePath := filepath.Join(path, repo.RelativePath+".bundle") + bundlePath := filepath.Join(path, repo.RelativePath, "the-new-backup", "001.bundle") require.FileExists(t, bundlePath) } } diff --git a/cmd/gitaly-backup/restore.go b/cmd/gitaly-backup/restore.go index 525269464..06917a619 100644 --- a/cmd/gitaly-backup/restore.go +++ b/cmd/gitaly-backup/restore.go @@ -37,7 +37,7 @@ func (cmd *restoreSubcommand) Flags(fs *flag.FlagSet) { fs.StringVar(&cmd.backupPath, "path", "", "repository backup path") fs.IntVar(&cmd.parallel, "parallel", runtime.NumCPU(), "maximum number of parallel restores") fs.IntVar(&cmd.parallelStorage, "parallel-storage", 2, "maximum number of parallel restores per storage. Note: actual parallelism when combined with `-parallel` depends on the order the repositories are received.") - fs.StringVar(&cmd.layout, "layout", "legacy", "determines how backup files are located. One of legacy, pointer. Note: The feature is not ready for production use.") + fs.StringVar(&cmd.layout, "layout", "pointer", "how backup files are located. Either pointer or legacy.") } func (cmd *restoreSubcommand) Run(ctx context.Context, stdin io.Reader, stdout io.Writer) error { diff --git a/doc/gitaly-backup.md b/doc/gitaly-backup.md index 087bb7059..510d6fea0 100644 --- a/doc/gitaly-backup.md +++ b/doc/gitaly-backup.md @@ -50,8 +50,8 @@ Gitaly and Gitaly Cluster. | `-parallel` | integer | no | Maximum number of parallel backups. | | `-parallel-storage` | integer | no | Maximum number of parallel backups per storage. | | `-id` | string | no | Used to determine a unique path for the backup when a full backup is created. | - | `-layout` | string | no | Determines the file-system layout. Any of `legacy`, `pointer` (default `legacy`). Note: The feature is not ready for production use. | - | `-incremental` | bool | no | Determines if an incremental backup should be created. Note: The feature is not ready for production use. | + | `-layout` | string | no | How backup files are located. Either `pointer` (default) or `legacy`. | + | `-incremental` | bool | no | Indicates whether to create an incremental backup. | ## Directly restore repository data @@ -101,7 +101,7 @@ Gitaly and Gitaly Cluster. | `-path` | string | yes | Directory where the backup files are stored. | | `-parallel` | integer | no | Maximum number of parallel restores. | | `-parallel-storage` | integer | no | Maximum number of parallel restores per storage. | - | `-layout` | string | no | Determines the file-system layout. Any of `legacy`, `pointer` (default `legacy`). Note: The feature is not ready for production use. | + | `-layout` | string | no | How backup files are located. Either `pointer` (default) or `legacy`. | ## Path |