X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/9171d310942ea3c8e3bed3e21a1c2d0604e93ad6..HEAD:/services/keep-balance/main.go diff --git a/services/keep-balance/main.go b/services/keep-balance/main.go index f0b0df5bd3..ec1cb18ee1 100644 --- a/services/keep-balance/main.go +++ b/services/keep-balance/main.go @@ -32,12 +32,14 @@ func (command) RunCommand(prog string, args []string, stdin io.Reader, stdout, s flags := flag.NewFlagSet(prog, flag.ContinueOnError) flags.BoolVar(&options.Once, "once", false, "balance once and then exit") - flags.BoolVar(&options.CommitPulls, "commit-pulls", false, - "send pull requests (make more replicas of blocks that are underreplicated or are not in optimal rendezvous probe order)") - flags.BoolVar(&options.CommitTrash, "commit-trash", false, - "send trash requests (delete unreferenced old blocks, and excess replicas of overreplicated blocks)") + deprCommitPulls := flags.Bool("commit-pulls", true, + "send pull requests (must be true -- configure Collections.BalancePullLimit = 0 to disable.)") + deprCommitTrash := flags.Bool("commit-trash", true, + "send trash requests (must be true -- configure Collections.BalanceTrashLimit = 0 to disable.)") flags.BoolVar(&options.CommitConfirmedFields, "commit-confirmed-fields", true, "update collection fields (replicas_confirmed, storage_classes_confirmed, etc.)") + flags.StringVar(&options.ChunkPrefix, "chunk-prefix", "", + "operate only on blocks with the given prefix (experimental, see https://dev.arvados.org/issues/19923)") // These options are implemented by service.Command, so we // don't need the vars here -- we just need the flags // to pass flags.Parse(). @@ -53,6 +55,13 @@ func (command) RunCommand(prog string, args []string, stdin io.Reader, stdout, s return code } + if !*deprCommitPulls || !*deprCommitTrash { + fmt.Fprint(stderr, + "Usage error: the -commit-pulls or -commit-trash command line flags are no longer supported.\n", + "Use Collections.BalancePullLimit and Collections.BalanceTrashLimit instead.\n") + return cmd.EXIT_INVALIDARGUMENT + } + // Drop our custom args that would be rejected by the generic // service.Command args = nil @@ -112,7 +121,7 @@ func (command) RunCommand(prog string, args []string, stdin io.Reader, stdout, s Routes: health.Routes{"ping": srv.CheckHealth}, } - go srv.run() + go srv.run(ctx) return srv }).RunCommand(prog, args, stdin, stdout, stderr) }