Check if metabase file exists before read shard ID #1178
Labels
No Label
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#1178
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "dstepanov-yadro/frostfs-node:fix/update_shard_id"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
On the first run (when metabase doesn't exist) shard ID update fails with error:
This is because frostfs-node tries to create metabase in read-only mode.
b83eb0e01f
to76cf7a051b
@ -25,6 +26,10 @@ func (db *DB) GetShardID(mode metamode.Mode) ([]byte, error) {
defer db.modeMtx.Unlock()
db.mode = mode
if _, err := os.Stat(db.info.Path); errors.Is(err, os.ErrNotExist) {
The error happens on shard ID update, but we change
ReadShardID
, which should function in RO mode. Why so?See next line:
db.openDB(mode)
creates DB file if DB doesn't exist.