Skip to content

Commit d1de1f7

Browse files
author
liuminjian
committed
Merge remote-tracking branch 'origin/feat/clusterfull' into feat/clusterfull
# Conflicts: # tools-v2/pkg/cli/command/curvebs/list/unavailcopysets/unavailcopysets.go
2 parents dc1cee6 + d39e3fb commit d1de1f7

File tree

5 files changed

+50
-57
lines changed

5 files changed

+50
-57
lines changed

proto/topology.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ enum ChunkServerStatus {
4848
enum DiskState {
4949
DISKNORMAL = 0;
5050
DISKERROR = 1;
51+
DISKFULL = 2;
5152
}
5253

5354
enum OnlineState {

src/client/chunk_closure.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ void ClientClosure::Run() {
239239
break;
240240

241241
case CHUNK_OP_STATUS::CHUNK_OP_STATUS_READONLY:
242+
needRetry = true;
242243
OnReadOnly();
243244
break;
244245

src/mds/heartbeat/heartbeat_manager.cpp

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -102,40 +102,31 @@ void HeartbeatManager::UpdateChunkServerDiskStatus(
102102
// update ChunkServerState status (disk status)
103103
ChunkServerState state;
104104

105-
switch (request.diskstate().errtype())
106-
{
107-
case curve::mds::heartbeat::DISKFULL:
108-
{
105+
curve::mds::heartbeat::ErrorType errType = request.diskstate().errtype();
106+
107+
if (errType == curve::mds::heartbeat::DISKFULL) {
109108
// 当chunkserver磁盘接近满,需要将copyset availflag设为false,避免新空间从这些copyset分配
110109
CopySetFilter filter = [](const curve::mds::topology::CopySetInfo &cs) {
111110
return cs.IsAvailable();
112111
};
113112
std::vector<CopySetKey> keys = topology_->GetCopySetsInChunkServer(request.chunkserverid(), filter);
114113
for (auto key : keys) {
115-
topology_->SetCopySetAvalFlag(key, false);
114+
topology_->SetCopySetAvalFlag(key, false);
116115
}
117116
// 设置disk error,copyset就不会迁移到这个chunkserver
118-
state.SetDiskState(curve::mds::topology::DISKERROR);
117+
state.SetDiskState(curve::mds::topology::DISKFULL);
119118
LOG(ERROR) << "heartbeat report disk full error, "
120119
<< "diskused = " << request.diskused()
121120
<< "capacity = " << request.diskcapacity()
122121
<< "chunkserverid =" << request.chunkserverid();
123-
break;
124-
}
125-
126-
case curve::mds::heartbeat::NORMAL:
127-
{
122+
123+
}else if (errType == curve::mds::heartbeat::NORMAL) {
128124
state.SetDiskState(curve::mds::topology::DISKNORMAL);
129-
break;
130-
}
131-
default:
132-
{
125+
}else {
133126
state.SetDiskState(curve::mds::topology::DISKERROR);
134127
LOG(ERROR) << "heartbeat report disk error, "
135128
<< "errortype = " << request.diskstate().errtype()
136129
<< "errmsg = " << request.diskstate().errmsg();
137-
break;
138-
}
139130
}
140131

141132
state.SetDiskCapacity(request.diskcapacity());

tools-v2/go.mod

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,34 @@ module github.com/opencurve/curve/tools-v2
22

33
go 1.19
44

5-
replace github.com/optiopay/kafka => github.com/cilium/kafka v0.0.0-20180809090225-01ce283b732b
6-
75
require (
8-
github.com/cilium/cilium v1.13.7
9-
github.com/deckarep/golang-set/v2 v2.3.0
10-
github.com/docker/cli v24.0.2+incompatible
6+
github.com/cilium/cilium v1.14.3
7+
github.com/deckarep/golang-set/v2 v2.3.1
8+
github.com/docker/cli v24.0.7+incompatible
119
github.com/dustin/go-humanize v1.0.1
12-
github.com/gookit/color v1.5.3
10+
github.com/gookit/color v1.5.4
1311
github.com/moby/term v0.5.0
1412
github.com/olekukonko/tablewriter v0.0.5
1513
github.com/pkg/xattr v0.4.9
16-
github.com/schollz/progressbar/v3 v3.13.1
17-
github.com/smartystreets/goconvey v1.8.0
18-
github.com/spf13/cobra v1.7.0
14+
github.com/schollz/progressbar/v3 v3.14.0
15+
github.com/smartystreets/goconvey v1.8.1
16+
github.com/spf13/cobra v1.8.0
1917
github.com/spf13/pflag v1.0.5
20-
github.com/spf13/viper v1.16.0
21-
golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1
22-
golang.org/x/sys v0.13.0
23-
google.golang.org/grpc v1.55.0
24-
google.golang.org/protobuf v1.30.0
18+
github.com/spf13/viper v1.17.0
19+
golang.org/x/exp v0.0.0-20231108232855-2478ac86f678
20+
golang.org/x/sys v0.14.0
21+
google.golang.org/grpc v1.59.0
22+
google.golang.org/protobuf v1.31.0
2523
)
2624

2725
require (
28-
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
29-
github.com/Microsoft/go-winio v0.6.1 // indirect
30-
github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d // indirect
26+
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
27+
github.com/Microsoft/go-winio v0.6.0 // indirect
3128
github.com/beorn7/perks v1.0.1 // indirect
3229
github.com/cespare/xxhash/v2 v2.2.0 // indirect
3330
github.com/docker/distribution v2.8.2+incompatible // indirect
3431
github.com/docker/docker v24.0.2+incompatible // indirect
35-
github.com/docker/docker-credential-helpers v0.7.0 // indirect
32+
github.com/docker/docker-credential-helpers v0.8.0 // indirect
3633
github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c // indirect
3734
github.com/docker/go-connections v0.4.0 // indirect
3835
github.com/docker/go-metrics v0.0.1 // indirect
@@ -47,39 +44,42 @@ require (
4744
github.com/inconshreveable/mousetrap v1.1.0 // indirect
4845
github.com/jtolds/gls v4.20.0+incompatible // indirect
4946
github.com/magiconair/properties v1.8.7 // indirect
50-
github.com/mattn/go-runewidth v0.0.14 // indirect
47+
github.com/mattn/go-runewidth v0.0.9 // indirect
5148
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
52-
github.com/miekg/pkcs11 v1.1.1 // indirect
49+
github.com/miekg/pkcs11 v1.0.2 // indirect
5350
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect
5451
github.com/mitchellh/mapstructure v1.5.0 // indirect
5552
github.com/moby/sys/sequential v0.5.0 // indirect
5653
github.com/morikuni/aec v1.0.0 // indirect
5754
github.com/opencontainers/go-digest v1.0.0 // indirect
5855
github.com/opencontainers/image-spec v1.0.2 // indirect
59-
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
56+
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
6057
github.com/pkg/errors v0.9.1 // indirect
61-
github.com/prometheus/client_golang v1.15.1 // indirect
58+
github.com/prometheus/client_golang v1.16.0 // indirect
6259
github.com/prometheus/client_model v0.4.0 // indirect
63-
github.com/prometheus/common v0.44.0 // indirect
64-
github.com/prometheus/procfs v0.10.1 // indirect
60+
github.com/prometheus/common v0.42.0 // indirect
61+
github.com/prometheus/procfs v0.11.0 // indirect
6562
github.com/rivo/uniseg v0.4.4 // indirect
63+
github.com/sagikazarmark/locafero v0.3.0 // indirect
64+
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
6665
github.com/sirupsen/logrus v1.9.3 // indirect
67-
github.com/smartystreets/assertions v1.13.1 // indirect
68-
github.com/spf13/afero v1.9.5 // indirect
66+
github.com/smarty/assertions v1.15.0 // indirect
67+
github.com/sourcegraph/conc v0.3.0 // indirect
68+
github.com/spf13/afero v1.10.0 // indirect
6969
github.com/spf13/cast v1.5.1 // indirect
70-
github.com/spf13/jwalterweatherman v1.1.0 // indirect
71-
github.com/subosito/gotenv v1.4.2 // indirect
70+
github.com/subosito/gotenv v1.6.0 // indirect
7271
github.com/theupdateframework/notary v0.7.0 // indirect
73-
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
74-
golang.org/x/crypto v0.14.0 // indirect
75-
golang.org/x/mod v0.10.0 // indirect
76-
golang.org/x/net v0.17.0 // indirect
77-
golang.org/x/sync v0.2.0 // indirect
78-
golang.org/x/term v0.13.0 // indirect
79-
golang.org/x/text v0.13.0 // indirect
80-
golang.org/x/tools v0.9.3 // indirect
81-
google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc // indirect
72+
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 // indirect
73+
go.uber.org/multierr v1.11.0 // indirect
74+
golang.org/x/crypto v0.15.0 // indirect
75+
golang.org/x/mod v0.14.0 // indirect
76+
golang.org/x/net v0.18.0 // indirect
77+
golang.org/x/sync v0.5.0 // indirect
78+
golang.org/x/term v0.14.0 // indirect
79+
golang.org/x/text v0.14.0 // indirect
80+
golang.org/x/tools v0.15.0 // indirect
81+
google.golang.org/genproto/googleapis/rpc v0.0.0-20230920204549-e6e6cdab5c13 // indirect
8282
gopkg.in/ini.v1 v1.67.0 // indirect
8383
gopkg.in/yaml.v3 v3.0.1 // indirect
84-
gotest.tools/v3 v3.0.3 // indirect
84+
gotest.tools/v3 v3.5.1 // indirect
8585
)

tools-v2/pkg/cli/command/curvebs/list/unavailcopysets/unavailcopysets.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ func (uCmd *UnAvailCopySetsCommand) RunCommand(cmd *cobra.Command, args []string
125125
rows := make([]map[string]string, 0)
126126
for _, info := range response.Copysets {
127127
row := make(map[string]string)
128-
row[cobrautil.ROW_LOGICALPOOL] = fmt.Sprintf("%d", info.LogicalPoolId)
129-
row[cobrautil.ROW_COPYSET] = fmt.Sprintf("%d", info.CopysetId)
128+
row[cobrautil.ROW_LOGICALPOOL] = fmt.Sprintf("%d", info.GetLogicalPoolId())
129+
row[cobrautil.ROW_COPYSET] = fmt.Sprintf("%d", info.GetCopysetId())
130130
rows = append(rows, row)
131131
}
132132
list := cobrautil.ListMap2ListSortByKeys(rows, uCmd.Header, []string{

0 commit comments

Comments
 (0)