Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
eef0e79
HDDS-6447. Refine SCM handling of unhealthy container replicas
hanishakoneru Mar 30, 2022
4ad7d2b
Do not delete quasi-closed replica if there is no closed replica present
hanishakoneru Apr 4, 2022
1f8ff63
Review comments + unit test
hanishakoneru Apr 8, 2022
24ee2fa
Merge branch 'master' into HDDS-6447
errose28 Oct 26, 2022
53388a2
Minor clarifications
errose28 Oct 26, 2022
41ba313
Initial refactoring of tests
errose28 Oct 27, 2022
fb99d06
First draft of new handling in RM + minor test update
errose28 Oct 31, 2022
b7d1299
Checkstyle
errose28 Oct 31, 2022
4b35b5e
Merge branch 'master' into HDDS-6447
errose28 Dec 5, 2022
6dd95c5
Another test fix + WIP notes
errose28 Dec 6, 2022
8640e11
Fixes to RM to better handle mis-replicatation and pass tests
errose28 Dec 7, 2022
d5631f5
More minor test fixes
errose28 Dec 8, 2022
ca9aee8
Split unstable handler in legacy RM and split into common methods
errose28 Dec 12, 2022
0b87548
Test fixes
errose28 Dec 12, 2022
d504ac6
Merge branch 'HDDS-6447-take2' into HDDS-6447
errose28 Dec 12, 2022
9af4a97
Fix topology tests
errose28 Dec 12, 2022
3ad2fb2
Combine rep source filtering and delete sorting
errose28 Dec 14, 2022
fedf68f
All LegacyReplicationManager unit tests passing except unstable ones
errose28 Dec 14, 2022
5ab6c4c
More test fixes
errose28 Dec 14, 2022
2f5e295
All legacy RM unit tests pass except for one incomplete test
errose28 Dec 15, 2022
e4d1289
Checkstyle
errose28 Dec 15, 2022
0e40137
Don't send delete commands to non IN_SERVICE nodes
errose28 Dec 15, 2022
fe2fd7e
Move replication report stats updates to their own method
errose28 Dec 16, 2022
1545ce5
Fix unique oriign node ID selector from old TODO
errose28 Dec 16, 2022
913eca9
Closing unhealthy replicas test and RM updates/fixes
errose28 Dec 20, 2022
b15d4b2
checkstyle
errose28 Dec 20, 2022
9b1c028
Add method docs
errose28 Dec 21, 2022
7a040b3
Add more logs
errose28 Dec 21, 2022
d83a7b3
Merge branch 'master' into HDDS-6447
errose28 Dec 21, 2022
b9e0b34
Initial report updates marked
errose28 Dec 22, 2022
2f1d316
Finish report updates and minor test fixes
errose28 Dec 22, 2022
b36ed76
Merge branch 'HDDS-6447-fix-stats' into HDDS-6447
errose28 Dec 22, 2022
b7b8c8d
Switch RatisContainerReplicaCount to use method for geting healthy re…
errose28 Jan 6, 2023
cf3dc09
Implement adapter in RatisContainerReplicaCount for legacy RM
errose28 Jan 6, 2023
85330db
Rat
errose28 Jan 6, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,10 @@ public void onMessage(final ContainerReportFromDatanode reportFromDatanode,
}

/**
* Processes the ContainerReport, unknown container reported
* that will be deleted by SCM.
* Processes the ContainerReport.
* Any unknown container reported by DN and not present in SCM
* containerSet will either be logged as an error or deleted based on
* unknownContainerHandleAction.
*
* @param datanodeDetails Datanode from which this report was received
* @param container ContainerInfo representing the container
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import org.apache.hadoop.hdds.scm.container.ContainerInfo;
import org.apache.hadoop.hdds.scm.container.ContainerReplica;

import java.util.Set;
import java.util.List;

import static org.apache.hadoop.hdds.protocol.proto.HddsProtos.NodeOperationalState.IN_SERVICE;

Expand All @@ -32,7 +32,7 @@
public interface ContainerReplicaCount {
ContainerInfo getContainer();

Set<ContainerReplica> getReplicas();
List<ContainerReplica> getReplicas();

boolean isSufficientlyReplicated();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
Expand Down Expand Up @@ -74,14 +75,20 @@ public class ECContainerReplicaCount implements ContainerReplicaCount {
private final Map<Integer, Integer> healthyIndexes = new HashMap<>();
private final Map<Integer, Integer> decommissionIndexes = new HashMap<>();
private final Map<Integer, Integer> maintenanceIndexes = new HashMap<>();
private final Set<ContainerReplica> replicas;
private final List<ContainerReplica> replicas;

public ECContainerReplicaCount(ContainerInfo containerInfo,
Set<ContainerReplica> replicas,
List<ContainerReplicaOp> replicaPendingOps,
int remainingMaintenanceRedundancy) {
this.containerInfo = containerInfo;
this.replicas = replicas;
// Iterate replicas in deterministic order to avoid potential data loss
// on delete.
// See https://issues.apache.org/jira/browse/HDDS-4589.
// N.B., sort replicas by (containerID, datanodeDetails).
this.replicas = replicas.stream()
.sorted(Comparator.comparingLong(ContainerReplica::hashCode))
.collect(Collectors.toList());
this.repConfig = (ECReplicationConfig)containerInfo.getReplicationConfig();
this.pendingAdd = new ArrayList<>();
this.pendingDelete = new ArrayList<>();
Expand Down Expand Up @@ -158,7 +165,7 @@ public ContainerInfo getContainer() {
}

@Override
public Set<ContainerReplica> getReplicas() {
public List<ContainerReplica> getReplicas() {
return replicas;
}

Expand Down
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
* <p/>
* http://www.apache.org/licenses/LICENSE-2.0
* <p/>
* 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.scm.container.ContainerInfo;
import org.apache.hadoop.hdds.scm.container.ContainerReplica;

import java.util.Set;

/**
* When HDDS-6447 was done to improve the LegacyReplicationManager, work on
* the new replication manager had already started. When this class was added,
* the LegacyReplicationManager needed separate handling for healthy and
* unhealthy container replicas, but the new replication manager did not yet
* have this functionality. This class is used by the
* LegacyReplicationManager to allow {@link RatisContainerReplicaCount} to
* function for both use cases. When the new replication manager is finished
* and LegacyReplicationManager is removed, this class should be deleted and
* all necessary functionality consolidated to
* {@link RatisContainerReplicaCount}
*/
public class LegacyRatisContainerReplicaCount extends
RatisContainerReplicaCount {
public LegacyRatisContainerReplicaCount(ContainerInfo container,
Set<ContainerReplica> replicas,
int inFlightAdd,
int inFlightDelete, int replicationFactor,
int minHealthyForMaintenance) {
super(container, replicas, inFlightAdd, inFlightDelete, replicationFactor,
minHealthyForMaintenance);
}

@Override
protected int healthyReplicaCountAdapter() {
return 0;
}
}
Loading