Skip to content

fix: keep offline history conversion resumable and reduce copy overhead - #1255

Merged
frahlg merged 2 commits into
masterfrom
fix/converter-throughput-20260914
Sep 14, 2026
Merged

frahlg merged 2 commits into
masterfrom
fix/converter-throughput-20260914

Conversation

@frahlg

@frahlg frahlg commented Sep 14, 2026 •

Copy link
Copy Markdown
Member

Problem and change

The v3.5.1-beta.1 offline converter had two problems on Raspberry Pi:

  • Numeric history copied at about 2,300 rows/s on a source with 168 million samples. A 1,024-row batch caused repeated source scans and small destination commits.
  • Cancelling the converter closed its writable state connection and checkpointed an existing state WAL. All saved data stayed intact, but the next run rejected the changed file fingerprint. A read-only inspection could also create an empty SQLite WAL and invalidate an otherwise unchanged source.

Use 65,536-row ranges for the four numeric sample columns, while retaining smaller ranges for tables that may contain large JSON values. Read state through a read-only connection until the fully checked history can be selected. Preserve its journal mode during selection. Treat absent and empty SQLite WAL files alike; still fingerprint every nonempty WAL.

Source checks, atomic row/cursor commits, complete typed readback hashes and counts, publication receipts, stable IDs and the output schema remain intact. Core builds still have no DuckDB dependency. Do not override a saved fingerprint after a failed older attempt: preserve that partial copy and start a new verified destination after checking the sources.

Closes #1254. Closes #1256.

Validation

  • Both new WAL regression tests fail on the previous implementation and pass with this change: a frozen main/WAL pair survives cancellation byte for byte and resumes with its saved goal; absent/empty SQLite WALs compare equal while nonempty WALs remain protected.
  • Real DuckDB fixture: interruption, committed 1,024-row prefix/cursor, resume, values, counts, stable IDs/goals, hot-history merge, ledger replay and idempotent retry.
  • One million interleaved samples with the final patch: local Linux ARM64 Docker, enforced 256 MiB memory/swap limit, PASS, 6.98 s, 98.04 MiB peak RSS.
  • PATH=/opt/homebrew/bin:$PATH make verify: PASS after both fixes. The first run used macOS Bash 3 and failed in an existing associative-array test; Bash 5 passes.
  • Native Pi state/WAL regression suite: PASS. Final Pi million-sample fixture: PASS, 184.68 s, 101.57 MiB peak RSS, while source hashing and state tests shared the disk. Earlier numeric-batch-only Pi fixture: PASS, 91.74 s, 102.53 MiB peak RSS, compared with 204.17 s previously; these were not isolated performance benchmarks. The Pi kernel does not enforce cgroup memory limits.

Full-device migration is not yet complete. Fixture results do not establish its completion time or production success.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-09-14T07:11:46.281557Z 155b4f3 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@frahlg frahlg changed the title fix: reduce offline numeric history conversion overhead fix: keep offline history conversion resumable and reduce copy overhead Sep 14, 2026
@frahlg
frahlg merged commit 6e9cb45 into master Sep 14, 2026
16 checks passed
@frahlg
frahlg deleted the fix/converter-throughput-20260914 branch November 11, 2026 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant