Reset buffer cancellation on rewind#102524
Reset buffer cancellation on rewind#102524nikitamikhaylov merged 6 commits intoClickHouse:masterfrom
Conversation
|
Workflow [PR], commit [7b51a5a] Summary: ✅ AI ReviewSummaryThis PR fixes a real state-reset bug in Missing context
ClickHouse Rules
Final Verdict
|
Ergus
left a comment
There was a problem hiding this comment.
Could we add a test for this fix?
|
This looks like a bugfix, not an improvement. |
I was a little bit confused with a comment around "bugfix (user-visible misbehavior)". Because the issue is only visible for users in debug releases. Let me set it as a bugfix
Sure, let me try to add it |
|
As you describe the issue it could be reproduced from sql right? If so, then an sql test is preferred over unit tests in cases like this. |
The error wasn't triggered by any specific sql. The What's your recommendation over tests? I see that |
alexey-milovidov
left a comment
There was a problem hiding this comment.
Do not merge before fixing "Logical error: '!res.empty()' (STID: 2508-3ea0)"
LLVM Coverage Report
Changed lines: 100.00% (42/42) · Uncovered code |
I've merged master with your latest fix for |
|
I think we can merge this. @alexey-milovidov any objection? |
While testing a debug build I noticed
chasserterrors:<Fatal> : Logical error: 'ReadBuffer is canceled. Can't read from it.'Stack Trace:
The check is defined in
src/IO/ReadBuffer.cpp, line 90:The issue is caused by calling
ReadBufferFromFileDescriptor::rewind()without resettingcanceledflag.The fix resets the
canceledflag on rewind. The same fix is applied toAsynchronousReadBufferFromFileDescriptor::rewind()for consistencyChangelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fixes a chassert exception
ReadBuffer is canceledin debug builds in AsynchronousMetrics, caused by rewind not resetting the buffer cancellation flag.