Skip to content

[dbsp] Include Builder::done in time to complete a merge in the spine. - #6804

Merged
blp merged 2 commits into
mainfrom
measure-merge-done
Aug 5, 2026
Merged

[dbsp] Include Builder::done in time to complete a merge in the spine.#6804
blp merged 2 commits into
mainfrom
measure-merge-done

Conversation

@blp

@blp blp commented Aug 5, 2026

Copy link
Copy Markdown
Member

Finishing a merge can do a lot of I/O due to fsync(), but that cost wasn't being included. This fixes the problem. It also factors out the code for measuring elapsed time into a new helper ElapsedTime::record().

Describe Manual Test Plan

Ran the unit tests with and without temporary changes that break them.

Checklist

  • Unit tests added/updated
  • Integration tests added/updated
  • Documentation updated
  • Changelog updated

Finishing a merge can do a lot of I/O due to fsync(), but that cost wasn't
being included.  This fixes the problem.  It also factors out the code for
measuring elapsed time into a new helper ElapsedTime::record().

Signed-off-by: Ben Pfaff <blp@feldera.com>
@blp
blp requested a review from mihaibudiu August 5, 2026 00:17
@blp blp self-assigned this Aug 5, 2026
@blp blp added DBSP core Related to the core DBSP library performance rust Pull requests that update Rust code profiler Issues related to the profiler and its APIs labels Aug 5, 2026
Signed-off-by: feldera-bot <feldera-bot@feldera.com>

@mythical-fred mythical-fred left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve. Real fix — the Builder::done cost (fsync) was outside the timer, so slow storage would silently under-report real in merge stats and mask stalls. Moving it inside elapsed.record() closes that gap.

The ElapsedTime::record(F) helper is the right abstraction: same start-real / start-cpu / AddAssign pattern the old inlined code had, now in one place, and the async wrapper collapses to a single line without changing behavior. Tests are proportionate — return-value pass-through, accumulation across calls, and the sleep-vs-CPU signature that documents why real and cpu are tracked separately (that third test doubles as executable documentation for anyone who wonders which counter to look at when triaging a stall). Nice.

@blp
blp added this pull request to the merge queue Aug 5, 2026
Merged via the queue into main with commit d106653 Aug 5, 2026
1 check passed
@blp
blp deleted the measure-merge-done branch August 5, 2026 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DBSP core Related to the core DBSP library performance profiler Issues related to the profiler and its APIs rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants