Skip to content

Fix possible race in fs cache#40586

Merged
kssenii merged 8 commits intoClickHouse:masterfrom
kssenii:fix-race
Aug 30, 2022
Merged

Fix possible race in fs cache#40586
kssenii merged 8 commits intoClickHouse:masterfrom
kssenii:fix-race

Conversation

@kssenii
Copy link
Copy Markdown
Member

@kssenii kssenii commented Aug 24, 2022

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in official stable or prestable release)

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

Fix possible race in filesystem cache.

@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-bugfix Pull request with bugfix, not backported by default label Aug 24, 2022
@alesapin alesapin self-assigned this Aug 28, 2022
std::lock_guard cache_lock(cache->mutex);

size_to_reserve = size_to_reserve - already_reserved_size;
reserved = cache->tryReserve(key(), offset(), size_to_reserve, cache_lock);
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.

As far as I see the main fix is here.

@kssenii kssenii merged commit 5eb1883 into ClickHouse:master Aug 30, 2022
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.

3 participants