Skip to content

Revert "Fix false LOGICAL_ERROR in filesystem cache dynamic resize" - #100271

Merged
kssenii merged 1 commit into
masterfrom
revert-99850-fix-filecache-resize-logical-error
Apr 9, 2026
Merged

kssenii merged 1 commit into
masterfrom
revert-99850-fix-filecache-resize-logical-error

Conversation

@kssenii

@kssenii kssenii commented Mar 21, 2026 •

Copy link
Copy Markdown
Member

Reverts #99850

Version info

  • Merged into: 26.4.1.724

@clickhouse-gh

clickhouse-gh Bot commented Mar 21, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [ec6bcfd]

Summary: ❌

job_name test_name status info comment
Unit tests (asan_ubsan) error IGNORED

AI Review

Summary

This PR reverts #99850 and changes LRUFileCachePriority::modifySizeLimits back to throwing LOGICAL_ERROR on an over-limit condition during dynamic resize. I found one blocker: this reintroduces a previously identified concurrent-resize race outcome as an internal-invariant exception, which can produce false-positive exceptions during normal retryable behavior.

Findings

❌ Blockers

  • [src/Interpreters/Cache/LRUFileCachePriority.cpp:554] Reverting NOT_ENOUGH_SPACE to LOGICAL_ERROR reclassifies a known retryable race during SLRU dynamic resize as an internal logic violation. This regresses Fix false LOGICAL_ERROR in filesystem cache dynamic resize #99850 behavior and may surface avoidable false-positive exceptions during config reload.
    • Suggested fix: keep ErrorCodes::NOT_ENOUGH_SPACE for this path (or another explicit retriable code) and preserve the explanatory comment that this condition is expected under concurrent promotions.

ClickHouse Rules

Item Status Notes
Deletion logging ➖
Serialization versioning ➖
Core-area scrutiny ✅
No test removal ✅
Experimental gate ➖
No magic constants ✅
Backward compatibility ⚠️ Reintroduces false LOGICAL_ERROR behavior previously fixed in #99850.
SettingsChangesHistory.cpp ➖
PR metadata quality ➖
Safe rollout ⚠️ Restoring prior behavior reintroduces known noisy exception path in production-like config reload scenarios.
Compilation time ✅

Performance & Safety

  • Reintroducing LOGICAL_ERROR here weakens operational robustness: an expected concurrent-resize outcome is treated as an internal invariant exception instead of a retriable resource condition.

Final Verdict

  • Status: ❌ Block
  • Minimum required actions:
    • Keep this path retriable (use NOT_ENOUGH_SPACE or equivalent non-bug exception semantics) instead of LOGICAL_ERROR.

@clickhouse-gh clickhouse-gh Bot added the pr-not-for-changelog This PR should not be mentioned in the changelog label Mar 21, 2026
/// causing a sub-queue to temporarily exceed its new limit.
/// The caller catches this and retries on the next config reload.
throw Exception(ErrorCodes::NOT_ENOUGH_SPACE,
throw Exception(ErrorCodes::LOGICAL_ERROR,

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 revert brings back the known race in dynamic cache resize where concurrent promotion in SLRU can leave a sub-queue above its new limit transiently. In that case, this path throws LOGICAL_ERROR, which is treated as an unexpected internal invariant violation even though the condition is recoverable and expected under concurrency.

Could we keep NOT_ENOUGH_SPACE here (as in #99850) or otherwise handle this condition as retriable/non-bug? Reintroducing LOGICAL_ERROR risks noisy false-positive exceptions during config reload and regresses the behavior fixed in that PR.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@kssenii, check this comment ^

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Likely covered by #101991

@clickhouse-gh

clickhouse-gh Bot commented Mar 21, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 83.90% 83.80% -0.10%
Functions 24.70% 24.60% -0.10%
Branches 76.50% 76.50% +0.00%

PR changed lines: PR changed-lines coverage: 20.00% (1/5, 1 noise lines excluded)
Diff coverage report
Uncovered code

@kssenii
kssenii added this pull request to the merge queue Apr 9, 2026
Merged via the queue into master with commit 967bb88 Apr 9, 2026
149 of 150 checks passed
@kssenii
kssenii deleted the revert-99850-fix-filecache-resize-logical-error branch April 9, 2026 17:07
@robot-clickhouse robot-clickhouse added the pr-synced-to-cloud The PR is synced to the cloud repo label Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-not-for-changelog This PR should not be mentioned in the changelog 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.

3 participants