Repository navigation
fix: save whole checkpoints in autocommit, without a transaction (TC-2961) - #592
Merged
Merged
Conversation
samgbafa
force-pushed
the
feat/tc-2961-autocommit-save
branch
from
November 13, 2026 20:11
42a20ff to
9423d35
Compare
…k statement scope
…e removed bulk timeout; serialize large-transfer tests
samgbafa
force-pushed
the
feat/tc-2961-autocommit-save
branch
from
November 13, 2026 20:38
0572410 to
d2f96bf
Compare
samgbafa
marked this pull request as ready for review
November 13, 2026 21:36
This was referenced Nov 13, 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.
Linear: TC-2961 (follow-up to #583). Related: TC-2979.
Behaviour
UPDATE, or the primary-key-guardedINSERTfor a new database, also runs as one autocommit statement.Absentcase still relies on the primary key.statement_timeout(30 s by default) instead of the 120 s bulk one. Payloads are capped at 64 MiB by fix: refuse SQL checkpoints over 64 MiB and back off failed checkpoint saves (TC-2961) #583's write limit.statement_timeout(57014) applied nothing: it is one autocommit statement and is never retried. It now answers a retryable503, as ≤8 MiB saves and deltas already did. Before, the bulk transaction marked the request possibly applied atBEGIN, so it answered500 outcome_unknown. A connection lost after the statement was sent, or the SQL service's own transfer bound expiring, is stilloutcome_unknown.RecoveringConnection::begin_bulk/begin_bulk_read,BulkScopeandStatementTimeouts::bulk. Nothing else used them; hydration already reads in 4 MiB autocommit slices.database.bulk_statement_timeout_mssetting.DatabaseConfigdoes not deny unknown fields, so a value still set in a config file or the environment is ignored. The node logs one warning naming it at startup (removed setting is set and ignored). README,tinycloud.tomlsample and CHANGELOG updated.Tests
tinycloud-node-server/tests/postgres_pool_timeouts.rs::postgres_checkpoint_saves_send_no_begin.Absentsave and a 9 MiB full-checkpoint save send noBEGIN.begin()through the same pool is seen, which shows the recorder works.BEGINfor both saves.postgres_a_checkpoint_save_after_a_concurrent_delta_is_refused: a full save reads revision 1 on checkpoint A. While itsUPDATEwaits on the row, a delta-style update moves the row to revision 2 on the same checkpoint. The full save gets the conflict and the delta's row stands. This pins the revision predicate: without it the delta is lost.postgres_a_timed_out_checkpoint_update_is_refused_once_and_not_applied: a 57014 on the >8 MiBUPDATEis refused once (one trigger entry), not tracked as possibly applied, and the row is unchanged. This pins "never retried".BEGINtest andpostgres_sql_statement_timeout_is_retryable_and_releases_the_lockhold one shared test lock (LARGE_TRANSFERS). Running them at once made the latter's timed refusal flaky on a shared server (3/27 in review).removed_settings_tests::a_set_removed_setting_is_named: a configuration that setsdatabase.bulk_statement_timeout_msis named by the startup check and still loads; a default one is not named.Existing tests changed (test-ruling: TC-2961)
Removed with the bulk scope, not rewritten:
postgres_statement_timeout_modes_scopes_and_migrations: the two bulk-scope blocks (previously at :369 and :423) and thebulk_statement_timeout_mssetting they used. The session, local, off and migration checks are unchanged.postgres_sql_statement_timeout_is_retryable_and_releases_the_lock:Unavailable(503). The lock is released and nothing of it is applied (the next read sees 1 row).bulk_statement_timeout_mssetting is removed.postgres_hydration_slices_run_under_the_base_timeout: removed thebulk_statement_timeout_mssetting (compile only; reads never used it).db_pool::tests::statement_timeouts_render_per_mode: removed thebulkfield (compile only).db_pool::tests::track_writes_marks_only_writes_that_may_have_applied: removed thebegin_bulk_readstep.db_pool::tests::bulk_scope_is_the_pool_off_postgres: removed. Its one non-bulk check (localmode issues nothing off PostgreSQL) is kept aslocal_mode_issues_nothing_off_postgres.runtime::testsconfig defaults: removedbulk_statement_timeout_msfrom the defaults tuple (compile only).config::tests::startup_rejects_a_statement_timeout_postgres_cannot_hold(from fix: end PostgreSQL transactions left idle for 5 min (TC-2954) #586): removed itsbulk_statement_timeout_msdimension. Thestatement_timeout_msbound (INT_MAX accepted, INT_MAX + 1 refused) is unchanged.DatabaseConfig::validatedrops the matching bulk bound, and the CHANGELOG entry for fix: end PostgreSQL transactions left idle for 5 min (TC-2954) #586 no longer names the removed setting.