From fb5e9a81397ea04568a5b1b5f5e3681875fc95cd Mon Sep 17 00:00:00 2001 From: "alex.sharov" Date: Wed, 4 Dec 2024 10:16:34 +0700 Subject: [PATCH] save --- erigon-lib/kv/mdbx/kv_mdbx.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/erigon-lib/kv/mdbx/kv_mdbx.go b/erigon-lib/kv/mdbx/kv_mdbx.go index ffd257755fa..a85d9ea54ba 100644 --- a/erigon-lib/kv/mdbx/kv_mdbx.go +++ b/erigon-lib/kv/mdbx/kv_mdbx.go @@ -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() }) } @@ -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