This is an automated email from the ASF dual-hosted git repository.
morningman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git
The following commit(s) were added to refs/heads/master by this push:
new 985ec98 [Bug] Fix the calculation of the variable "left_bytes" in
data_dir.cpp (#4609)
985ec98 is described below
commit 985ec98a9b38bdf1823667ec512960b9e81d7f77
Author: weizuo93 <[email protected]>
AuthorDate: Sun Sep 20 20:54:13 2020 +0800
[Bug] Fix the calculation of the variable "left_bytes" in data_dir.cpp
(#4609)
Suppose that the current available byte in a disk is `_available_bytes`.
After the data with size of `incoming_data_size` is written in the disk, the
left space in the disk should be calculated as follow :
`int64_t left_bytes = _available_bytes - incoming_data_size;`
rather than:
`int64_t left_bytes = _disk_capacity_bytes - _available_bytes -
incoming_data_size;`
---
be/src/olap/data_dir.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/be/src/olap/data_dir.cpp b/be/src/olap/data_dir.cpp
index 42afdd8..f5b5fbb 100644
--- a/be/src/olap/data_dir.cpp
+++ b/be/src/olap/data_dir.cpp
@@ -986,7 +986,7 @@ void DataDir::update_user_data_size(int64_t size) {
bool DataDir::reach_capacity_limit(int64_t incoming_data_size) {
double used_pct = (_disk_capacity_bytes - _available_bytes +
incoming_data_size) /
(double)_disk_capacity_bytes;
- int64_t left_bytes = _disk_capacity_bytes - _available_bytes -
incoming_data_size;
+ int64_t left_bytes = _available_bytes - incoming_data_size;
if (used_pct >= config::storage_flood_stage_usage_percent / 100.0 &&
left_bytes <= config::storage_flood_stage_left_capacity_bytes) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]