Skip to content
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

fix(iroh-docs): ensure docs db write txn gets closed regularly under all circumstances #2474

Merged
merged 2 commits into from
Jul 8, 2024

Conversation

rklaehn
Copy link
Contributor

@rklaehn rklaehn commented Jul 8, 2024

Description

The docs db uses batching to reduce the number of write transactions. Before this, under certain circumstances (lots of activity, exclusively writes) the transaction would remain open for a long time.

This adds logic to modify to make sure that transactions will be committed when they get too old in any case.

Breaking Changes

None

Notes & open questions

Change checklist

  • Self-review.
  • Documentation updates following the style guide, if relevant.
  • Tests if relevant.
  • All breaking changes documented.

rklaehn added 2 commits July 8, 2024 15:06
basically duplicate the logic from fn tables() to fn modify() to make sure
that we commit after a short time even if we only do modify calls and no
read calls.
With this we got 3 mechanisms to force a transaction to close:

- the timeout check in tables() if you only read but have a write txn
- the timeout check in modify() if you only write
- the timer in the actor if you don't do anything at all
@rklaehn rklaehn requested a review from matheus23 July 8, 2024 12:26
@rklaehn rklaehn marked this pull request as ready for review July 8, 2024 12:26
Copy link
Member

@matheus23 matheus23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks right!

@rklaehn rklaehn added this pull request to the merge queue Jul 8, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Jul 8, 2024
@rklaehn rklaehn added this pull request to the merge queue Jul 8, 2024
Merged via the queue into main with commit 235c69c Jul 8, 2024
31 checks passed
@rklaehn rklaehn deleted the docs-store-modify-timeout branch November 20, 2024 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants