mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #5014] [MERGED] fix: prevent concurrent storage writers #6590
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#6590
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/5014
Author: @SpicyMarinara
Created: 8/14/2026
Status: ✅ Merged
Merged: 8/14/2026
Merged by: @SpicyMarinara
Base:
staging← Head:hotfix/5013-storage-single-writer📝 Commits (8)
b50a007Merge pull request #5012 from Pasta-Devs/staging219331bfix: prevent concurrent storage writers5896a4ffix: prevent concurrent file storage writersd02cb7fRevert "fix: prevent concurrent file storage writers"ef67f34fix: add portable storage writer lockf360e55Merge remote-tracking branch 'origin/main' into hotfix/5013-storage-single-writer1aca082fix: harden storage writer lease lifecycle83c11eafix: close storage writes before releasing lease📊 Changes
6 files changed (+544 additions, -29 deletions)
View changed files
📝
CHANGELOG.md(+4 -0)📝
docs/TROUBLESHOOTING.md(+6 -0)📝
package.json(+2 -1)📝
packages/server/src/db/file-backed-store.ts(+313 -27)📝
packages/server/src/services/mari-db/mari-db.service.ts(+5 -1)➕
scripts/regressions/storage-writer-lock.regression.ts(+214 -0)📄 Description
Linked issue
Refs #5013
Why this change
Two live Engine processes can currently open the same local data directory as independent file-backed database writers. A stale process can then overwrite newer table snapshots and make successfully reported lorebook writes disappear.
What changed
Validation
pnpm checkpasses locallypnpm regression:storage-writer-lockpasses locallypnpm regression:docspasses locallyCONTRIBUTING.mdManual verification notes
Manually verify one Engine instance can write, flush, close, and reopen lorebooks without loss. Manually verify a second instance using the same data directory fails with an actionable error and cannot overwrite the first instance data. Manually verify stale manifest diagnostics heal without hiding rows.
Docs and release impact
docs/TROUBLESHOOTING.mdwith the safe stale-lease recovery procedureUI evidence
No UI change is expected.
Summary by CodeRabbit
Bug Fixes
Documentation
Tests
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.