-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UTxO-HD Ledger DB lock tweaks #43
Labels
Comments
This was referenced Mar 6, 2023
11 tasks
11 tasks
This was referenced Apr 3, 2023
The code has been ported, but I'm finding issues in many test-suites. Perhaps I introduced a logic bug. In any case, I think as access to the BackingStore is performed in several places, we should document somewhere the places where this happens. |
This was referenced May 29, 2023
jasagredo
added a commit
that referenced
this issue
Jun 2, 2023
# Description Rework the locking logic for the ledger DB RAW lock. There are mainly 4 places where locking happens: - background thread that flushes regularly: uses a **write** lock while writing the differences only. - background thread that creates snapshots: holds a **read** lock for the duration of the snapshot - forging loop: **quick read** locking to acquire a ledger db and a value handle to get a snapshot - queries: **quick read** locking to acquire a ledger db and a value handle This should reduce locking issues. There are also some side effects in the PR: - the forging loop is again a `WithEarlyExit` block - getting a snapshot can no longer fail s you provide the chlog and the value handle - new policy function `onDiskShouldFlush` Closes #43
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
After today's meeting, several next steps came up to reduce the locking of the Ledger DB in the UTxO-HD implementation.
The reason for the lock
The LedgerDB lock is introduced to make sure that whenever we acquire a
DbChangelog
and read theBackingStore
, these two values are in agreement, in particular that the anchor of theDbChangelog
is indeed the slot that was flushed to theBackingStore
.It is the case that LMDB allows for consistent views of the database as long as a transaction is kept open. We therefore can make use of this feature to "acquire" a transaction and release the lock of the DB.
Places that need to change
Done?
To consider this done, it should be the case that after implementing the changes above, the system level benchmarks show a reasonable amount of locking (perhaps even minimal if things go according to plan).
The prevision for starting this is once the cleanup branch of UTxO-HD is complete.
The text was updated successfully, but these errors were encountered: