diff --git a/index.go b/index.go index 7361df02c..1474616bc 100644 --- a/index.go +++ b/index.go @@ -85,19 +85,20 @@ func NewIndex(holder *Holder, path, name string) (*Index, error) { // Warning: won't work for the tests to say: // txsrc := holder.Opts.Txsrc // WILL BREAK TESTS + // For *most* of the tests and in a production pilosa server run, we expect that + // if holder.opts.Txsrc is set, it will be the exact same as PILOSA_TXSRC. + // Unfortunately there are some tests where that won't hold. + // So if the env var PILOSA_TXSRC *is* set, we always give it precedence. + // This lets `PILOSA_TXSRC=rbf go test -v -run "one_of_my_RBF_tests"` succeed. if txsrc == "" { - // nothing in the env for PILOSA_TXSRC; therefore not running under a "make topt.badger" for example. + // nothing in the env for PILOSA_TXSRC; therefore not running under a "make topt.rbf" for example. if holder.Opts.Txsrc != "" { - // most of the tests and production run, we expect that if holder.opts.Txsrc is set, it - // will be the exact same as PILOSA_TXSRC. Unfortunately there are tests where that won't hold. - // So if the env var PILOSA_TXSRC *is* set, we always give it precedence. - // This lets `PILOSA_TXSRC=rbf go test -v -run "one_of_my_RBF_tests"` succeed. - // txsrc = holder.Opts.Txsrc } else { txsrc = DefaultTxsrc } } + txf, err := newTxFactory(txsrc, path) if err != nil { return nil, errors.Wrap(err, "creating newTxFactory") diff --git a/server/config.go b/server/config.go index ca5817fd0..2da11a365 100644 --- a/server/config.go +++ b/server/config.go @@ -24,7 +24,6 @@ import ( "strings" "time" - "github.com/pilosa/pilosa/v2" "github.com/pilosa/pilosa/v2/gossip" "github.com/pilosa/pilosa/v2/toml" "github.com/pkg/errors" @@ -236,8 +235,6 @@ func NewConfig() *Config { c.Profile.BlockRate = 10000000 // 1 sample per 10 ms c.Profile.MutexFraction = 100 // 1% sampling - c.Txsrc = pilosa.DefaultTxsrc - return c }