Skip to content

Commit eebb2af

Browse files
committed
rename vars
1 parent 938dba3 commit eebb2af

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

debug/spacechecker/spacechecker.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ func (s *spaceChecker) Fix(ctx context.Context, spaceId string) (Result, error)
107107
indexStorage := s.storageService.IndexStorage()
108108

109109
switch {
110-
// C:Removed, L: not removed or E:true - remove space and switch local status
110+
// coordStatus: removed, localStatus: not removed or storageExists: true - remove space and switch local status
111111
case coordStatus == "removed" && (localStatus != "removed" || storageExists):
112112
if storageExists {
113113
err = s.storageService.DeleteSpaceStorage(ctx, spaceId)
@@ -125,7 +125,7 @@ func (s *spaceChecker) Fix(ctx context.Context, spaceId string) (Result, error)
125125
}
126126
res.IsFixed = true
127127

128-
// C:prepRemove, L: not prep remove - switch local status
128+
// coordStatus: remPrepare, localStatus: not remPrepare - switch local status
129129
case coordStatus == "remPrepare" && localStatus != "remPrepare":
130130
err = indexStorage.SetSpaceStatus(ctx, spaceId, nodestorage.SpaceStatusRemovePrepare, "")
131131
if err != nil {
@@ -134,7 +134,7 @@ func (s *spaceChecker) Fix(ctx context.Context, spaceId string) (Result, error)
134134
res.Log = append(res.Log, "fix: set local status to remPrepare")
135135
res.IsFixed = true
136136

137-
// C:Ok, L:Ok, R:false - set notResponsible, move storage if exists
137+
// coordStatus: ok, localStatus: ok, isResponsible: false - set notResponsible, move storage if exists
138138
case coordStatus == "ok" && localStatus == "ok" && !isResponsible:
139139
err = indexStorage.SetSpaceStatus(ctx, spaceId, nodestorage.SpaceStatusNotResponsible, "")
140140
if err != nil {
@@ -197,19 +197,19 @@ func (s *spaceChecker) validate(res *Result, localStr string, coordStr string) {
197197

198198
valid := false
199199
switch {
200-
// C: ok, L: ok, R: true, E: true
200+
// coordStatus: ok, localStatus: ok, isResponsible: true, storageExists: true
201201
case coordStatus == "ok" && localStatus == "ok" && isResponsible && storageExists:
202202
valid = true
203-
// C: ok, L: archived, R: true, E: false
203+
// coordStatus: ok, localStatus: archived, isResponsible: true, storageExists: false
204204
case coordStatus == "ok" && localStatus == "archived" && isResponsible && !storageExists:
205205
valid = true
206-
// C: remPrepare, L: remPrepare, R: true, E: true
206+
// coordStatus: remPrepare, localStatus: remPrepare, isResponsible: true, storageExists: true
207207
case coordStatus == "remPrepare" && localStatus == "remPrepare" && isResponsible && storageExists:
208208
valid = true
209-
// C: remPrepare, L: remPrepare, R: false, E: false
209+
// coordStatus: remPrepare, localStatus: remPrepare, isResponsible: false, storageExists: false
210210
case coordStatus == "remPrepare" && localStatus == "remPrepare" && !isResponsible && !storageExists:
211211
valid = true
212-
// C: removed, L: removed, E: false
212+
// coordStatus: removed, localStatus: removed, storageExists: false
213213
case coordStatus == "removed" && localStatus == "removed" && !storageExists:
214214
valid = true
215215
}

0 commit comments

Comments
 (0)