mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-16 11:22:12 +00:00
Fix race
This commit is contained in:
parent
730ac4de93
commit
0bceb5957a
@ -469,7 +469,7 @@ bool FileSegment::reserve(size_t size_to_reserve)
|
||||
/// No lock is required because reserved size is always
|
||||
/// mananaged (read/modified) by the downloader only
|
||||
/// or in isLastHolder() case.
|
||||
/// Therefore, atomic must not be used, it will only hide possible races.
|
||||
/// It is made atomic because of getInfoForLog.
|
||||
reserved_size += size_to_reserve;
|
||||
}
|
||||
}
|
||||
|
@ -318,7 +318,7 @@ private:
|
||||
|
||||
/// downloaded_size should always be less or equal to reserved_size
|
||||
std::atomic<size_t> downloaded_size = 0;
|
||||
size_t reserved_size = 0;
|
||||
std::atomic<size_t> reserved_size = 0;
|
||||
|
||||
/// global locking order rule:
|
||||
/// 1. cache lock
|
||||
|
Loading…
Reference in New Issue
Block a user