You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description:
In Redb v2.4.0, stats() is only available on WriteTransaction, requiring an exclusive lock via begin_write(). This prevents concurrent read-only operations when another process (e.g., a server) holds the database, causing errors like Database already open. Cannot acquire lock. in downstream projects like ord.
Use Case:
In ord v0.22.2 (src/index.rs:568), info() uses:
let stats = self.database.begin_write()?.stats()?;let rtx = self.database.begin_read()?;
when the ord server runs (e.g., ./ord server), running ord index info fails with:
error: failed to open index: Database already open. Cannot acquire lock.
This happens because begin_write() conflicts with the server’s lock, even though stats() is a read-only operation.
Adding stats() method to ReadTransaction would allow read-only access to database stats without requiring an exclusive lock.
The text was updated successfully, but these errors were encountered:
stats() access state that is only available in write transaction -- the page allocation stats -- so unfortunately this can't be added to read-only transactions
Description:
In Redb v2.4.0,
stats()
is only available onWriteTransaction
, requiring an exclusive lock viabegin_write()
. This prevents concurrent read-only operations when another process (e.g., a server) holds the database, causing errors likeDatabase already open. Cannot acquire lock.
in downstream projects likeord
.Use Case:
In
ord v0.22.2
(src/index.rs:568
),info()
uses:when the ord server runs (e.g., ./ord server), running
ord index info
fails with:This happens because begin_write() conflicts with the server’s lock, even though stats() is a read-only operation.
Adding
stats()
method toReadTransaction
would allow read-only access to database stats without requiring an exclusive lock.The text was updated successfully, but these errors were encountered: