engine: Set Disabled mode to deleted shard #452
No reviewers
Labels
No labels
P0
P1
P2
P3
badger
frostfs-adm
frostfs-cli
frostfs-ir
frostfs-lens
frostfs-node
good first issue
triage
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-node#452
Loading…
Reference in a new issue
No description provided.
Delete branch "dstepanov-yadro/frostfs-node:fix/read_after_close_support"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
To reproduce:
frostfs-cli
set shard mode todegraded-read-only
.disabled
in config file, then SIGHUP.The following may happen:
3898ec28a2
to6ccb9b24a7
@ -140,3 +140,2 @@
func (e *StorageEngine) close(releasePools bool) error {
e.mtx.RLock()
defer e.mtx.RUnlock()
e.mtx.Lock()
I believe it is mistake so i changed type of lock
It could be mistake, but may be not:
mtx
protectse.shards
which is read here.Do you have any particular scenario in mind?
Hm, right. Reverted.
@ -175,3 +175,3 @@
for _, sh := range ss {
err := sh.Close()
err := sh.Close(true)
Disabled mode sets only when shards are deleted fron engine
@ -261,0 +260,4 @@
func (s *Shard) Close(disable bool) error {
var lastErr error
if disable {
if err := s.SetMode(mode.Disabled); err != nil {
We have exactly 1 case, where
disable == true
, why not doing it on the caller-side when needed?Right. Fixed.
@ -7,3 +8,4 @@
apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status"
)
var ErrShardDisabled = logicerr.New("shard disabled")
Error type is logic to not to count this kind of errors with error counter
6ccb9b24a7
to6867742c5c
6867742c5c
tod015178f2d
@ -160,2 +160,4 @@
return 0, ErrPiloramaDisabled
}
s.m.RLock()
I think it must be mode check too.
d015178f2d
to1cae03c47c