From be86b6056771ee43da661f66b97981b2bcf513b4 Mon Sep 17 00:00:00 2001 From: Ivan Druzhitskiy Date: Mon, 10 Apr 2023 15:25:04 +0300 Subject: [PATCH 1/3] fix overflow --- bob/src/cleaner.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bob/src/cleaner.rs b/bob/src/cleaner.rs index 50e6166d8..6c373b22d 100644 --- a/bob/src/cleaner.rs +++ b/bob/src/cleaner.rs @@ -126,7 +126,7 @@ async fn index_cleanup_by_memory_limit(backend: &Arc, limit: usize) { let mut memory = baseline_memory; while memory > limit { if let Some(freed) = backend.close_oldest_active_blob().await { - memory = memory - freed; + memory = memory.saturating_sub(freed); debug!("closed index for active blob, freeing {:?} bytes", freed); } else { break; From dc64e0b1bc3e4cde366c9f68379d103972d38021 Mon Sep 17 00:00:00 2001 From: Ivan Druzhitskiy Date: Mon, 10 Apr 2023 15:25:25 +0300 Subject: [PATCH 2/3] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a0373194b..6b9d5946d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ Bob versions changelog - Fix incorrect exist result due to variables sharing between keys (#762) - Fix unit of measurement of memory in hardware metrics (#772) - Fix rust deprecation warning (#779) +- Fix cleaner overflow (#781) #### Updated - Logger to logstash updated to qoollo-log4rs-logstash v0.2 (#681) From 1e31ba91ffd3b00aa1a203f7a7288982c3489615 Mon Sep 17 00:00:00 2001 From: ikopylov Date: Mon, 10 Apr 2023 16:11:17 +0200 Subject: [PATCH 3/3] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b9d5946d..d48f44b1c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,7 +22,7 @@ Bob versions changelog - Fix incorrect exist result due to variables sharing between keys (#762) - Fix unit of measurement of memory in hardware metrics (#772) - Fix rust deprecation warning (#779) -- Fix cleaner overflow (#781) +- Fix subtraction overflow in cleaner (#781) #### Updated - Logger to logstash updated to qoollo-log4rs-logstash v0.2 (#681)