Repository navigation
fix(tauri): keep the retired SQLite copy complete and skip its preflight once native is authoritative - #2193
Conversation
…ght once native is authoritative Two review findings on #2164 that were still open when it merged. Retirement now treats the SQLite write-ahead log as part of the operation: it moves first, a failed move of the main file puts it back, and success is only logged when both moved, so the .retired recovery copy can no longer be silently incomplete. The order is also crash-safe, since a process killed between the two renames leaves the source in place for the next boot to finish. The SQLite compatibility preflight is gated on the same condition as the migrations, so an unreadable or newer-schema recovery copy cannot set db_error and stop the dispatch-backed producers on a native database that opened fine.
Codex Review SummaryThis 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. |
|
Understand this PR’s impact Explore downstream dependencies and potential security impact with Blast Radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: shm11C3/HardwareVisualizer/.coderabbit.yml Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (2)
Included review availability: 5 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 8 reviews per hour. 📝 WalkthroughWalkthroughSQLite source retirement now handles WAL and SHM sidecars during rename failures. Startup skips SQLite compatibility preflight when native storage is authoritative. ChangesSQLite maintenance flow
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Bug fix 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
Rust Tauri Coverage ReportCoverage Details |
CI telemetryCommit
|
| Job | Result | Queue | Duration | CPU avg / p95 | Mem peak | Disk peak | Caches |
|---|---|---|---|---|---|---|---|
test-e2e-native |
✅ | 2s | 5m 05s | 66% / 100% · 2.6/4T T 66 · 69 · 64 · 65 |
3.0 / 15.6 GiB | 67 / 145 GiB | target exact · npm exact |
test-build (windows-latest) |
✅ | 3s | 4m 11s | 47% / 90% · 1.9/4T T 44 · 47 · 53 · 45 |
4.7 / 16.0 GiB | 6 / 220 GiB | target exact · sccache Rust 90% (525/582) · C/C++ n/a |
lint-tauri (windows-latest) |
✅ | 2s | 3m 26s | 38% / 78% · 1.5/4T T 40 · 32 · 47 · 35 |
7.1 / 16.0 GiB | 15 / 150 GiB | target exact · sccache Rust n/a · C/C++ n/a |
test-tauri (windows-latest) |
✅ | 2s | 3m 11s | 38% / 99% · 1.5/4T T 39 · 33 · 45 · 35 |
6.2 / 16.0 GiB | 10 / 150 GiB | target exact · sccache Rust 100% (1/1) · C/C++ n/a |
test-build (ubuntu-22.04) |
✅ | 2s | 2m 29s | 32% / 53% · 1.3/4T T 28 · 30 · 39 · 30 |
2.6 / 15.6 GiB | 65 / 145 GiB | target exact · sccache Rust 100% (630/630) · C/C++ 100% (17/17) |
test-build (macos-latest) |
✅ | 6s | 2m 22s | 70% / 89% · 2.1/3T T 74 · 68 · 66 |
4.5 / 7.0 GiB | 230 / 320 GiB | target exact · sccache Rust 100% (569/569) · C/C++ 100% (15/15) |
test-tauri (ubuntu-22.04) |
✅ | 2s | 2m 05s | 29% / 64% · 1.2/4T T 32 · 29 · 31 · 23 |
2.4 / 15.6 GiB | 68 / 145 GiB | target exact · sccache Rust 100% (1/1) · C/C++ n/a |
lint-tauri (macos-latest) |
✅ | 10s | 1m 53s | 81% / 99% · 2.4/3T T 84 · 81 · 79 |
4.2 / 7.0 GiB | 234 / 320 GiB | target exact · sccache Rust n/a · C/C++ n/a |
lint-tauri (ubuntu-22.04) |
✅ | 2s | 1m 49s | 29% / 50% · 1.2/4T T 25 · 33 · 28 · 29 |
2.0 / 15.6 GiB | 72 / 145 GiB | target exact · sccache Rust n/a · C/C++ n/a |
test-tauri (macos-latest) |
✅ | 9s | 1m 43s | 79% / 99% · 2.4/3T T 82 · 79 · 77 |
4.2 / 7.0 GiB | 229 / 320 GiB | target exact · sccache Rust 100% (1/1) · C/C++ n/a |
check-tauri-bindings |
✅ | 2s | 1m 38s | 28% / 66% · 1.1/4T T 24 · 30 · 28 · 32 |
2.3 / 15.6 GiB | 66 / 145 GiB | target exact · sccache Rust 100% (1/1) · C/C++ n/a |
change-detection |
✅ | 9s | 25s | – | – | – | – |
Merge Gate |
✅ | 12s | 25s | – | – | – | – |
rust-format |
✅ | 2s | 16s | 30% / 32% · 1.2/4T T 35 · 59 · 16 · 9 |
1.2 / 15.6 GiB | 59 / 144 GiB | – |
Slowest steps
| Step | Duration |
|---|---|
test-e2e-native › Run native E2E smoke |
3m 59s |
test-build (windows-latest) › Build Tauri Rust crate (CI optimized for PR) |
2m 46s |
lint-tauri (windows-latest) › Setup Rust |
1m 41s |
test-build (macos-latest) › Build Tauri Rust crate (CI optimized for PR) |
1m 36s |
test-tauri (windows-latest) › Run Tauri tests |
1m 34s |
Generated by the CI telemetry workflow from the GitHub API and job log markers. Queue = time from job creation to start. N/MT = average busy threads of M logical CPUs; T = per-thread average %.
Summary
Follow-up to #2164, which merged while two of its review findings were still open. Both are small.
retire_sqlite_sourcerenamed the main file first and moved-wal/-shmbest effort, then logged success regardless. A SQLite-walcan hold committed pages the main file lacks (normally only after a crash mid-write, since Core closes its pool after every operation), so the.retiredrecovery copy could be incomplete while looking complete. The write-ahead log now moves first, a failed move of the main file puts it back, and success is logged only when both moved. That order is also crash-safe: a process killed between the two renames leaves the source in place, and the next boot finishes the job.-shmstays best effort because SQLite rebuilds it. The rename is injected into a privateretire_withso the rollback can be tested.check_db_compatibilityopened the SQLite file in every state. With the native database authoritative, an unreadable or newer-schema recovery copy setdb_error, sois_db_okwent false and the dispatch-backed producers did not start even though native adoption had succeeded. It is now gated onsqlite_source_is_authoritative, the same condition that already gates the migrations.Nothing here is user-visible: release builds exclude
duckdb-archive.Related Issues
Refs #2135, #2164.
Type of Change
fix/branch)feat/branch)refactor/branch)perf/branch)docs/branch)chore/branch)Screenshots / Videos
Not applicable.
Test Plan
cargo fmt --all -- --checkcargo clippy -p hardware_visualizer --all-targets -- -D warnings, with and withoutduckdb-archivecargo test -p hardware_visualizer --features duckdb-archive --release --lib -- app::native_ --test-threads=1(24 passed), including three new retirement tests: a failed main-file rename puts the log back, a failed log rename leaves everything in place, and a retirement interrupted after the log moved finishes on the next callcargo test -p hardware_visualizer --features duckdb-archive --release --test native_dispatch_conversion --test native_dispatch_restartNote for reviewers: CI runs
cargo test -p hardware_visualizerwithout the feature, so none of the App'sduckdb-archivetests, including these, run in CI today. They were run locally.Checklist
Summary by CodeRabbit