Skip to content

policer: add boost multiplier#3855

Merged
roman-khimov merged 2 commits intomasterfrom
policer-boost-mode
Mar 6, 2026
Merged

policer: add boost multiplier#3855
roman-khimov merged 2 commits intomasterfrom
policer-boost-mode

Conversation

@End-rey
Copy link
Contributor

@End-rey End-rey commented Feb 27, 2026

Closes #3762.

@codecov
Copy link

codecov bot commented Feb 27, 2026

Codecov Report

❌ Patch coverage is 44.89796% with 27 lines in your changes missing coverage. Please review.
✅ Project coverage is 25.78%. Comparing base (72d4b6d) to head (15aeb6a).
⚠️ Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
pkg/services/policer/process.go 48.78% 19 Missing and 2 partials ⚠️
pkg/services/policer/policer.go 0.00% 3 Missing ⚠️
cmd/neofs-node/config.go 0.00% 1 Missing ⚠️
cmd/neofs-node/object.go 0.00% 1 Missing ⚠️
pkg/services/policer/reload.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3855      +/-   ##
==========================================
+ Coverage   25.77%   25.78%   +0.01%     
==========================================
  Files         670      670              
  Lines       43113    43173      +60     
==========================================
+ Hits        11112    11132      +20     
- Misses      30983    31021      +38     
- Partials     1018     1020       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@End-rey End-rey force-pushed the policer-boost-mode branch 3 times, most recently from 41d14dc to 7b26cb7 Compare March 4, 2026 15:15
@End-rey End-rey requested a review from roman-khimov March 4, 2026 15:54
p.mtx.RUnlock()
// boostWindowSize is the number of recent batches tracked to compute the
// current boost multiplier.
const boostWindowSize = 8
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you have any inspiration why it is not e.g. 100? 8 seems too low to me

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just pulled that number out of thin air. With that size, it would take 5 iterations requiring replication to trigger the boost mode. Maybe it could be increased to 16-32, but 100 seems like too much: it would take 51 iterations with replication to trigger the boost mode, which would be too rare, in my opinion.

@End-rey End-rey force-pushed the policer-boost-mode branch from 7b26cb7 to 15aeb6a Compare March 6, 2026 11:54
End-rey added 2 commits March 6, 2026 14:55
When the policer detects missing replicas and triggers replication, it enters
"boost mode" and multiplies the object batch size by a configurable boost
multiplier for subsequent batches. To avoid premature activation on short-lived
outages and premature deactivation during netmap changes, boost mode uses a
sliding window of the last 8 batches: the policer enters boost when a strict
majority of the window's batches required replication, and leaves it when a
strict majority were clean. An equal split keeps the current state unchanged.
This significantly speeds up cluster recovery. Add new reloadable config option
`policer.boost_multiplier`.

Closes #3762.

Signed-off-by: Andrey Butusov <andrey@nspcc.io>
Signed-off-by: Andrey Butusov <andrey@nspcc.io>
@roman-khimov roman-khimov merged commit 6e3c157 into master Mar 6, 2026
22 checks passed
@roman-khimov roman-khimov deleted the policer-boost-mode branch March 6, 2026 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Policer boost mode

3 participants