Skip to content

Commit aa89def

Browse files
author
marc
committed
address review comments
1 parent 1ec71aa commit aa89def

File tree

12 files changed

+88
-78
lines changed

12 files changed

+88
-78
lines changed

c-deps/libroach/db.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1694,6 +1694,9 @@ DBStatus DBOpen(DBEngine **db, DBSlice dir, DBOptions db_opts) {
16941694
std::shared_ptr<DBEventListener> event_listener(new DBEventListener);
16951695
options.listeners.emplace_back(event_listener);
16961696

1697+
// TODO(mberhault): we shouldn't need two separate env objects,
1698+
// options.env should be sufficient with SwitchingEnv owning any
1699+
// underlying Env.
16971700
std::unique_ptr<rocksdb::Env> memenv;
16981701
if (dir.len == 0) {
16991702
memenv.reset(rocksdb::NewMemEnv(rocksdb::Env::Default()));
@@ -1702,7 +1705,7 @@ DBStatus DBOpen(DBEngine **db, DBSlice dir, DBOptions db_opts) {
17021705

17031706
std::unique_ptr<rocksdb::Env> switching_env;
17041707
if (db_opts.use_switching_env) {
1705-
switching_env.reset(NewSwitchingEnv(options.env));
1708+
switching_env.reset(NewSwitchingEnv(options.env, options.info_log));
17061709
options.env = switching_env.get();
17071710
}
17081711

c-deps/libroach/env_switching.cc

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,15 @@
3636
*/
3737
class SwitchingEnv : public rocksdb::EnvWrapper {
3838
public:
39-
SwitchingEnv(rocksdb::Env* base_env) : rocksdb::EnvWrapper(base_env) { }
39+
SwitchingEnv(rocksdb::Env* base_env, std::shared_ptr<rocksdb::Logger> logger)
40+
: rocksdb::EnvWrapper(base_env),
41+
logger(logger) {
42+
rocksdb::Info(logger, "initialized switching env");
43+
}
44+
private:
45+
std::shared_ptr<rocksdb::Logger> logger;
4046
};
4147

42-
rocksdb::Env* NewSwitchingEnv(rocksdb::Env* base_env) {
43-
return new SwitchingEnv(base_env ? base_env : rocksdb::Env::Default());
48+
rocksdb::Env* NewSwitchingEnv(rocksdb::Env* base_env, std::shared_ptr<rocksdb::Logger> logger) {
49+
return new SwitchingEnv(base_env ? base_env : rocksdb::Env::Default(), logger);
4450
}

c-deps/libroach/env_switching.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717
#include <rocksdb/env.h>
1818

1919
// Returns a new SwitchingEnv using the passed-in env as the base.
20-
rocksdb::Env* NewSwitchingEnv(rocksdb::Env* base_env);
20+
rocksdb::Env* NewSwitchingEnv(rocksdb::Env* base_env, std::shared_ptr<rocksdb::Logger> logger);

pkg/base/store_spec.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import (
2424
"strings"
2525

2626
"github.com/dustin/go-humanize"
27+
"github.com/mberhault/cockroach/pkg/cli/cliflags"
2728
"github.com/pkg/errors"
2829
"github.com/spf13/pflag"
2930

@@ -69,9 +70,6 @@ type StoreSpec struct {
6970
// UseSwitchingEnv is true if the "switching env" store version is desired.
7071
// This is set by CCL code when encryption-at-rest is in use.
7172
UseSwitchingEnv bool
72-
// ExtraFields are arbitrary fields that may set by CCL code.
73-
// TODO(mberhault): this is probably too fragile to pass through.
74-
ExtraFields map[string]string
7573
}
7674

7775
// String returns a fully parsable version of the store spec.
@@ -256,7 +254,7 @@ var _ pflag.Value = &StoreSpecList{}
256254
func (ssl StoreSpecList) String() string {
257255
var buffer bytes.Buffer
258256
for _, ss := range ssl.Specs {
259-
fmt.Fprintf(&buffer, "--store=%s ", ss)
257+
fmt.Fprintf(&buffer, "--%s=%s ", cliflags.Store.Name, ss)
260258
}
261259
// Trim the extra space from the end if it exists.
262260
if l := buffer.Len(); l > 0 {

pkg/base/store_spec_test.go

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -34,49 +34,49 @@ func TestNewStoreSpec(t *testing.T) {
3434
expected StoreSpec
3535
}{
3636
// path
37-
{"path=/mnt/hda1", "", StoreSpec{"/mnt/hda1", 0, 0, false, roachpb.Attributes{}, false, nil}},
38-
{",path=/mnt/hda1", "", StoreSpec{"/mnt/hda1", 0, 0, false, roachpb.Attributes{}, false, nil}},
39-
{"path=/mnt/hda1,", "", StoreSpec{"/mnt/hda1", 0, 0, false, roachpb.Attributes{}, false, nil}},
40-
{",,,path=/mnt/hda1,,,", "", StoreSpec{"/mnt/hda1", 0, 0, false, roachpb.Attributes{}, false, nil}},
41-
{"/mnt/hda1", "", StoreSpec{"/mnt/hda1", 0, 0, false, roachpb.Attributes{}, false, nil}},
37+
{"path=/mnt/hda1", "", StoreSpec{"/mnt/hda1", 0, 0, false, roachpb.Attributes{}, false}},
38+
{",path=/mnt/hda1", "", StoreSpec{"/mnt/hda1", 0, 0, false, roachpb.Attributes{}, false}},
39+
{"path=/mnt/hda1,", "", StoreSpec{"/mnt/hda1", 0, 0, false, roachpb.Attributes{}, false}},
40+
{",,,path=/mnt/hda1,,,", "", StoreSpec{"/mnt/hda1", 0, 0, false, roachpb.Attributes{}, false}},
41+
{"/mnt/hda1", "", StoreSpec{"/mnt/hda1", 0, 0, false, roachpb.Attributes{}, false}},
4242
{"path=", "no value specified for path", StoreSpec{}},
4343
{"path=/mnt/hda1,path=/mnt/hda2", "path field was used twice in store definition", StoreSpec{}},
4444
{"/mnt/hda1,path=/mnt/hda2", "path field was used twice in store definition", StoreSpec{}},
4545

4646
// attributes
47-
{"path=/mnt/hda1,attrs=ssd", "", StoreSpec{"/mnt/hda1", 0, 0, false, roachpb.Attributes{Attrs: []string{"ssd"}}, false, nil}},
48-
{"path=/mnt/hda1,attrs=ssd:hdd", "", StoreSpec{"/mnt/hda1", 0, 0, false, roachpb.Attributes{Attrs: []string{"hdd", "ssd"}}, false, nil}},
49-
{"path=/mnt/hda1,attrs=hdd:ssd", "", StoreSpec{"/mnt/hda1", 0, 0, false, roachpb.Attributes{Attrs: []string{"hdd", "ssd"}}, false, nil}},
50-
{"attrs=ssd:hdd,path=/mnt/hda1", "", StoreSpec{"/mnt/hda1", 0, 0, false, roachpb.Attributes{Attrs: []string{"hdd", "ssd"}}, false, nil}},
51-
{"attrs=hdd:ssd,path=/mnt/hda1,", "", StoreSpec{"/mnt/hda1", 0, 0, false, roachpb.Attributes{Attrs: []string{"hdd", "ssd"}}, false, nil}},
47+
{"path=/mnt/hda1,attrs=ssd", "", StoreSpec{"/mnt/hda1", 0, 0, false, roachpb.Attributes{Attrs: []string{"ssd"}}, false}},
48+
{"path=/mnt/hda1,attrs=ssd:hdd", "", StoreSpec{"/mnt/hda1", 0, 0, false, roachpb.Attributes{Attrs: []string{"hdd", "ssd"}}, false}},
49+
{"path=/mnt/hda1,attrs=hdd:ssd", "", StoreSpec{"/mnt/hda1", 0, 0, false, roachpb.Attributes{Attrs: []string{"hdd", "ssd"}}, false}},
50+
{"attrs=ssd:hdd,path=/mnt/hda1", "", StoreSpec{"/mnt/hda1", 0, 0, false, roachpb.Attributes{Attrs: []string{"hdd", "ssd"}}, false}},
51+
{"attrs=hdd:ssd,path=/mnt/hda1,", "", StoreSpec{"/mnt/hda1", 0, 0, false, roachpb.Attributes{Attrs: []string{"hdd", "ssd"}}, false}},
5252
{"attrs=hdd:ssd", "no path specified", StoreSpec{}},
5353
{"path=/mnt/hda1,attrs=", "no value specified for attrs", StoreSpec{}},
5454
{"path=/mnt/hda1,attrs=hdd:hdd", "duplicate attribute given for store: hdd", StoreSpec{}},
5555
{"path=/mnt/hda1,attrs=hdd,attrs=ssd", "attrs field was used twice in store definition", StoreSpec{}},
5656

5757
// size
58-
{"path=/mnt/hda1,size=671088640", "", StoreSpec{"/mnt/hda1", 671088640, 0, false, roachpb.Attributes{}, false, nil}},
59-
{"path=/mnt/hda1,size=20GB", "", StoreSpec{"/mnt/hda1", 20000000000, 0, false, roachpb.Attributes{}, false, nil}},
60-
{"size=20GiB,path=/mnt/hda1", "", StoreSpec{"/mnt/hda1", 21474836480, 0, false, roachpb.Attributes{}, false, nil}},
61-
{"size=0.1TiB,path=/mnt/hda1", "", StoreSpec{"/mnt/hda1", 109951162777, 0, false, roachpb.Attributes{}, false, nil}},
62-
{"path=/mnt/hda1,size=.1TiB", "", StoreSpec{"/mnt/hda1", 109951162777, 0, false, roachpb.Attributes{}, false, nil}},
63-
{"path=/mnt/hda1,size=123TB", "", StoreSpec{"/mnt/hda1", 123000000000000, 0, false, roachpb.Attributes{}, false, nil}},
64-
{"path=/mnt/hda1,size=123TiB", "", StoreSpec{"/mnt/hda1", 135239930216448, 0, false, roachpb.Attributes{}, false, nil}},
58+
{"path=/mnt/hda1,size=671088640", "", StoreSpec{"/mnt/hda1", 671088640, 0, false, roachpb.Attributes{}, false}},
59+
{"path=/mnt/hda1,size=20GB", "", StoreSpec{"/mnt/hda1", 20000000000, 0, false, roachpb.Attributes{}, false}},
60+
{"size=20GiB,path=/mnt/hda1", "", StoreSpec{"/mnt/hda1", 21474836480, 0, false, roachpb.Attributes{}, false}},
61+
{"size=0.1TiB,path=/mnt/hda1", "", StoreSpec{"/mnt/hda1", 109951162777, 0, false, roachpb.Attributes{}, false}},
62+
{"path=/mnt/hda1,size=.1TiB", "", StoreSpec{"/mnt/hda1", 109951162777, 0, false, roachpb.Attributes{}, false}},
63+
{"path=/mnt/hda1,size=123TB", "", StoreSpec{"/mnt/hda1", 123000000000000, 0, false, roachpb.Attributes{}, false}},
64+
{"path=/mnt/hda1,size=123TiB", "", StoreSpec{"/mnt/hda1", 135239930216448, 0, false, roachpb.Attributes{}, false}},
6565
// %
66-
{"path=/mnt/hda1,size=50.5%", "", StoreSpec{"/mnt/hda1", 0, 50.5, false, roachpb.Attributes{}, false, nil}},
67-
{"path=/mnt/hda1,size=100%", "", StoreSpec{"/mnt/hda1", 0, 100, false, roachpb.Attributes{}, false, nil}},
68-
{"path=/mnt/hda1,size=1%", "", StoreSpec{"/mnt/hda1", 0, 1, false, roachpb.Attributes{}, false, nil}},
66+
{"path=/mnt/hda1,size=50.5%", "", StoreSpec{"/mnt/hda1", 0, 50.5, false, roachpb.Attributes{}, false}},
67+
{"path=/mnt/hda1,size=100%", "", StoreSpec{"/mnt/hda1", 0, 100, false, roachpb.Attributes{}, false}},
68+
{"path=/mnt/hda1,size=1%", "", StoreSpec{"/mnt/hda1", 0, 1, false, roachpb.Attributes{}, false}},
6969
{"path=/mnt/hda1,size=0.999999%", "store size (0.999999%) must be between 1% and 100%", StoreSpec{}},
7070
{"path=/mnt/hda1,size=100.0001%", "store size (100.0001%) must be between 1% and 100%", StoreSpec{}},
7171
// 0.xxx
72-
{"path=/mnt/hda1,size=0.99", "", StoreSpec{"/mnt/hda1", 0, 99, false, roachpb.Attributes{}, false, nil}},
73-
{"path=/mnt/hda1,size=0.5000000", "", StoreSpec{"/mnt/hda1", 0, 50, false, roachpb.Attributes{}, false, nil}},
74-
{"path=/mnt/hda1,size=0.01", "", StoreSpec{"/mnt/hda1", 0, 1, false, roachpb.Attributes{}, false, nil}},
72+
{"path=/mnt/hda1,size=0.99", "", StoreSpec{"/mnt/hda1", 0, 99, false, roachpb.Attributes{}, false}},
73+
{"path=/mnt/hda1,size=0.5000000", "", StoreSpec{"/mnt/hda1", 0, 50, false, roachpb.Attributes{}, false}},
74+
{"path=/mnt/hda1,size=0.01", "", StoreSpec{"/mnt/hda1", 0, 1, false, roachpb.Attributes{}, false}},
7575
{"path=/mnt/hda1,size=0.009999", "store size (0.009999) must be between 1% and 100%", StoreSpec{}},
7676
// .xxx
77-
{"path=/mnt/hda1,size=.999", "", StoreSpec{"/mnt/hda1", 0, 99.9, false, roachpb.Attributes{}, false, nil}},
78-
{"path=/mnt/hda1,size=.5000000", "", StoreSpec{"/mnt/hda1", 0, 50, false, roachpb.Attributes{}, false, nil}},
79-
{"path=/mnt/hda1,size=.01", "", StoreSpec{"/mnt/hda1", 0, 1, false, roachpb.Attributes{}, false, nil}},
77+
{"path=/mnt/hda1,size=.999", "", StoreSpec{"/mnt/hda1", 0, 99.9, false, roachpb.Attributes{}, false}},
78+
{"path=/mnt/hda1,size=.5000000", "", StoreSpec{"/mnt/hda1", 0, 50, false, roachpb.Attributes{}, false}},
79+
{"path=/mnt/hda1,size=.01", "", StoreSpec{"/mnt/hda1", 0, 1, false, roachpb.Attributes{}, false}},
8080
{"path=/mnt/hda1,size=.009999", "store size (.009999) must be between 1% and 100%", StoreSpec{}},
8181
// errors
8282
{"path=/mnt/hda1,size=0", "store size (0) must be larger than 640 MiB", StoreSpec{}},
@@ -86,10 +86,10 @@ func TestNewStoreSpec(t *testing.T) {
8686
{"size=123TB", "no path specified", StoreSpec{}},
8787

8888
// type
89-
{"type=mem,size=20GiB", "", StoreSpec{"", 21474836480, 0, true, roachpb.Attributes{}, false, nil}},
90-
{"size=20GiB,type=mem", "", StoreSpec{"", 21474836480, 0, true, roachpb.Attributes{}, false, nil}},
91-
{"size=20.5GiB,type=mem", "", StoreSpec{"", 22011707392, 0, true, roachpb.Attributes{}, false, nil}},
92-
{"size=20GiB,type=mem,attrs=mem", "", StoreSpec{"", 21474836480, 0, true, roachpb.Attributes{Attrs: []string{"mem"}}, false, nil}},
89+
{"type=mem,size=20GiB", "", StoreSpec{"", 21474836480, 0, true, roachpb.Attributes{}, false}},
90+
{"size=20GiB,type=mem", "", StoreSpec{"", 21474836480, 0, true, roachpb.Attributes{}, false}},
91+
{"size=20.5GiB,type=mem", "", StoreSpec{"", 22011707392, 0, true, roachpb.Attributes{}, false}},
92+
{"size=20GiB,type=mem,attrs=mem", "", StoreSpec{"", 21474836480, 0, true, roachpb.Attributes{Attrs: []string{"mem"}}, false}},
9393
{"type=mem,size=20", "store size (20) must be larger than 640 MiB", StoreSpec{}},
9494
{"type=mem,size=", "no value specified for size", StoreSpec{}},
9595
{"type=mem,attrs=ssd", "size must be specified for an in memory store", StoreSpec{}},
@@ -98,8 +98,8 @@ func TestNewStoreSpec(t *testing.T) {
9898
{"path=/mnt/hda1,type=mem,size=20GiB", "path specified for in memory store", StoreSpec{}},
9999

100100
// all together
101-
{"path=/mnt/hda1,attrs=hdd:ssd,size=20GiB", "", StoreSpec{"/mnt/hda1", 21474836480, 0, false, roachpb.Attributes{Attrs: []string{"hdd", "ssd"}}, false, nil}},
102-
{"type=mem,attrs=hdd:ssd,size=20GiB", "", StoreSpec{"", 21474836480, 0, true, roachpb.Attributes{Attrs: []string{"hdd", "ssd"}}, false, nil}},
101+
{"path=/mnt/hda1,attrs=hdd:ssd,size=20GiB", "", StoreSpec{"/mnt/hda1", 21474836480, 0, false, roachpb.Attributes{Attrs: []string{"hdd", "ssd"}}, false}},
102+
{"type=mem,attrs=hdd:ssd,size=20GiB", "", StoreSpec{"", 21474836480, 0, true, roachpb.Attributes{Attrs: []string{"hdd", "ssd"}}, false}},
103103

104104
// other error cases
105105
{"", "no value specified", StoreSpec{}},

pkg/ccl/baseccl/encryption_spec.go

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ package baseccl
1111
import (
1212
"bytes"
1313
"fmt"
14-
"strconv"
1514
"strings"
1615
"time"
1716

@@ -42,6 +41,7 @@ func (es StoreEncryptionSpec) String() string {
4241

4342
// NewStoreEncryptionSpec parses the string passed in and returns a new
4443
// StoreEncryptionSpec if parsing succeeds.
44+
// TODO(mberhault): we should share the parsing code with the StoreSpec.
4545
func NewStoreEncryptionSpec(value string) (StoreEncryptionSpec, error) {
4646
const pathField = "path"
4747
var es StoreEncryptionSpec
@@ -127,6 +127,7 @@ var _ pflag.Value = &StoreEncryptionSpecList{}
127127
func (encl StoreEncryptionSpecList) String() string {
128128
var buffer bytes.Buffer
129129
for _, ss := range encl.Specs {
130+
// TODO(mberhault): use the FlagInfo once refactored.
130131
fmt.Fprintf(&buffer, "--enterprise-encryption=%s ", ss)
131132
}
132133
// Trim the extra space from the end if it exists.
@@ -172,18 +173,12 @@ func PopulateStoreSpecWithEncryption(
172173
}
173174

174175
// Found a matching path.
175-
if storeSpecs.Specs[i].ExtraFields == nil {
176-
storeSpecs.Specs[i].ExtraFields = make(map[string]string)
177-
}
178-
if k, ok := storeSpecs.Specs[i].ExtraFields["key"]; ok {
179-
return fmt.Errorf("store with path %s already has an encryption setting: key=%s",
180-
storeSpecs.Specs[i].Path, k)
176+
if storeSpecs.Specs[i].UseSwitchingEnv {
177+
return fmt.Errorf("store with path %s already has an encryption setting",
178+
storeSpecs.Specs[i].Path)
181179
}
182180

183-
storeSpecs.Specs[i].ExtraFields["key"] = es.KeyPath
184-
storeSpecs.Specs[i].ExtraFields["old-key"] = es.OldKeyPath
185-
intSeconds := int(es.RotationPeriod.Seconds())
186-
storeSpecs.Specs[i].ExtraFields["rotation-duration"] = strconv.Itoa(intSeconds)
181+
// TODO(mberhault): figure out how to pass encryption settings through to C++-CCL.
187182
// Tell the store we absolutely need the switching env.
188183
storeSpecs.Specs[i].UseSwitchingEnv = true
189184
found = true

pkg/ccl/cliccl/start.go

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,10 @@ const (
3737
func init() {
3838
cli.StartCmd.Flags().VarP(&storeEncryptionSpecs, "enterprise-encryption", "", encryptionFlagDesc)
3939

40-
// Wrap any existing persistent hook to run inside our override function.
41-
wrapped := cli.StartCmd.PersistentPreRunE
42-
cli.StartCmd.PersistentPreRunE = func(cmd *cobra.Command, args []string) error {
43-
if wrapped != nil {
44-
if err := wrapped(cmd, args); err != nil {
45-
return err
46-
}
47-
}
40+
// Add a new pre-run command to match encryption specs to store specs.
41+
cli.AddPersistentPreRunE(cli.StartCmd, func(cmd *cobra.Command, _ []string) error {
4842
return populateStoreSpecsEncryption()
49-
}
43+
})
5044
}
5145

5246
// populateStoreSpecsEncryption is a PreRun hook that matches store encryption specs with the

pkg/cli/context.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ var serverCfg = func() server.Config {
6767

6868
// GetServerCfgStores provides direct public access to the StoreSpecList inside
6969
// serverCfg. This is used by CCL code to populate some fields.
70-
// WARNING: consider very carefully whether should should be using this.
70+
//
71+
// WARNING: consider very carefully whether you should be using this.
7172
func GetServerCfgStores() base.StoreSpecList {
7273
return serverCfg.Stores
7374
}

pkg/cli/flags.go

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,28 @@ func cmdTimeoutContext(ctx context.Context) (context.Context, func()) {
5555
return context.WithCancel(ctx)
5656
}
5757

58+
// AddPersistentPreRunE add 'fn' as a persistent pre-run function to 'cmd'.
59+
// If the command has an existing pre-run function, it is saved and will be called
60+
// at the beginning of 'fn'.
61+
// This allows an arbitrary number of pre-run functions with ordering based
62+
// on the order in which AddPersistentPreRunE is called (usually package init order).
63+
func AddPersistentPreRunE(cmd *cobra.Command, fn func(*cobra.Command, []string) error) {
64+
// Save any existing hooks.
65+
wrapped := cmd.PersistentPreRunE
66+
67+
cmd.PersistentPreRunE = func(cmd *cobra.Command, args []string) error {
68+
// Run the previous hook if it exists.
69+
if wrapped != nil {
70+
if err := wrapped(cmd, args); err != nil {
71+
return err
72+
}
73+
}
74+
75+
// Now we can call the new function.
76+
return fn(cmd, args)
77+
}
78+
}
79+
5880
const usageIndentation = 8
5981
const wrapWidth = 79 - usageIndentation
6082

@@ -171,19 +193,11 @@ func init() {
171193
return setDefaultStderrVerbosity(cmd, log.Severity_WARNING)
172194
}
173195

174-
// The following only runs for `start`.
175-
// Make sure we save and call any existing PreRun hook as well.
176-
wrapped := StartCmd.PersistentPreRunE
177-
StartCmd.PersistentPreRunE = func(cmd *cobra.Command, args []string) error {
178-
if wrapped != nil {
179-
if err := wrapped(cmd, args); err != nil {
180-
return err
181-
}
182-
}
183-
196+
// Add a pre-run command for `start`.
197+
AddPersistentPreRunE(StartCmd, func(cmd *cobra.Command, _ []string) error {
184198
extraServerFlagInit()
185199
return setDefaultStderrVerbosity(cmd, log.Severity_INFO)
186-
}
200+
})
187201

188202
// Map any flags registered in the standard "flag" package into the
189203
// top-level cockroach command.

pkg/cli/start.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -650,11 +650,6 @@ func runStart(cmd *cobra.Command, args []string) error {
650650
}
651651
for i, spec := range serverCfg.Stores.Specs {
652652
fmt.Fprintf(tw, "store[%d]:\t%s\n", i, spec)
653-
if spec.ExtraFields != nil {
654-
for k, v := range spec.ExtraFields {
655-
fmt.Fprintf(tw, " %s:\t%s\n", k, v)
656-
}
657-
}
658653
}
659654
initialBoot := s.InitialBoot()
660655
nodeID := s.NodeID()

0 commit comments

Comments
 (0)