Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decouple DiskThresholdMonitor & ClusterInfoService #44105

Conversation

DaveCTurner
Copy link
Contributor

Today the ClusterInfoService requires the DiskThresholdMonitor at
construction time so that it can notify it when nodes report changes in their
disk usage, but this is awkward to construct: the DiskThresholdMonitor
requires a RerouteService which requires an AllocationService which comees
from the ClusterModule which requires the ClusterInfoService.

Today we break the cycle with a LazilyInitializedRerouteService which is
itself a little ugly. This commit replaces this with a more traditional
subject/observer relationship between the ClusterInfoService and the
DiskThresholdMonitor.

Today the `ClusterInfoService` requires the `DiskThresholdMonitor` at
construction time so that it can notify it when nodes report changes in their
disk usage, but this is awkward to construct: the `DiskThresholdMonitor`
requires a `RerouteService` which requires an `AllocationService` which comees
from the `ClusterModule` which requires the `ClusterInfoService`.

Today we break the cycle with a `LazilyInitializedRerouteService` which is
itself a little ugly. This commit replaces this with a more traditional
subject/observer relationship between the `ClusterInfoService` and the
`DiskThresholdMonitor`.
@DaveCTurner DaveCTurner added the WIP label Jul 9, 2019
@DaveCTurner DaveCTurner requested a review from rjernst July 9, 2019 09:49
@DaveCTurner
Copy link
Contributor Author

Opened for discussion with @rjernst, no plan to merge this yet so no labels.

@DaveCTurner DaveCTurner added :Distributed Coordination/Allocation All issues relating to the decision making around placing a shard (both master logic & on the nodes) >refactoring v7.4.0 v8.0.0 labels Jul 9, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed

@DaveCTurner DaveCTurner removed the WIP label Jul 9, 2019
Copy link
Member

@rjernst rjernst 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 requested review from rjernst and ywelsch July 9, 2019 17:42
@DaveCTurner DaveCTurner merged commit af512f9 into elastic:master Jul 9, 2019
@DaveCTurner DaveCTurner deleted the 2019-07-09-clusterinfoservice-listeners branch July 9, 2019 17:43
DaveCTurner added a commit that referenced this pull request Jul 9, 2019
Today the `ClusterInfoService` requires the `DiskThresholdMonitor` at
construction time so that it can notify it when nodes report changes in their
disk usage, but this is awkward to construct: the `DiskThresholdMonitor`
requires a `RerouteService` which requires an `AllocationService` which comees
from the `ClusterModule` which requires the `ClusterInfoService`.

Today we break the cycle with a `LazilyInitializedRerouteService` which is
itself a little ugly. This commit replaces this with a more traditional
subject/observer relationship between the `ClusterInfoService` and the
`DiskThresholdMonitor`.
kovrus added a commit to crate/crate that referenced this pull request Sep 23, 2019
kovrus added a commit to crate/crate that referenced this pull request Sep 24, 2019
kovrus added a commit to crate/crate that referenced this pull request Sep 25, 2019
mergify bot pushed a commit to crate/crate that referenced this pull request Sep 25, 2019
mergify bot pushed a commit to crate/crate that referenced this pull request Sep 25, 2019
mergify bot pushed a commit to crate/crate that referenced this pull request Sep 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed Coordination/Allocation All issues relating to the decision making around placing a shard (both master logic & on the nodes) >refactoring v7.4.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants