Skip to content

Fix "Cannot read from file /proc/pressure/io" for Keeper - #109179

Merged
alexey-milovidov merged 6 commits into
ClickHouse:masterfrom
UberDever:uberdever/feature/keeper-proc-pressure-errors
Jul 7, 2026
Merged

alexey-milovidov merged 6 commits into
ClickHouse:masterfrom
UberDever:uberdever/feature/keeper-proc-pressure-errors

Conversation

@UberDever

@UberDever UberDever commented Jul 2, 2026 •

Copy link
Copy Markdown
Contributor

Changelog category (leave one):

  • Improvement

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

ClickHouse Keeper now respects the os_collect_psi_metrics setting and skips PSI metrics collection when it is disabled

Version info

  • Merged into: 26.7.1.628 (included in 26.7 and later)

@GrigoryPervakov GrigoryPervakov added the can be tested Allows running workflows for external contributors label Jul 6, 2026
@clickhouse-gh

clickhouse-gh Bot commented Jul 6, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [a227708]

Summary: ✅


AI Review

Summary

This PR fixes the wiring so standalone Keeper contexts load ServerSettings, and it preserves the non-Poco keeper-bench path by setting the context config before setApplicationType. I still cannot approve it because the new stateless regression test does not actually prove the reported /proc/pressure/* access is gone in the failure mode this PR is supposed to fix.

Tests
  • ⚠️ [tests/queries/0_stateless/04498_keeper_psi_metrics_setting.sh:101-116] The test only checks that the Keeper process has no open /proc/pressure/* file descriptors after startup. That is weaker than the bug report. AsynchronousMetrics::openFileIfExists catches CANNOT_OPEN_FILE and leaves the destination empty (src/Common/AsynchronousMetrics.cpp:66-89), so the buggy path of “Keeper still tries to open /proc/pressure/io and logs the failure” also leaves no PSI fd behind. This means the test can pass even if the original "Cannot read from file /proc/pressure/io" regression is still present. Please assert on the absence of that warning (or use another check that distinguishes “never touched the file” from “tried and failed to open it”).
Final Verdict
  • Status: ⚠️ Request changes
  • Strengthen the standalone clickhouse-keeper regression test so it fails when Keeper still attempts to access /proc/pressure/* with os_collect_psi_metrics = false.

@clickhouse-gh clickhouse-gh Bot added the pr-improvement Pull request with some product improvements label Jul 6, 2026
Comment thread programs/keeper/Keeper.cpp Outdated
/*update_jemalloc_epoch_=*/memory_worker.getSource() != MemoryWorker::MemoryUsageSource::Jemalloc,
/*update_rss_=*/memory_worker.getSource() == MemoryWorker::MemoryUsageSource::None);
/*update_rss_=*/memory_worker.getSource() == MemoryWorker::MemoryUsageSource::None,
/*collect_psi_metrics_=*/server_settings[ServerSetting::os_collect_psi_metrics]);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This fixes the constructor wiring, but there is still no regression proof for the standalone clickhouse-keeper path that was actually broken here. The bug was that Keeper ignored os_collect_psi_metrics = false and still touched /proc/pressure/*; please add the smallest focused test you can that starts Keeper with the setting disabled and verifies PSI metrics stay absent (or otherwise proves startup no longer reaches those files).

Comment thread programs/keeper/Keeper.cpp Resolved
Comment thread src/Interpreters/Context.cpp Resolved
@clickhouse-gh

clickhouse-gh Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 85.70% 85.70% +0.00%
Functions 92.70% 92.70% +0.00%
Branches 77.90% 77.90% +0.00%

Changed lines: Changed C/C++ lines covered: 25/31 (80.65%) · Uncovered code

Full report · Diff report

@alexey-milovidov alexey-milovidov self-assigned this Jul 7, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Jul 7, 2026
Merged via the queue into ClickHouse:master with commit 3ea5b3f Jul 7, 2026
175 checks passed
@robot-clickhouse-ci-2 robot-clickhouse-ci-2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Jul 7, 2026
zeekay pushed a commit to hanzoai/datastore that referenced this pull request Sep 11, 2026
…/keeper-proc-pressure-errors

Fix "Cannot read from file /proc/pressure/io" for Keeper
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors pr-improvement Pull request with some product improvements pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants