Skip to content

Report rewritten blocks telemetry#14

Open
jason-rl wants to merge 2 commits intomainfrom
jason/block_rewrite_stats
Open

Report rewritten blocks telemetry#14
jason-rl wants to merge 2 commits intomainfrom
jason/block_rewrite_stats

Conversation

@jason-rl
Copy link
Copy Markdown

@jason-rl jason-rl commented Mar 7, 2026

No description provided.

@jason-rl jason-rl requested a review from adam-rl March 10, 2026 21:57
@jason-rl jason-rl marked this pull request as ready for review March 10, 2026 21:57
Comment thread src/overlaybd/lsmt/index.cpp Outdated

// Count blocks that will be overwritten (rewritten)
uint64_t rewritten = 0;
auto check_it = mapping.lower_bound(m);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

So this is in the hot path, serving block reads, and we've introduced another lookup.

Should this be somehow gated with a preprocessor guard, and only enabled when building the overlaybd-commit tool?

Comment thread src/overlaybd/lsmt/index.cpp Outdated
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Could we instead have this method return how many blocks were removed?

This code is already figuring out what was overwritten, it can just report that.

Copy link
Copy Markdown

@adam-rl adam-rl left a comment

Choose a reason for hiding this comment

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

Some perf / duplication concerns.

@jason-rl jason-rl force-pushed the jason/block_rewrite_stats branch from cf6c4cb to 2ab039e Compare March 26, 2026 02:08
Address PR feedback to avoid performance impact in hot path:
- Add ENABLE_REWRITE_STATS preprocessor guards around all tracking code
- Eliminate duplicate overlap calculations by having remove_partial_overlap
  return rewritten block count via output parameter
- Add CMake option (defaults to OFF) for building overlaybd-commit with stats enabled

This ensures the production hot path (block reads) has zero overhead from
telemetry tracking unless explicitly enabled at build time.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
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.

2 participants