projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
21204: Merge branch '21204-stable-log-sort' from arvados-workbench2.git
[arvados.git]
/
services
/
keep-balance
/
server.go
diff --git
a/services/keep-balance/server.go
b/services/keep-balance/server.go
index fd53497f789ed4f5f1db458f99e69f8e7f10c1a7..480791ffa2637da8f282fb28507dbbcb046bcfbf 100644
(file)
--- a/
services/keep-balance/server.go
+++ b/
services/keep-balance/server.go
@@
-27,9
+27,8
@@
import (
// RunOptions fields are controlled by command line flags.
type RunOptions struct {
Once bool
// RunOptions fields are controlled by command line flags.
type RunOptions struct {
Once bool
- CommitPulls bool
- CommitTrash bool
CommitConfirmedFields bool
CommitConfirmedFields bool
+ ChunkPrefix string
Logger logrus.FieldLogger
Dumper logrus.FieldLogger
Logger logrus.FieldLogger
Dumper logrus.FieldLogger
@@
-86,6
+85,7
@@
func (srv *Server) runOnce(ctx context.Context) (*Balancer, error) {
Dumper: srv.Dumper,
Metrics: srv.Metrics,
LostBlocksFile: srv.Cluster.Collections.BlobMissingReport,
Dumper: srv.Dumper,
Metrics: srv.Metrics,
LostBlocksFile: srv.Cluster.Collections.BlobMissingReport,
+ ChunkPrefix: srv.RunOptions.ChunkPrefix,
}
var err error
srv.RunOptions, err = bal.Run(ctx, srv.ArvClient, srv.Cluster, srv.RunOptions)
}
var err error
srv.RunOptions, err = bal.Run(ctx, srv.ArvClient, srv.Cluster, srv.RunOptions)
@@
-98,9
+98,7
@@
func (srv *Server) runForever(ctx context.Context) error {
ticker := time.NewTicker(time.Duration(srv.Cluster.Collections.BalancePeriod))
ticker := time.NewTicker(time.Duration(srv.Cluster.Collections.BalancePeriod))
- // The unbuffered channel here means we only hear SIGUSR1 if
- // it arrives while we're waiting in select{}.
- sigUSR1 := make(chan os.Signal)
+ sigUSR1 := make(chan os.Signal, 1)
signal.Notify(sigUSR1, syscall.SIGUSR1)
logger.Info("acquiring service lock")
signal.Notify(sigUSR1, syscall.SIGUSR1)
logger.Info("acquiring service lock")
@@
-110,9
+108,9
@@
func (srv *Server) runForever(ctx context.Context) error {
logger.Printf("starting up: will scan every %v and on SIGUSR1", srv.Cluster.Collections.BalancePeriod)
for {
logger.Printf("starting up: will scan every %v and on SIGUSR1", srv.Cluster.Collections.BalancePeriod)
for {
- if
!srv.RunOptions.CommitPulls && !srv.RunOptions.CommitTrash
{
+ if
srv.Cluster.Collections.BalancePullLimit < 1 && srv.Cluster.Collections.BalanceTrashLimit < 1
{
logger.Print("WARNING: Will scan periodically, but no changes will be committed.")
logger.Print("WARNING: Will scan periodically, but no changes will be committed.")
- logger.Print("=======
Consider using -commit-pulls and -commit-trash flags
.")
+ logger.Print("=======
To commit changes, set BalancePullLimit and BalanceTrashLimit values greater than zero
.")
}
if !dblock.KeepBalanceService.Check() {
}
if !dblock.KeepBalanceService.Check() {