From 2c8efa6902bf9af9b58f9ca524b00390f55388f2 Mon Sep 17 00:00:00 2001 From: wodeyoulai <106662970@qq.com> Date: Tue, 14 Jan 2025 22:19:47 +0800 Subject: [PATCH] docs: correct compaction period comments for 24-hour window Update compaction period logic in periodic compactor to consistently use 24-hour intervals instead of 1-hour. This fixes incorrect time calculations where: - Compaction period now correctly uses 24-hour instead of 1-hour - Revision recording interval updated to 144-minute (1/10 of 24-hour) instead of 6-minute - Retry interval on compaction failure adjusted to 144-minute to match the new period This ensures consistent time-based compaction behavior for 24-hour windows as originally intended. Fixes #[issue-19017] --- server/etcdserver/api/v3compactor/periodic.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/etcdserver/api/v3compactor/periodic.go b/server/etcdserver/api/v3compactor/periodic.go index fcc4f501fc4..f7f1e0c4388 100644 --- a/server/etcdserver/api/v3compactor/periodic.go +++ b/server/etcdserver/api/v3compactor/periodic.go @@ -73,11 +73,11 @@ Compaction period 1-hour: Compaction period 24-hour: 1. compute compaction period, which is 24-hour - 2. record revisions for every 1/10 of 24-hour (144-minute) + 2. record revisions for every 1/10 of 1-hour (144-minute) 3. keep recording revisions with no compaction for first 24-hour 4. do compact with revs[0] - - success? continue on for-loop and move sliding window; revs = revs[1:] - - failure? update revs, and retry after 1/10 of 24-hour (144-minute) + - success? continue on for-loop and move sliding window; revs = revs[1:] + - failure? update revs, and retry after 1/10 of 24-hour (144-minute) Compaction period 59-min: 1. compute compaction period, which is 59-min