Skip to content

Conversation

@Hywan
Copy link
Member

@Hywan Hywan commented Oct 3, 2025

This patch introduces a write-only connection in SqliteStateStore à la SqliteEventCacheStore (see #5382 to learn more). The idea is to get many read-only connections, and a single write-only connections behind a lock, so that there is a single writer at a time.

This patch renames the acquire method to read, and it introduces a new write connection.


Hywan added 2 commits October 3, 2025 14:00
This patch transforms an inline comment into a doc comment.
This patch introduces a write-only connection in `SqliteStateStore`
_à la_ `SqliteEventCacheStore`. The idea is to get many read-only
connections, and a single write-only connections behind a lock, so that
there is a single writer at a time.

This patch renames the `acquire` method to `read`, and it introduces a
new `write` connection.
@Hywan Hywan requested a review from a team as a code owner October 3, 2025 12:06
@Hywan Hywan requested review from poljar and removed request for a team October 3, 2025 12:06
@codecov
Copy link

codecov bot commented Oct 3, 2025

Codecov Report

❌ Patch coverage is 89.47368% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.42%. Comparing base (67d8db3) to head (da7a4e6).
⚠️ Report is 3 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
crates/matrix-sdk-sqlite/src/state_store.rs 89.47% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5744      +/-   ##
==========================================
- Coverage   88.42%   88.42%   -0.01%     
==========================================
  Files         360      360              
  Lines       99545    99557      +12     
  Branches    99545    99557      +12     
==========================================
+ Hits        88022    88030       +8     
- Misses       7394     7399       +5     
+ Partials     4129     4128       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@codspeed-hq
Copy link

codspeed-hq bot commented Oct 3, 2025

CodSpeed Performance Report

Merging #5744 will not alter performance

Comparing Hywan:fix-sqlite-state-store-write-connection (da7a4e6) with main (67d8db3)

Summary

✅ 50 untouched

Copy link
Contributor

@poljar poljar left a comment

Choose a reason for hiding this comment

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

Looks good.

@poljar poljar merged commit a7cb094 into matrix-org:main Oct 3, 2025
53 checks passed
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.

SQLite stores sporadically fail with database is locked errors

2 participants