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 SQLite deadlocks #521

Merged
merged 4 commits into from
Sep 22, 2022
Merged

fix SQLite deadlocks #521

merged 4 commits into from
Sep 22, 2022

Conversation

ghubertpalo
Copy link
Collaborator

@ghubertpalo ghubertpalo commented Sep 21, 2022

Content

Applies to your base code, this patch will:

  • remove SQL explicit transaction by using DELETE … RETURNING SQL statements
  • apply a wait & retry strategy to deal with database locking mechanism

Pre-submit checklist

  • Branch
    • Tests are provided (if possible)
    • Commit sequence broadly makes sense
    • Key commits have useful messages
  • PR
    • No clippy warnings in the CI
    • Self-reviewed the diff
    • Useful pull request description
    • Reviewer requested
  • Documentation
    • Update README file (if relevant)
    • Update documentation website (if relevant)
    • Add dev blog post (if relevant)

Comments

For now, the wait & retry strategy has only been applied on READ statements (that wait for data). If new lock problems arise, it should be considered to also wait & retry for WRITE statements.

Issue(s)

Closes #517

@github-actions
Copy link

github-actions bot commented Sep 21, 2022

Unit Test Results

    7 files  ±0    24 suites  ±0   2m 24s ⏱️ +12s
337 tests ±0  337 ✔️ ±0  0 💤 ±0  0 ±0 
338 runs  ±0  338 ✔️ ±0  0 💤 ±0  0 ±0 

Results for commit 35947c3. ± Comparison against base commit 2de1b9b.

♻️ This comment has been updated with latest results.

@ghubertpalo ghubertpalo force-pushed the greg/518/sqlite_dead_locks branch 4 times, most recently from 0f9b161 to 02806ea Compare September 21, 2022 15:38
Copy link
Member

@jpraynaud jpraynaud left a comment

Choose a reason for hiding this comment

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

We miss the SQLite min version requirements in the doc 😉

mithril-common/src/store/adapter/sqlite_adapter.rs Outdated Show resolved Hide resolved
Copy link
Member

@jpraynaud jpraynaud left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@ghubertpalo ghubertpalo merged commit 593a9ec into main Sep 22, 2022
@ghubertpalo ghubertpalo deleted the greg/518/sqlite_dead_locks branch September 22, 2022 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix database dead locks in Aggregator
2 participants