Repository navigation
Pull で本体の差し替えに失敗したら退けた WAL/SHM を戻す - #104
Merged
Merged
Conversation
Pull は本体 DB を差し替える前に WAL/SHM を消していたため、差し替えが ファイルロックや I/O 障害で失敗すると、本体は旧版のまま WAL の未反映分だけが 失われていた。マージ経路の ReplaceDatabase と同じく、WAL/SHM を脇へ退けて おき、本体を差し替えられなければ戻し、差し替えが済めば消す。 退ける処理は SidecarsAside にまとめ、ReplaceDatabase もこれを使う。 退ける名前は置き換えの記録に残し、Pull が本体を差し替えた後に止まって 退けた WAL が残った場合は、次回の復旧で戻さずに消す。 Closes #91 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WFzzs615ZYRkB1BEh5zYp3
limit7412
marked this pull request as ready for review
November 28, 2026 04:27
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
Requested by 回路 · project thread
Closes #91
概要
VRCX と Friend Connect の Pull は、本体 DB を差し替える前に WAL/SHM を消していました。差し替えがファイルロックや I/O 障害で失敗すると、本体は旧版のまま、WAL にしか無い未反映の変更だけが失われます。
この PR では、マージ経路 (
ReplaceDatabase) と同じく WAL/SHM を消さずに脇へ退けます。本体を差し替えられずに止まったら元へ戻し、差し替えが済んだら消します。変更点
SidecarsAsideを追加し、WAL/SHM を退ける・戻す・消す処理をまとめた。ReplaceDatabaseもこれを使うように書き換えたVrcxSyncService.PullとFriendConnectSyncService.Pullで、DeleteIfExistsによる削除を退ける処理に置き換えたMergePendingState) に退ける名前 (AsideSuffix) を残すようにした。退けた後にプロセスごと止まっても、次回の復旧で探せるSyncRunnerの復旧処理で、Pull が本体を差し替えた後に止まった記録 (FromPull) に退けた WAL が残っていれば消すようにした。本体を差し替えない回の記録 (前後のハッシュが同じ) なら、WAL はその本体のものなので戻すテスト
PullSidecarsTestsを追加しました。File.Replaceを失敗させる。Windows のみ)UnsyncedChangeDetectionTestsには、Pull が本体を差し替えた後に止まって退けた WAL が残った場合、次の起動時 Pull が戻さずに消すテストを足しました。この環境には .NET SDK が無いため、ビルドとテストは CI (windows-latest) で確認します。
範囲外
db.sqlite-wal.vrctds-aside-*の名前で残るので、手で戻せます (従来はこの場合 WAL が消えていました)Generated by Claude Code