Allow turning LagDetector off#141280
Conversation
Today you can set an arbitrarily long timeout on the `LagDetector` but there's no facility to just completely turn it off. The usual values of `0` and `-1` that one might expect to do so are forbidden. There's no good reason for this any more, see e.g. elastic#140434, so with this commit we adjust the setting to accept nonpositive timeouts and interpret them to mean that no lag detection should take place. Relates ES-10778
|
Pinging @elastic/es-distributed-coordination (Team:Distributed Coordination) |
🔍 Preview links for changed docs |
ℹ️ Important: Docs version tagging👋 Thanks for updating the docs! Just a friendly reminder that our docs are now cumulative. This means all 9.x versions are documented on the same page and published off of the main branch, instead of creating separate pages for each minor version. We use applies_to tags to mark version-specific features and changes. Expand for a quick overviewWhen to use applies_to tags:✅ At the page level to indicate which products/deployments the content applies to (mandatory) What NOT to do:❌ Don't remove or replace information that applies to an older version 🤔 Need help?
|
| @TestLogging(reason = "testing LagDetector logging", value = LOGGER_NAME + ":DEBUG") | ||
| public void testLagDetectorDisabled() { | ||
| final var lagDetector = new LagDetector( | ||
| Settings.builder().put(CLUSTER_FOLLOWER_LAG_TIMEOUT_SETTING.getKey(), randomFrom(TimeValue.ZERO, TimeValue.MINUS_ONE)).build(), |
There was a problem hiding this comment.
Is it worth extending this to have numbers below -1?
There was a problem hiding this comment.
-1 is special, there are no other negative TimeValue values.
Today you can set an arbitrarily long timeout on the `LagDetector` but there's no facility to just completely turn it off. The usual values of `0` and `-1` that one might expect to do so are forbidden. There's no good reason for this any more, see e.g. elastic#140434, so with this commit we adjust the setting to accept nonpositive timeouts and interpret them to mean that no lag detection should take place. Relates ES-10778
Today you can set an arbitrarily long timeout on the
LagDetectorbutthere's no facility to just completely turn it off. The usual values of
0and-1that one might expect to do so are forbidden.There's no good reason for this any more, see e.g. #140434, so with this
commit we adjust the setting to accept nonpositive timeouts and
interpret them to mean that no lag detection should take place.
Relates ES-10778