storage sink: clarify flush interval contract vs per-entry max residency
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 56
- Forks
- 63
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 34
Description
Problem
The current cloud storage sink implementation does not treat flush-interval as a per-entry maximum residency time.
Today, the sink uses a periodic ticker in the buffering path. On each tick, if there is any pending batch in the shard, it flushes the current pending batch set. This means:
flush by intervalcurrently means periodic flush scan- it does not mean: once a specific entry has stayed in the sink for
flush-interval, that entry must be flushed immediately
This is easy to misunderstand from the configuration name and from a user perspective.
Current Behavior
For a pending batch in one writer shard:
flush by size: a singledispatcher + table + versionbatch reachesfile-size, then that table batch is flushedflush by interval: a ticker fires everyflush-interval, and the shard flushes whatever pending batches exist at that timeflush by barrier: only the target dispatcher is flushed before the marker continues
Because interval flush is ticker-driven, the oldest pending entry may stay less than one full interval, or slightly more, depending on when it arrived relative to the ticker phase and scheduling.
Why This Matters
If users interpret flush-interval as a maximum per-entry waiting time, the current implementation does not provide that contract.
Also, the current ticker-based model may miss an opportunity to build larger batches. If interval flush were driven by the oldest pending entry deadline instead of a fixed ticker phase, the sink could both:
- provide a clearer residency-time contract
- often accumulate larger batches before flushing
Suggested Follow-up
Decide and document the intended contract for flush-interval:
- Keep the current contract and document it explicitly as a periodic shard-level flush scan.
- Change the implementation so
flush-intervalmeans: once the oldest pending entry reaches its deadline, the sink must flush.
If option 2 is chosen, the follow-up design should clarify:
- flush granularity at deadline: shard-wide vs dispatcher-wide vs table-wide
- interaction with
file-sizeflush - interaction with barrier flush
- how to schedule the next wake-up from the oldest pending entry instead of a fixed ticker
Scope
This issue is only about clarifying and possibly redefining the interval-flush contract in cloud storage sink buffering. It does not propose behavior changes in this PR.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Inspect the cloud storage sink buffering path and its periodic ticker behavior. Decide whether flush-interval remains a periodic shard-level scan or becomes an oldest-entry deadline, then define its interaction with file-size and barrier flushes; the work is done when the contract and scheduling behavior are documented or agreed for implementation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend, cloud
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100