feat(database): Enable Write-Ahead Logging for Room DB#4499
Merged
Conversation
Enables Write-Ahead Logging (WAL) for the Room database instances. This can improve performance by allowing reads and writes to occur concurrently. Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR explicitly enables Write-Ahead Logging (WAL) for the app’s Room database builders to improve concurrency between reads and writes.
Changes:
- Set Room
JournalModetoWRITE_AHEAD_LOGGINGin the primaryMeshtasticDatabasebuilder. - Set Room
JournalModetoWRITE_AHEAD_LOGGINGin the per-device DB builder used byDatabaseManager.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| core/database/src/main/kotlin/org/meshtastic/core/database/MeshtasticDatabase.kt | Forces WAL mode on the singleton/legacy Room database builder. |
| core/database/src/main/kotlin/org/meshtastic/core/database/DatabaseManager.kt | Forces WAL mode on dynamically created per-device Room databases managed via LRU caching. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4499 +/- ##
==========================================
- Coverage 11.09% 11.09% -0.01%
==========================================
Files 429 429
Lines 14447 14449 +2
Branches 2391 2391
==========================================
Hits 1603 1603
- Misses 12540 12545 +5
+ Partials 304 301 -3 ☔ View full report in Codecov by Sentry. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enables Write-Ahead Logging (WAL) for the Room database instances. This can improve performance by allowing reads and writes to occur concurrently.