Check if metabase file exists before read shard ID #1178
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#1178
Loading…
Reference in a new issue
No description provided.
Delete branch "dstepanov-yadro/frostfs-node:fix/update_shard_id"
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?
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.