projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
9944: Tweak centos6 Dockerfiles to fall back to mirror if repoforge main is
[arvados.git]
/
services
/
keep-balance
/
main.go
diff --git
a/services/keep-balance/main.go
b/services/keep-balance/main.go
index 42a8d635b131f14a78f2ac7ced915a32d0f5a7f7..da4fb62a6ac8f0772e550c5eb2a103de7904ad7e 100644
(file)
--- a/
services/keep-balance/main.go
+++ b/
services/keep-balance/main.go
@@
-28,6
+28,14
@@
type Config struct {
// How often to check
RunPeriod arvados.Duration
// How often to check
RunPeriod arvados.Duration
+
+ // Number of collections to request in each API call
+ CollectionBatchSize int
+
+ // Max collections to buffer in memory (bigger values consume
+ // more memory, but can reduce store-and-forward latency when
+ // fetching pages)
+ CollectionBuffers int
}
// RunOptions controls runtime behavior. The flags/options that belong
}
// RunOptions controls runtime behavior. The flags/options that belong
@@
-43,6
+51,12
@@
type RunOptions struct {
CommitTrash bool
Logger *log.Logger
Dumper *log.Logger
CommitTrash bool
Logger *log.Logger
Dumper *log.Logger
+
+ // SafeRendezvousState from the most recent balance operation,
+ // or "" if unknown. If this changes from one run to the next,
+ // we need to watch out for races. See
+ // (*Balancer)ClearTrashLists.
+ SafeRendezvousState string
}
var debugf = func(string, ...interface{}) {}
}
var debugf = func(string, ...interface{}) {}
@@
-90,7
+104,7
@@
func main() {
if err != nil {
// (don't run)
} else if runOptions.Once {
if err != nil {
// (don't run)
} else if runOptions.Once {
- err = (&Balancer{}).Run(config, runOptions)
+
_,
err = (&Balancer{}).Run(config, runOptions)
} else {
err = RunForever(config, runOptions, nil)
}
} else {
err = RunForever(config, runOptions, nil)
}
@@
-130,7
+144,9
@@
func RunForever(config Config, runOptions RunOptions, stop <-chan interface{}) e
logger.Print("======= Consider using -commit-pulls and -commit-trash flags.")
}
logger.Print("======= Consider using -commit-pulls and -commit-trash flags.")
}
- err := (&Balancer{}).Run(config, runOptions)
+ bal := &Balancer{}
+ var err error
+ runOptions, err = bal.Run(config, runOptions)
if err != nil {
logger.Print("run failed: ", err)
} else {
if err != nil {
logger.Print("run failed: ", err)
} else {