mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-15 16:51:03 +00:00
- had to make sure we don't snapshot until directive is fully applied
on a computer... otherwise there's races between loading the files and
truncating the write log.
- added a dirty bit to resources and a bool return to incrementing the
write log... don't snapshot if it returns false because that means
there's been no writes. (but make sure you close the storage transaction!)
- added the actually snapshotting routine which just fires every
<timeout> and serially snapshots everything.
- tweaked some logging
- added ability to get all tables in an org/db or literally all. I
think I just needed the "literally all", but it was natural to allow
it to be scoped to org or DB as well.
(cherry picked from commit b8b08bc9eb)
36 lines
1.1 KiB
Go
36 lines
1.1 KiB
Go
package controller
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/featurebasedb/featurebase/v3/dax/boltdb"
|
|
"github.com/featurebasedb/featurebase/v3/dax/mds/schemar"
|
|
"github.com/featurebasedb/featurebase/v3/logger"
|
|
)
|
|
|
|
type NewBalancerFn func(string, logger.Logger) Balancer
|
|
|
|
type Config struct {
|
|
Director Director
|
|
Schemar schemar.Schemar
|
|
ComputeBalancer Balancer
|
|
TranslateBalancer Balancer
|
|
|
|
StorageMethod string
|
|
BoltDB *boltdb.DB
|
|
|
|
// RegistrationBatchTimeout is the time that the controller will
|
|
// wait after a node registers itself to see if any more nodes
|
|
// will register before sending out directives to all nodes which
|
|
// have been registered.
|
|
RegistrationBatchTimeout time.Duration
|
|
|
|
// SnappingTurtleTimeout is the period on which the automatic
|
|
// snapshotting routine will run. If performing all the snapshots
|
|
// takes longer than this amount of time, snapshotting will run
|
|
// continuously. If it finishes before the timeout, it will wait
|
|
// until the timeout expires to start another round of snapshots.
|
|
SnappingTurtleTimeout time.Duration
|
|
|
|
Logger logger.Logger
|
|
}
|