From cf531602216e7947d185925a6b04913fe316514d Mon Sep 17 00:00:00 2001 From: millb Date: Thu, 20 Feb 2020 19:21:28 +0300 Subject: [PATCH 1/2] fixed bug --- dbms/src/Disks/DiskLocal.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/dbms/src/Disks/DiskLocal.cpp b/dbms/src/Disks/DiskLocal.cpp index 421583a4258..47f1620144a 100644 --- a/dbms/src/Disks/DiskLocal.cpp +++ b/dbms/src/Disks/DiskLocal.cpp @@ -101,7 +101,11 @@ bool DiskLocal::tryReserve(UInt64 bytes) UInt64 DiskLocal::getTotalSpace() const { - auto fs = getStatVFS(disk_path); + struct statvfs fs; + if (name == "default") /// for default disk we get space from path/data/ + fs = getStatVFS(disk_path + "data/"); + else + fs = getStatVFS(disk_path); UInt64 total_size = fs.f_blocks * fs.f_bsize; if (total_size < keep_free_space_bytes) return 0; @@ -112,7 +116,11 @@ UInt64 DiskLocal::getAvailableSpace() const { /// we use f_bavail, because part of b_free space is /// available for superuser only and for system purposes - auto fs = getStatVFS(disk_path); + struct statvfs fs; + if (name == "default") /// for default disk we get space from path/data/ + fs = getStatVFS(disk_path + "data/"); + else + fs = getStatVFS(disk_path); UInt64 total_size = fs.f_bavail * fs.f_bsize; if (total_size < keep_free_space_bytes) return 0; From bc910d3489dacc9877047a873bce26586b157bec Mon Sep 17 00:00:00 2001 From: alexey-milovidov Date: Fri, 21 Feb 2020 17:05:57 +0300 Subject: [PATCH 2/2] Trigger CI --- dbms/src/Disks/DiskLocal.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/dbms/src/Disks/DiskLocal.cpp b/dbms/src/Disks/DiskLocal.cpp index 47f1620144a..75a17923076 100644 --- a/dbms/src/Disks/DiskLocal.cpp +++ b/dbms/src/Disks/DiskLocal.cpp @@ -8,6 +8,7 @@ namespace DB { + namespace ErrorCodes { extern const int UNKNOWN_ELEMENT_IN_CONFIG;