Skip to content

Commit

Permalink
save
Browse files Browse the repository at this point in the history
  • Loading branch information
AskAlexSharov committed Dec 4, 2024
1 parent 3fc035f commit fb5e9a8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions erigon-lib/kv/mdbx/kv_mdbx.go
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,9 @@ func (db *MdbxKV) openDBIs(ctx context.Context, buckets []string) error {
return err
}
}
return tx.(*MdbxTx).Commit() // when open db as read-only, commit of this RO transaction is required
// when open db as read-only, commit of this RO transaction is required.
// it's weird - opening DBI on RO-db is "write/mutation operation" - which will be rolled-back if not committed.
return tx.(*MdbxTx).Commit()
})
}

Expand All @@ -488,7 +490,9 @@ func (db *MdbxKV) openDBIs(ctx context.Context, buckets []string) error {
return err
}
}
return tx.(*MdbxTx).Commit() // when open db as read-only, commit of this RO transaction is required
// when open db as read-only, commit of this RO transaction is required.
// it's weird - opening DBI on RO-db is "write/mutation operation" - which will be rolled-back if not committed.
return tx.(*MdbxTx).Commit()
})
if err == nil { // success
return nil
Expand Down

0 comments on commit fb5e9a8

Please sign in to comment.