Move shard to degraded mode if metabase open failed #918
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
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-node#918
Loading…
Reference in a new issue
No description provided.
Delete branch "dstepanov-yadro/frostfs-node:fix/degraded_mode"
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?
After this fix shard will move to degrared read only mode if metabase open failed.
Before fix: update shard id failed, only one shard out of two was attached
After fix:
If metabase file locked for write, shard will open in read only mode:
If metabase file locked for read and write, shard will open in degraded read only mode:
1835e7cbe0
tobc348e7e8b
bc348e7e8b
to237ba80db5
237ba80db5
tod9208294ef
The thing we should also check is the behaviour in case blobstor cannot be opened -- shard should be disabled.
@ -128,4 +128,1 @@
_, err := e.AddShard(context.Background(), opts...)
if errOnAdd {
require.Error(t, err)
// This branch is only taken when we cannot update shard ID in the metabase.
This comment was wrong?
Yes. I think the source of this comment is the current behavior but not the right behavior.
@ -51,0 +42,4 @@
defer func() {
cErr := s.metaBase.Close()
if cErr != nil {
err = fmt.Errorf("failed to close metabase: %w", cErr)
We discussed but haven't come to conclusion: do we need
failed to
in the error text? It will probably be in the log message anyway.Now there are both variant in code
See
shard/control.go
: it should work as you described.d9208294ef
to931a5e9aaf