-
Notifications
You must be signed in to change notification settings - Fork 588
HDDS-8660. Notify ReplicationManager when nodes go dead or out of service #7997
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
Merged
sodonnel
merged 19 commits into
apache:master
from
peterxcli:hdds8660-ReplicationManager-Notify-when-dead-nodes-or-nodes-go-out-of-service
Apr 9, 2025
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
a06b7a4
Add node state change notification for ReplicationManager
peterxcli 27ccf55
Node state change in NodeManager should notify ReplicationManager
peterxcli caaa220
Notify ReplicationManager when a node becomes dead
peterxcli 431c717
fix pmd
peterxcli bc7aa2f
fix tests
peterxcli 3c9f838
Introduce ReplicationManagerEventHandler to decouple NM and RM
peterxcli c969709
Change notify call to RM to publish RM_NOTIFY event to queue
peterxcli f7363de
Some old code cleanup
peterxcli 00e526f
Add ReplicationManagerEventHandler to SCM event queue
peterxcli 6a53c3a
NPE in TestDeadNodeHandler
peterxcli 32705a2
Notify RM if persisted op state changed
peterxcli bf17079
Add integration test for RM on RM being notify when node status chang…
peterxcli 6092de1
Addressed comment: Only notify when leader ready and out of safemode
peterxcli b15af64
Addressed comment: don't notify when RM is running
peterxcli b2642bc
Addressed comment: Only notify when node is not IN_MAINTENANCE status…
peterxcli b6e71f3
Merge remote-tracking branch 'upstream/master' into hdds8660-Replicat…
peterxcli 6c7affa
Merge remote-tracking branch 'upstream/master' into hdds8660-Replicat…
peterxcli fe73650
Merge remote-tracking branch 'upstream/master' into hdds8660-Replicat…
peterxcli ffd034d
Reuse cluster in TestReplicationManagerIntegration
peterxcli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
...java/org/apache/hadoop/hdds/scm/container/replication/ReplicationManagerEventHandler.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one or more | ||
| * contributor license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright ownership. | ||
| * The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| * (the "License"); you may not use this file except in compliance with | ||
| * the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| package org.apache.hadoop.hdds.scm.container.replication; | ||
|
|
||
| import org.apache.hadoop.hdds.protocol.DatanodeDetails; | ||
| import org.apache.hadoop.hdds.scm.ha.SCMContext; | ||
| import org.apache.hadoop.hdds.server.events.EventHandler; | ||
| import org.apache.hadoop.hdds.server.events.EventPublisher; | ||
| import org.slf4j.Logger; | ||
| import org.slf4j.LoggerFactory; | ||
|
|
||
| /** | ||
| * Handles events related to the ReplicationManager. | ||
| */ | ||
| public class ReplicationManagerEventHandler implements EventHandler<DatanodeDetails> { | ||
|
|
||
| private static final Logger LOG = LoggerFactory.getLogger(ReplicationManagerEventHandler.class); | ||
|
|
||
| private final ReplicationManager replicationManager; | ||
| private final SCMContext scmContext; | ||
|
|
||
| public ReplicationManagerEventHandler(ReplicationManager replicationManager, SCMContext scmContext) { | ||
| this.replicationManager = replicationManager; | ||
| this.scmContext = scmContext; | ||
| } | ||
|
|
||
| @Override | ||
| public void onMessage(DatanodeDetails datanodeDetails, EventPublisher eventPublisher) { | ||
xichen01 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| if (!scmContext.isLeaderReady() || scmContext.isInSafeMode()) { | ||
| // same condition in ReplicationManager | ||
| return; | ||
| } | ||
| LOG.debug("ReplicationManagerEventHandler received event for datanode: {}", datanodeDetails); | ||
| replicationManager.notifyNodeStateChange(); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.