Skip to content

feat: surface async-migration batchSize / yieldDelay as config (currently hardcoded) #1743

@Kpa-clawbot

Description

@Kpa-clawbot

Context

Raised by Munger in PR #1735 (round-1 review). chunkedTxLastSeenBackfill takes batchSize and yieldDelay as parameters but they are hardcoded at the single call site (batchSize=5000, yieldDelay=100ms) and not surfaced for operator tuning.

Proposal

Surface both as config (config.json) with sane defaults:

"async_migrations": {
  "tx_last_seen_backfill": {
    "_comment_batch_size": "Rows per UPDATE chunk. Default 5000. Lower if reader latency spikes; higher if backfill is too slow.",
    "batch_size": 5000,
    "_comment_yield_delay_ms": "Milliseconds the writer rests between chunks. Default 100. Higher = more reader headroom, slower backfill.",
    "yield_delay_ms": 100
  }
}

Why

Operators see different DB sizes / I/O profiles; one tuning is not enough. Also lets us A/B in staging without code changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions