mirror of
https://github.com/openobserve/openobserve.git
synced 2026-11-06 08:09:24 +00:00
fix: do division first while calculating partitions (#6931)
We see an overflow when we multiply the query duration to a large storage size, to fix it we divide the storage size first with the data retention time
This commit is contained in:
@@ -697,8 +697,8 @@ pub async fn search_partition(
|
||||
log::warn!("Data retention is zero, setting to 1 to prevent division by zero");
|
||||
data_retention = 1;
|
||||
}
|
||||
let records = (stats.doc_num as i64 * query_duration) / data_retention;
|
||||
let original_size = (stats.storage_size as i64 * query_duration) / data_retention;
|
||||
let records = (stats.doc_num as i64 / data_retention) * query_duration;
|
||||
let original_size = (stats.storage_size as i64 / data_retention) * query_duration;
|
||||
log::info!(
|
||||
"[trace_id {trace_id}] using approximation: stream: {}, records: {}, original_size: {}",
|
||||
stream_name,
|
||||
|
||||
Reference in New Issue
Block a user