Skip to content

Conversation

@MrCroxx
Copy link
Contributor

@MrCroxx MrCroxx commented Nov 12, 2025

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

Upgrade foyer to v0.21.0-dev.

Temporarily remove vector cache stats, restore it after state check is fixed. cc @wenym1

Checklist

  • I have written necessary rustdoc comments.
  • I have added necessary unit tests and integration tests.
  • I have added test labels as necessary.
  • I have added fuzzing tests or opened an issue to track them.
  • My PR contains breaking changes.
  • My PR changes performance-critical code, so I will run (micro) benchmarks and present the results.
  • I have checked the Release Timeline and Currently Supported Versions to determine which release branches I need to cherry-pick this PR into.

Documentation

  • My PR needs documentation updates.
Release note

Temporarily remove vector cache stats, restore it after state check is
fixed.

Signed-off-by: MrCroxx <[email protected]>
@MrCroxx MrCroxx self-assigned this Nov 12, 2025
@github-actions github-actions bot added the type/refactor Type: Refactoring. label Nov 12, 2025
@MrCroxx MrCroxx marked this pull request as ready for review November 12, 2025 10:11
@MrCroxx MrCroxx requested a review from a team as a code owner November 12, 2025 10:11
@MrCroxx MrCroxx requested review from BugenZhao, hzxa21 and wenym1 and removed request for a team November 12, 2025 10:11
@MrCroxx
Copy link
Contributor Author

MrCroxx commented Nov 12, 2025

cc @codex Please review for us.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 545 to +558
match policy {
CachePolicy::Fill(hint) => {
let entry = self.block_cache.fetch_with_properties(
idx,
HybridCacheProperties::default().with_hint(hint),
fetch_block,
);
if matches!(entry.state(), FetchState::Miss) {
stats.cache_data_block_miss += 1;
}
Ok(BlockResponse::Entry(entry))
let fetch = self.block_cache.get_or_fetch(&idx, move |_| {
Self::fetch_block_with_hint(
store,
object_id,
data_path,
file_size,
range,
uncompressed_capacity,
hint,
)
});
Ok(BlockResponse::Fetch(fetch))

Choose a reason for hiding this comment

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

P2 Badge Stop accounting for block cache misses

The refactor to HybridGetOrFetch dropped the only place that bumped stats.cache_data_block_miss. When a data block is absent and CachePolicy::Fill schedules a fetch, the function now immediately returns BlockResponse::Fetch without checking fetch.state() and without updating the miss counter. As a result StoreLocalStatistic.cache_data_block_miss stays at 0 even when every request misses, making cache effectiveness metrics and related alarms meaningless.

Useful? React with 👍 / 👎.

Comment on lines 780 to 786
let add = (now.elapsed().as_secs_f64() * 1000.0).ceil();
stats_ptr.fetch_add(add as u64, Ordering::Relaxed);
Ok(Box::new(sst))
}
});

if matches! { entry.state(), FetchState::Wait | FetchState::Miss } {
stats.cache_meta_block_miss += 1;
}
});

stats.cache_meta_block_total += 1;

Choose a reason for hiding this comment

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

P2 Badge Meta cache misses no longer tracked

In the sstable helper, the prior code incremented cache_meta_block_miss whenever the meta cache returned FetchState::Wait | Miss. After switching to get_or_fetch, that miss accounting was removed and the function only increments cache_meta_block_total. This means the exported metric local_stats.cache_meta_block_miss will permanently report zero, hiding real meta-cache misses and breaking existing monitoring.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type/refactor Type: Refactoring.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants