[PHP] Resume file-backed db-pull from flushed cursor boundaries - #591
Draft
adamziel wants to merge 1 commit into
Draft
[PHP] Resume file-backed db-pull from flushed cursor boundaries#591adamziel wants to merge 1 commit into
adamziel wants to merge 1 commit into
Conversation
Contributor
Pull pipeline performance —
|
| Stage | PR | trunk | Δ | Status | Details |
|---|---|---|---|---|---|
playground-sqlite-db-pull |
9.36 s | 9.56 s | ⚪ -199 ms (-2.1%) | ✓ | condition=db-pull in PHP.wasm runtime=php.wasm 8.3 wp_mysql_parser=enabled mode=lexer native_lexer=verified native_token_stream=WP_MySQL_Native_Token_Stream native_token_count=18 native_parser=selected trunk: condition=db-pull in PHP.wasm runtime=php.wasm 8.3 wp_mysql_parser=enabled mode=lexer native_lexer=verified native_token_stream=WP_MySQL_Native_Token_Stream native_token_count=18 native_parser=selected |
playground-sqlite-db-apply |
3.63 s | 3.57 s | ⚪ +56 ms (+1.6%) | ✓ | condition=db-apply to SQLite in PHP.wasm runtime=php.wasm 8.3 wp_mysql_parser=enabled mode=parser native_lexer=verified native_token_stream=WP_MySQL_Native_Token_Stream native_token_count=18 native_parser=verified native_ast=WP_MySQL_Native_Parser_Node sqlite_driver_parser=verified trunk: condition=db-apply to SQLite in PHP.wasm runtime=php.wasm 8.3 wp_mysql_parser=enabled mode=parser native_lexer=verified native_token_stream=WP_MySQL_Native_Token_Stream native_token_count=18 native_parser=verified native_ast=WP_MySQL_Native_Parser_Node sqlite_driver_parser=verified |
| Total | 12.98 s | 13.13 s | ⚪ -143 ms (-1.1%) |
Numbers carry runner noise; treat single-run deltas as directional, not authoritative.
📈 Trunk performance history — commit-by-commit timeline.
This was referenced Aug 14, 2026
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.
A new
db-pullprocess now continues file output from the last flushed byte and source cursor boundary instead of silently starting the lifecycle over.Background
Exit code 2 leaves
completion_state=partial. Directdb-pullpreviously recognized onlyin_progress, so a later process replaced the partial lifecycle. A hard stop could also leavedb.sqlahead of or behind the saved source cursor without a reliable way to classify those bytes.This change
File pulls write
database-dump.intentbefore starting and save the source cursor only after the matchingdb.sqlbytes have been flushed. Resume truncates an unconfirmed tail, rejects a missing or shorter file, and refuses an output-mode change. Every file request asks for replacement-table SQL. A completed SHA-256 record confirms the resulting dump only after the source reports completion.db-applyrefuses an intent-marked prefix; safe replay of a completed replacement dump is added by #595.This is PR 2 of 5 in the database restart stack: #590 → #591 → #595 → #582 → #607.
Testing
Focused tests cover exit-code-2 continuation through the database-index stage, two process deaths around the first SQL checkpoint, missing and shortened local artifacts, output-mode drift, and rejection of an unfinished dump by
db-apply.DatabaseCommandRestartTestimport-54-db-pull-index-interruptionimport-59