mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-15 08:41:02 +00:00
Merge pull request #1197 from jaten-molecula/rowcache_off_by_default
rowcache off by default. pilosa server --rowcache-on turns it back on.
This commit is contained in:
commit
d05531b77a
5 changed files with 17 additions and 15 deletions
|
|
@ -95,8 +95,8 @@ func BuildServerFlags(cmd *cobra.Command, srv *server.Command) {
|
|||
// cannot detect and honor the PILOSA_TXSRC env var over-ride.
|
||||
flags.StringVarP(&srv.Config.Txsrc, "txsrc", "", "", fmt.Sprintf("transaction/storage to use: one of roaring, rbf, bolt, lmdb, or a blue-green setup: rbf_roaring, roaring_rbf, bolt_roaring, roaring_bolt, bolt_rbf, etc. The default is: %v. The env var PILOSA_TXSRC is over-ridden by --tx option on the command line.", pilosa.DefaultTxsrc))
|
||||
|
||||
// RowcacheOff
|
||||
flags.BoolVarP((&srv.Config.RowcacheOff), "rowcache-off", "", srv.Config.RowcacheOff, "turn off the rowcache for all backends (reduces memory use)")
|
||||
// RowcacheOn
|
||||
flags.BoolVarP((&srv.Config.RowcacheOn), "rowcache-on", "", srv.Config.RowcacheOn, "turn on the rowcache for all backends (may speed some queries)")
|
||||
|
||||
// RBF specific flags. See pilosa/rbf/cfg/cfg.go for definitions.
|
||||
srv.Config.RBFConfig.DefineFlags(flags)
|
||||
|
|
|
|||
10
holder.go
10
holder.go
|
|
@ -145,8 +145,8 @@ type HolderOpts struct {
|
|||
// server.go OptServerTxsrc
|
||||
Txsrc string
|
||||
|
||||
// RowcacheOff, if true, turns off the row cache for all storage backends.
|
||||
RowcacheOff bool
|
||||
// RowcacheOn, if true, turns on the row cache for all storage backends.
|
||||
RowcacheOn bool
|
||||
}
|
||||
|
||||
func (h *Holder) StartTransaction(ctx context.Context, id string, timeout time.Duration, exclusive bool) (*Transaction, error) {
|
||||
|
|
@ -207,7 +207,7 @@ type HolderConfig struct {
|
|||
NewAttrStore func(string) AttrStore
|
||||
Logger logger.Logger
|
||||
Txsrc string
|
||||
RowcacheOff bool
|
||||
RowcacheOn bool
|
||||
|
||||
RBFConfig *rbfcfg.Config
|
||||
AntiEntropyInterval time.Duration
|
||||
|
|
@ -263,7 +263,7 @@ func NewHolder(path string, cfg *HolderConfig) *Holder {
|
|||
OpenIDAllocator: cfg.OpenIDAllocator,
|
||||
translationSyncer: cfg.TranslationSyncer,
|
||||
Logger: cfg.Logger,
|
||||
Opts: HolderOpts{Txsrc: cfg.Txsrc, RowcacheOff: cfg.RowcacheOff},
|
||||
Opts: HolderOpts{Txsrc: cfg.Txsrc, RowcacheOn: cfg.RowcacheOn},
|
||||
|
||||
SnapshotQueue: defaultSnapshotQueue,
|
||||
|
||||
|
|
@ -274,7 +274,7 @@ func NewHolder(path string, cfg *HolderConfig) *Holder {
|
|||
indexes: make(map[string]*Index),
|
||||
}
|
||||
|
||||
rbf.SetRowcacheOn(!cfg.RowcacheOff)
|
||||
rbf.SetRowcacheOn(cfg.RowcacheOn)
|
||||
|
||||
txf, err := NewTxFactory(cfg.Txsrc, path, h)
|
||||
panicOn(err)
|
||||
|
|
|
|||
10
server.go
10
server.go
|
|
@ -356,11 +356,11 @@ func OptServerTxsrc(txsrc string) ServerOption {
|
|||
}
|
||||
}
|
||||
|
||||
// OptServerRowcacheOff is a functional option on Server
|
||||
// used to turn off the row cache.
|
||||
func OptServerRowcacheOff(rowcacheOff bool) ServerOption {
|
||||
// OptServerRowcacheOn is a functional option on Server
|
||||
// used to turn on the row cache.
|
||||
func OptServerRowcacheOn(rowcacheOn bool) ServerOption {
|
||||
return func(s *Server) error {
|
||||
s.holderConfig.RowcacheOff = rowcacheOff
|
||||
s.holderConfig.RowcacheOn = rowcacheOn
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
|
@ -438,7 +438,7 @@ func NewServer(opts ...ServerOption) (*Server, error) {
|
|||
}
|
||||
s.holder = NewHolder(path, s.holderConfig)
|
||||
s.holder.Stats.SetLogger(s.logger)
|
||||
s.holder.Logger.Printf("RowCacheOff: %v", s.holderConfig.RowcacheOff)
|
||||
s.holder.Logger.Printf("RowCacheOn: %v", s.holderConfig.RowcacheOn)
|
||||
cwd, err := os.Getwd()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
|
|||
|
|
@ -201,8 +201,10 @@ type Config struct {
|
|||
// returned from the blueGreenTx.
|
||||
Txsrc string `toml:"txsrc"`
|
||||
|
||||
// RowcacheOff, if true, turns off the row cache for all storage backends.
|
||||
RowcacheOff bool `toml:"rowcache-off"`
|
||||
// RowcacheOn, if true, turns on the row cache for all storage backends.
|
||||
// The default is now off because it makes rbf queries faster and uses
|
||||
// much less memory.
|
||||
RowcacheOn bool `toml:"rowcache-on"`
|
||||
|
||||
// RBFConfig defines all externally configurable RBF flags.
|
||||
RBFConfig *rbfcfg.Config
|
||||
|
|
|
|||
|
|
@ -411,7 +411,7 @@ func (m *Command) SetupServer() error {
|
|||
pilosa.OptServerClusterName(m.Config.Cluster.Name),
|
||||
pilosa.OptServerSerializer(proto.Serializer{}),
|
||||
pilosa.OptServerTxsrc(m.Config.Txsrc),
|
||||
pilosa.OptServerRowcacheOff(m.Config.RowcacheOff),
|
||||
pilosa.OptServerRowcacheOn(m.Config.RowcacheOn),
|
||||
pilosa.OptServerRBFConfig(m.Config.RBFConfig),
|
||||
pilosa.OptServerQueryHistoryLength(m.Config.QueryHistoryLength),
|
||||
coordinatorOpt,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue