Skip to content

Commit

Permalink
fix metaserver client panic
Browse files Browse the repository at this point in the history
  • Loading branch information
LLiuJJ committed Dec 14, 2024
1 parent 76adb1a commit a2f530a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion metaserver/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func (metaSvrCli *MetaSvrCli) Query(ver int64) *Config {
}
resp := metaSvrCli.CallDoConfigRpc(confReq)
cf := &Config{}
if resp != nil {
if resp != nil && resp.Config != nil {
cf.Version = int(resp.Config.ConfigVersion)
for i := 0; i < common.NBuckets; i++ {
cf.Buckets[i] = int(resp.Config.Buckets[i])
Expand Down
1 change: 1 addition & 0 deletions metaserver/metaserver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,5 @@ func TestAddGroups(t *testing.T) {
conf, _ := memConfStm.Query(-1)
t.Logf("%v %d", conf, i)
}
common.RemoveDir("./conf_data")
}
4 changes: 2 additions & 2 deletions tests/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ func TestClusterSingleShardRwBench(t *testing.T) {
// R-W test
shardkvcli := shardkvserver.MakeKvClient("127.0.0.1:8088,127.0.0.1:8089,127.0.0.1:8090")

N := 120
N := 64
KeySize := 64
ValSize := 64
benchKvs := map[string]string{}
Expand Down Expand Up @@ -227,7 +227,7 @@ func TestClusterRwBench(t *testing.T) {
// R-W test
shardKVCli := shardkvserver.MakeKvClient("127.0.0.1:8088,127.0.0.1:8089,127.0.0.1:8090")

N := 100
N := 64
KeySize := 64
ValSize := 64
benchKvs := map[string]string{}
Expand Down

0 comments on commit a2f530a

Please sign in to comment.