Repository navigation
perf(archive): batch target compatibility checks - #2204
Merged
hidb4ai merged 5 commits intoOct 27, 2026
Merged
Conversation
hidb4ai
reviewed
Oct 23, 2026
hidb4ai
left a comment
Contributor
There was a problem hiding this comment.
One non-blocking progress-reporting regression in the batching change.
knqiufan
force-pushed
the
codex/batch-archive-compatibility-2169
branch
from
October 25, 2026 06:00
9c2cd4a to
4b5c8a7
Compare
knqiufan
marked this pull request as ready for review
October 27, 2026 05:24
knqiufan
requested review from
AlexStocks,
PsiACE,
frostming and
zhanghuidinah
as code owners
October 27, 2026 05:24
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.
Which issue or RFC does this PR close?
Closes #2169.
Rationale for this change
Archive validation performs one target lookup per record. Batching reduces compatibility queries for 5,000 Sources, one Scope, and one journal head from 5,002 to 52 while retaining per-record decoding, dependency validation, and digest comparisons.
What changes are included in this PR?
UNION ALLstatements: up to 100 branches per statement, 900 pending parameters, and 1 MiB of encoded pending keys/digests.Are there any user-facing changes?
Archive dry-run, restore validation, and idempotent retry perform fewer database executions. Target-check progress is reported after each completed batch. Public APIs, schemas, archive formats, and conflict classification are unchanged.
Recorded file-backed SQLite measurements from 2026-10-23 show 5,002-record validation decreasing from 16.3445 to 9.1713 seconds for an empty target and from 16.9955 to 10.7552 seconds for an identical target. These are medians of three runs on Windows 11, CPython 3.12.13, and SQLite 3.50.4 with 256-byte Source content and no injected network delay. Environment, baseline, query counts, restore timing, and qualification limits are documented in both locales; these measurements are not a general backend throughput guarantee.
How was this change tested?
PC_UPGRADE_SOURCE_SHAandGITHUB_SHAinjected: 124 passed, 6 skipped. Disposable release fixtures isolate checkout identity from CI environment variables while retaining the explicit source-identity override test.uv run --locked prek run -a, immutable workflow action checks andgit diff --check: passed.SeekDB batching runs in both Python 3.11 and 3.14 CI jobs. Topic Memory migration scenarios keep a native SeekDB lease across independent maintenance connections to avoid the known rapid-restart runtime-lock stall; separate restart/exclusion acceptance remains intact. The Desktop connection-transition journey has a 15-second per-test timeout for shared Intel macOS runners, with all behavior assertions retained.
The real OceanBase CI job explicitly runs
test_archive_batches_validation_and_rechecks_after_dry_run[server]and rejects skipped results. No local OceanBase instance was available. At commit1a56ace8, real OceanBase acceptance passed, including the exact archive case above. Python 3.11/3.14 SeekDB archive checks and Intel macOS Desktop checks also passed. Main CI and the upgrade summary gates passed. The SeekDB no-vector upgrade first timed out while native DDL waited for transactions; an unchanged rerun passed all 11 acceptance tests in 474.67 seconds. This qualifies the tested upgrade path but does not establish that the intermittent native-engine stall is fixed. All required CI checks are green for the reviewed head; the PR is ready for review.AI usage statement
OpenAI Codex assisted with implementation, regression tests, documentation, and local review using the Open Code Review plugin's delegation rules. The original optimization and benchmark also used the plugin's configured DeepSeek Flash provider for automated review.