Skip to content

Reduce time taken in decode jobs - #222

Merged
harshil-goel merged 6 commits into
mainfrom
harshil/perf
Oct 20, 2026
Merged

harshil-goel merged 6 commits into
mainfrom
harshil/perf

Conversation

@harshil-goel

Copy link
Copy Markdown
Contributor

No description provided.

harshil-goel and others added 6 commits October 20, 2026 06:29
Batch record dispatch and cut per-record work in the serial stage.

`RecordSink::on_records` takes a whole batch so a composite allocates one
boxed future per batch instead of per record; the default implementation
loops, so only the sinks worth batching implement it. `Send` becomes a
supertrait, which the default body needs to hold `&mut self` across an
await. `DecoderXactPair` runs the decoder over the batch before the
reorder sink, stronger than the per-record order it replaces and still
correct because a commit only drains its own xact.

`XactBuffer` counts live `stash_rfns` in an `Arc<AtomicU64>` outside the
mutex, so the per-record stash check short-circuits the lock while no xact
holds a candidate. `BufferingDecoderSink` holds it as an `Option`, and
`None` keeps the unconditional locked check so an unwired construction
site stays correct rather than silently skipping.

Bump pg-clickhouse-c to main's 4fe6b70, which carries the pgvector and
QBit encoding the oracle tests need; the branch had pinned an older
commit, so CI built a bridge without them and
`pgvector_fills_float_arrays_and_qbit` failed at the bridge worker.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XGcL5hTwVJsoRbyTEops8m
1. don't serialize small in-memory transactions with spill format
2. group transaction registrations, row chunks, and placement counts across small transactions
3. reduce size of futures per transaction from 10KB to 3KB
4. skip copying index records before ignoring
5. give WAL processing task its own thread
6. optimistic parallel decoding which WAL processing can use as long as catalog didn't change
7. reduce per-record allocations
8. reuse table routing between transactions
9. batch WAL records written to shadow catalog
@harshil-goel
harshil-goel marked this pull request as ready for review October 20, 2026 01:05
@harshil-goel
harshil-goel merged commit 97f9305 into main Oct 20, 2026
6 checks passed
@harshil-goel
harshil-goel deleted the harshil/perf branch October 20, 2026 02:48
serprex added a commit that referenced this pull request Oct 20, 2026
Queue worker failures could leave streaming stalled without an error.
Drain admission could wait forever for memory held by its own staged
rows. Restore failure reporting and send staged rows before waiting,
with an exit when pipeline fails.

Run queue worker on shared runtime so backfills survive worker exit.
Wait for segment writes and descriptor log cleanup before restarting
a session. Bound replay staging, apply drain limits to large in-memory
transactions, and account for column storage in memory plans.

Restore attribution and warnings for unexpected skipped records.
Remove misleading route counters and add regression coverage for
failure, spill, grouping, and cleanup paths.
serprex added a commit that referenced this pull request Oct 20, 2026
Queue worker failures could leave streaming stalled without an error.
Drain admission could wait forever for memory held by its own staged
rows. Restore failure reporting and send staged rows before waiting,
with an exit when pipeline fails.

Run queue worker on shared runtime so backfills survive worker exit.
Wait for segment writes and descriptor log cleanup before restarting
a session. Bound replay staging, apply drain limits to large in-memory
transactions, and account for column storage in memory plans.

Restore attribution and warnings for unexpected skipped records.
Remove misleading route counters and add regression coverage for
failure, spill, grouping, and cleanup paths.
serprex added a commit that referenced this pull request Oct 20, 2026
Queue worker failures could leave streaming stalled without an error.
Drain admission could wait forever for memory held by its own staged
rows. Restore failure reporting and send staged rows before waiting,
with an exit when pipeline fails.

Run queue worker on shared runtime so backfills survive worker exit.
Wait for segment writes and descriptor log cleanup before restarting
a session. Bound replay staging, apply drain limits to large in-memory
transactions, and account for column storage in memory plans.

Restore attribution and warnings for unexpected skipped records.
Remove misleading route counters and add regression coverage for
failure, spill, grouping, and cleanup paths.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants