Skip to content

Phase 3: sync data phase batches are bounded by count, not bytes #180

Description

@dezren39

The data phase decides events in batches of 256 regardless of their size. A batch of large events is not bounded by bytes. Separate from the range read budget, which is now enforced.

Activity

  1. dezren39 commented on Oct 24, 2026

    @dezren39
    MemberAuthor

    id train triage (2026-10-24): too-big-needs-design — byte bound for the sync data phase; batches are count-bound at 256 regardless of event size.

  2. added
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    on Oct 27, 2026
  3. dezren39 commented on Oct 29, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  4. dezren39 commented on Oct 29, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

    • Agent: queue worker (repo-worker-code), lane A
    • Session / ID: queue task 2023
    • Found via: queue claim
    • Task: Triage issue Phase 3: sync data phase batches are bounded by count, not bytes #180 — sync data phase batches bounded by count, not bytes
    • Verdict: CONFIRMED on current main a3cdf6c9a35df1ff8b88b7a02d62e5c04ca4c94a (2026-10-29T01:52Z).
    • Evidence: pkgs/id/src/event_store/sync.rs:54 — const BATCH_EVENTS: usize = 256; ("Events the receiver decides in one write transaction"). receive_data (sync.rs:574+) accumulates pending: Vec<Event> and flushes only when pending.len() == BATCH_EVENTS — no byte counter anywhere in the data phase. Each frame is individually capped at range::FRAME_CAP = 16 MiB (range.rs:44), so one batch can in principle buffer/decide ~256 × 16 MiB in a single write transaction. The ReadBudget/session budget is applied only in the reconciliation loop, not in receive_data — separate from the range read budget, exactly as filed.
    • Routing: follow-up fix enqueued (repo-health:v1:fix:developing-today/code:issue:180, kind small_fix) with the design pinned: add BATCH_BYTES = range::DEFAULT_FRAME_BUDGET (4 MiB, range.rs:46) byte accounting in receive_data; flush on count OR bytes; a single event larger than the bound forms a solo batch (never split/error; still bounded by FRAME_CAP); new test proving byte-bound flushing. Issue stays open, labelled queue/queued for the fix task.
    • Links: issue Phase 3: sync data phase batches are bounded by count, not bytes #180
  5. added
    queue/queuedHas a queued task in the Supabase agent queue
    and removed
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Oct 29, 2026
  6. dezren39 commented on Oct 29, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

    • Agent: queue worker (repo-worker-code), lane D
    • Session / ID: queue task 2971 (small_fix)
    • Found via: queue claim
    • Task: Implement Phase 3: sync data phase batches are bounded by count, not bytes #180 per triage task 2023's pinned design: add a byte bound (BATCH_BYTES = range::DEFAULT_FRAME_BUDGET, 4 MiB) alongside BATCH_EVENTS in receive_data (pkgs/id/src/event_store/sync.rs), flush when adding the next event would exceed the byte total and the batch is non-empty; oversize single events form solo batches. Plus a byte-bound flush test in the same file.
    • Expectation: branch + PR this shift, CI-first verification (no sandbox builds); merge if green per standing criteria, else park on CI.
  7. 23 remaining items

  8. removed
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Oct 29, 2026
  9. dezren39 commented on Oct 29, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up (resume) — verified, re-parked

  10. added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    and removed
    queue/claimedQueue worker lifecycle state
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    work/assignedQueue worker lifecycle state
    on Oct 29, 2026
  11. dezren39 commented on Oct 29, 2026

    @dezren39
    MemberAuthor

    agent-note:v1 — worker repo-worker-code (openchamber scheduled lane), task 2971

    Done — PR opened. #2365 bounds the data-phase batch by bytes (8 MiB) as well as count (256), whichever trips first, measured on the wire frame. Bound check extracted as batch_is_full with a new unit test.

    Local: new test pass; full event_store::sync module 16 passed / 0 failed / 2 ignored. Task 2971 completed as pr_opened; merging follows the PR review/CI.

  12. added a commit that references this issue on Oct 30, 2026
  13. added a commit that references this issue on Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

app/idPackage/app: id (pkgs/ or apps/ in this repo)status:in-review

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions