Skip to content

Allow turning LagDetector off#141280

Merged
DaveCTurner merged 3 commits intoelastic:mainfrom
DaveCTurner:2026/01/26/LagDetector-turn-off
Jan 27, 2026
Merged

Allow turning LagDetector off#141280
DaveCTurner merged 3 commits intoelastic:mainfrom
DaveCTurner:2026/01/26/LagDetector-turn-off

Conversation

@DaveCTurner
Copy link
Copy Markdown
Member

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. #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 `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
@DaveCTurner DaveCTurner added >non-issue :Distributed/Cluster Coordination Cluster formation and cluster state publication, including cluster membership and fault detection. v9.4.0 labels Jan 26, 2026
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-distributed-coordination (Team:Distributed Coordination)

@elasticsearchmachine elasticsearchmachine added the Team:Distributed Coordination (obsolete) Meta label for Distributed Coordination team. Obsolete. Please do not use. label Jan 26, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jan 26, 2026

@github-actions
Copy link
Copy Markdown
Contributor

ℹ️ 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 overview

When to use applies_to tags:

✅ At the page level to indicate which products/deployments the content applies to (mandatory)
✅ When features change state (e.g. preview, ga) in a specific version
✅ When availability differs across deployments and environments

What NOT to do:

❌ Don't remove or replace information that applies to an older version
❌ Don't add new information that applies to a specific version without an applies_to tag
❌ Don't forget that applies_to tags can be used at the page, section, and inline level

🤔 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(),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is it worth extending this to have numbers below -1?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

-1 is special, there are no other negative TimeValue values.

Copy link
Copy Markdown
Contributor

@joshua-adams-1 joshua-adams-1 left a comment

Choose a reason for hiding this comment

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

LGTM

@DaveCTurner DaveCTurner enabled auto-merge (squash) January 27, 2026 09:16
@DaveCTurner DaveCTurner merged commit 4ed1fe6 into elastic:main Jan 27, 2026
35 checks passed
schase-es pushed a commit to schase-es/elasticsearch that referenced this pull request Jan 28, 2026
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Distributed/Cluster Coordination Cluster formation and cluster state publication, including cluster membership and fault detection. >non-issue Team:Distributed Coordination (obsolete) Meta label for Distributed Coordination team. Obsolete. Please do not use. v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants