Skip to content

Fix segfault when 'not enough space'#17737

Merged
alesapin merged 2 commits intomasterfrom
fix_segfault_in_distributed_out_stream
Dec 5, 2020
Merged

Fix segfault when 'not enough space'#17737
alesapin merged 2 commits intomasterfrom
fix_segfault_in_distributed_out_stream

Conversation

@tavplubix
Copy link
Copy Markdown
Member

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

Changelog category (leave one):

  • Bug Fix

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Fixed segfault when there is not enough space when inserting into Distributed table.

Detailed description / Documentation draft:
#17664 (comment)

@robot-clickhouse robot-clickhouse added the pr-bugfix Pull request with bugfix, not backported by default label Dec 2, 2020
}


ReservationPtr StoragePolicy::reserveAndCheck(UInt64 bytes) const
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.

Maybe get rid of MergeTreeData::checkAndReturnReservation()? Otherwise it may lead to similar problem, when using functions that required the mentioned method after their invocation.

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.

It's a good idea, we can rename reserve(...) to tryReserve(...) and reserveAndCheck(...) to just reserve(...), so it will be consistent with other names. But we also have similar reserve(UInt64 bytes) method in Space (IDisk) interface and I don't want to change a lot of signatures in bugfix PR.

@tavplubix
Copy link
Copy Markdown
Member Author

Stress test (address) and Stress test (memory) - #17744

@alesapin
Copy link
Copy Markdown
Member

alesapin commented Dec 3, 2020

Let me rerun some tests.

@alesapin alesapin self-assigned this Dec 4, 2020
@alesapin alesapin merged commit 0eec52b into master Dec 5, 2020
@alesapin alesapin deleted the fix_segfault_in_distributed_out_stream branch December 5, 2020 13:14
alesapin added a commit that referenced this pull request Dec 5, 2020
…_out_stream

Fix segfault when 'not enough space'

(cherry picked from commit 0eec52b)
alesapin added a commit that referenced this pull request Dec 5, 2020
…_out_stream

Fix segfault when 'not enough space'

(cherry picked from commit 0eec52b)
alesapin added a commit that referenced this pull request Dec 5, 2020
…_out_stream

Fix segfault when 'not enough space'

(cherry picked from commit 0eec52b)
alesapin added a commit that referenced this pull request Dec 6, 2020
…_out_stream

Fix segfault when 'not enough space'

(cherry picked from commit 0eec52b)
alesapin added a commit that referenced this pull request Feb 18, 2021
…b0a862ba4720f5ef58fa0fcde5fd6

Cherry pick #17737 to 20.8: Fix segfault when 'not enough space'
tavplubix added a commit that referenced this pull request Feb 20, 2021
Backport #17737 to 20.8: Fix segfault when 'not enough space'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-bugfix Pull request with bugfix, not backported by default

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants