From 06eb3afaaaeaf78588719d335d5902fca1144e8e Mon Sep 17 00:00:00 2001 From: "Jason E. Aten" Date: Wed, 18 Nov 2020 18:21:31 +0000 Subject: [PATCH 1/2] use pilosa server --txsrc to prevent viper env var shadowing from stopping PILOSA_TXSRC getting through --- ctl/server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ctl/server.go b/ctl/server.go index 129556b23..1a0754486 100644 --- a/ctl/server.go +++ b/ctl/server.go @@ -92,7 +92,7 @@ func BuildServerFlags(cmd *cobra.Command, srv *server.Command) { // Transactional storage engine // Note: the default for --tx must be kept "" empty string. Otherwise we // cannot detect and honor the PILOSA_TXSRC env var over-ride. - flags.StringVarP(&srv.Config.Txsrc, "tx", "", "", 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)) + 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)") From 524c78623f4f57d52caaba081602ee3422577032 Mon Sep 17 00:00:00 2001 From: "Jason E. Aten" Date: Wed, 18 Nov 2020 18:53:22 +0000 Subject: [PATCH 2/2] repair pilosa/ctl/server_test too --- ctl/server_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ctl/server_test.go b/ctl/server_test.go index a1ce06ed8..81f49a5fd 100644 --- a/ctl/server_test.go +++ b/ctl/server_test.go @@ -42,7 +42,7 @@ func TestServerDefaultTxsrcFlags(t *testing.T) { stdin, stdout, stderr := GetIO(buf) Server := server.NewCommand(stdin, stdout, stderr) BuildServerFlags(cm, Server) - if cm.Flags().Lookup("tx").DefValue != "" { - t.Fatal("cannot set the tx default in ctl/server.go, otherwise we won't know to let the environment override the lack of --tx on the command line. We want explicit command line --tx to override the env value.") + if cm.Flags().Lookup("txsrc").DefValue != "" { + t.Fatal("cannot set the txsrc default in ctl/server.go, otherwise we won't know to let the environment override the lack of --txsrc on the command line. We want explicit command line --txsrc to override the env value.") } }