mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 16:12:01 +00:00
Disks: More accurate free space calculation for least_used
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
This commit is contained in:
parent
757894b10f
commit
a350991284
@ -82,8 +82,9 @@ private:
|
||||
ReservationPtr reserve(uint64_t bytes)
|
||||
{
|
||||
ReservationPtr reservation = disk->reserve(bytes);
|
||||
if (reservation)
|
||||
free_size -= bytes;
|
||||
/// Not just subtract bytes, but update the value,
|
||||
/// since some reservations may be done directly via IDisk, or not by ClickHouse.
|
||||
free_size = reservation->getUnreservedSpace();
|
||||
return reservation;
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user