You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by we...@apache.org on 2021/11/16 15:09:22 UTC
[hadoop] branch branch-3.3 updated (25bcc7e -> c182bf6)
This is an automated email from the ASF dual-hosted git repository.
weichiu pushed a change to branch branch-3.3
in repository https://gitbox.apache.org/repos/asf/hadoop.git.
from 25bcc7e HDFS-15457. TestFsDatasetImpl fails intermittently (#2407)
new 3bb4a09 HADOOP-17946. Upgrade commons-lang to 3.12.0 (#3575)
new c182bf6 HDFS-16182.numOfReplicas is given the wrong value in BlockPlacementPolicyDefault$chooseTarget can cause DataStreamer to fail with Heterogeneous Storage. (#3320)
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
LICENSE-binary | 3 +-
.../BlockPlacementPolicyDefault.java | 14 +++---
.../apache/hadoop/hdfs/TestBlockStoragePolicy.java | 53 ++++++++++++++++++++++
hadoop-project/pom.xml | 2 +-
4 files changed, 62 insertions(+), 10 deletions(-)
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org
[hadoop] 01/02: HADOOP-17946. Upgrade commons-lang to 3.12.0 (#3575)
Posted by we...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
weichiu pushed a commit to branch branch-3.3
in repository https://gitbox.apache.org/repos/asf/hadoop.git
commit 3bb4a09295fe3388250ce1be311034e29579c51a
Author: Renukaprasad C <48...@users.noreply.github.com>
AuthorDate: Tue Oct 26 06:46:50 2021 +0530
HADOOP-17946. Upgrade commons-lang to 3.12.0 (#3575)
(cherry picked from commit b923fa7a1c74ffd5859803e6e2571d367d066efb)
---
LICENSE-binary | 3 +--
hadoop-project/pom.xml | 2 +-
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/LICENSE-binary b/LICENSE-binary
index 66ed387..7a712a5 100644
--- a/LICENSE-binary
+++ b/LICENSE-binary
@@ -252,7 +252,6 @@ commons-codec:commons-codec:1.11
commons-collections:commons-collections:3.2.2
commons-daemon:commons-daemon:1.0.13
commons-io:commons-io:2.8.0
-commons-lang:commons-lang:2.6
commons-logging:commons-logging:1.1.3
commons-net:commons-net:3.6
de.ruedigermoeller:fst:2.50
@@ -284,7 +283,7 @@ org.apache.commons:commons-compress:1.21
org.apache.commons:commons-configuration2:2.1.1
org.apache.commons:commons-csv:1.0
org.apache.commons:commons-digester:1.8.1
-org.apache.commons:commons-lang3:3.7
+org.apache.commons:commons-lang3:3.12.0
org.apache.commons:commons-math3:3.1.1
org.apache.commons:commons-text:1.4
org.apache.commons:commons-validator:1.6
diff --git a/hadoop-project/pom.xml b/hadoop-project/pom.xml
index 271e694..9c2c243 100644
--- a/hadoop-project/pom.xml
+++ b/hadoop-project/pom.xml
@@ -120,7 +120,7 @@
<commons-compress.version>1.21</commons-compress.version>
<commons-csv.version>1.0</commons-csv.version>
<commons-io.version>2.8.0</commons-io.version>
- <commons-lang3.version>3.7</commons-lang3.version>
+ <commons-lang3.version>3.12.0</commons-lang3.version>
<commons-logging.version>1.1.3</commons-logging.version>
<commons-logging-api.version>1.1</commons-logging-api.version>
<commons-math3.version>3.1.1</commons-math3.version>
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org
[hadoop] 02/02: HDFS-16182.numOfReplicas is given the wrong value in BlockPlacementPolicyDefault$chooseTarget can cause DataStreamer to fail with Heterogeneous Storage. (#3320)
Posted by we...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
weichiu pushed a commit to branch branch-3.3
in repository https://gitbox.apache.org/repos/asf/hadoop.git
commit c182bf65e03127b9935870df91c19d634e20ec50
Author: Neil <wx...@foxmail.com>
AuthorDate: Tue Nov 16 18:21:50 2021 +0800
HDFS-16182.numOfReplicas is given the wrong value in BlockPlacementPolicyDefault$chooseTarget can cause DataStreamer to fail with Heterogeneous Storage. (#3320)
(cherry picked from commit 5626734a36b9794f4b1af8b9a7d8d0055914a094)
---
.../BlockPlacementPolicyDefault.java | 14 +++---
.../apache/hadoop/hdfs/TestBlockStoragePolicy.java | 53 ++++++++++++++++++++++
2 files changed, 60 insertions(+), 7 deletions(-)
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockPlacementPolicyDefault.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockPlacementPolicyDefault.java
index e978089..2d0b721 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockPlacementPolicyDefault.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockPlacementPolicyDefault.java
@@ -435,7 +435,7 @@ public class BlockPlacementPolicyDefault extends BlockPlacementPolicy {
* @param storageTypes storage type to be considered for target
* @return local node of writer (not chosen node)
*/
- private Node chooseTarget(int numOfReplicas,
+ private Node chooseTarget(final int numOfReplicas,
Node writer,
final Set<Node> excludedNodes,
final long blocksize,
@@ -469,7 +469,7 @@ public class BlockPlacementPolicyDefault extends BlockPlacementPolicy {
LOG.trace("storageTypes={}", storageTypes);
try {
- if ((numOfReplicas = requiredStorageTypes.size()) == 0) {
+ if (requiredStorageTypes.size() == 0) {
throw new NotEnoughReplicasException(
"All required storage types are unavailable: "
+ " unavailableStorages=" + unavailableStorages
@@ -498,10 +498,10 @@ public class BlockPlacementPolicyDefault extends BlockPlacementPolicy {
for (DatanodeStorageInfo resultStorage : results) {
addToExcludedNodes(resultStorage.getDatanodeDescriptor(), oldExcludedNodes);
}
- // Set numOfReplicas, since it can get out of sync with the result list
+ // Set newNumOfReplicas, since it can get out of sync with the result list
// if the NotEnoughReplicasException was thrown in chooseRandom().
- numOfReplicas = totalReplicasExpected - results.size();
- return chooseTarget(numOfReplicas, writer, oldExcludedNodes, blocksize,
+ int newNumOfReplicas = totalReplicasExpected - results.size();
+ return chooseTarget(newNumOfReplicas, writer, oldExcludedNodes, blocksize,
maxNodesPerRack, results, false, storagePolicy, unavailableStorages,
newBlock, null);
}
@@ -520,8 +520,8 @@ public class BlockPlacementPolicyDefault extends BlockPlacementPolicy {
addToExcludedNodes(resultStorage.getDatanodeDescriptor(),
oldExcludedNodes);
}
- numOfReplicas = totalReplicasExpected - results.size();
- return chooseTarget(numOfReplicas, writer, oldExcludedNodes, blocksize,
+ int newNumOfReplicas = totalReplicasExpected - results.size();
+ return chooseTarget(newNumOfReplicas, writer, oldExcludedNodes, blocksize,
maxNodesPerRack, results, false, storagePolicy, unavailableStorages,
newBlock, null);
}
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestBlockStoragePolicy.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestBlockStoragePolicy.java
index c36315b..171ebb4 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestBlockStoragePolicy.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestBlockStoragePolicy.java
@@ -1300,6 +1300,59 @@ public class TestBlockStoragePolicy {
Assert.assertEquals(StorageType.DISK, targets[1].getStorageType());
}
+ /**
+ * Consider a File with All_SSD storage policy.
+ * 1. Choose 3 DISK DNs for pipeline because SSD DNs no enough at
+ * the beginning.
+ * 2. One of DISK DNs fails And it need choose one new DN for existing.
+ * pipeline {@link DataStreamer addDatanode2ExistingPipeline()}.
+ * Make sure the number of target DNs are 3.
+ * see HDFS-16182.
+ */
+ @Test
+ public void testAddDatanode2ExistingPipelineInSsd() throws Exception {
+ BlockStoragePolicy policy = POLICY_SUITE.getPolicy(ALLSSD);
+
+ final String[] racks = {"/d1/r1", "/d2/r2", "/d3/r3", "/d4/r4", "/d5/r5",
+ "/d6/r6", "/d7/r7"};
+ final String[] hosts = {"host1", "host2", "host3", "host4", "host5",
+ "host6", "host7"};
+ final StorageType[] disks = {StorageType.DISK, StorageType.DISK, StorageType.DISK};
+
+ final DatanodeStorageInfo[] diskStorages
+ = DFSTestUtil.createDatanodeStorageInfos(7, racks, hosts, disks);
+ final DatanodeDescriptor[] dataNodes
+ = DFSTestUtil.toDatanodeDescriptor(diskStorages);
+ for (int i = 0; i < dataNodes.length; i++) {
+ BlockManagerTestUtil.updateStorage(dataNodes[i],
+ new DatanodeStorage("ssd" + i + 1, DatanodeStorage.State.NORMAL,
+ StorageType.SSD));
+ }
+
+ FileSystem.setDefaultUri(conf, "hdfs://localhost:0");
+ conf.set(DFSConfigKeys.DFS_NAMENODE_HTTP_ADDRESS_KEY, "0.0.0.0:0");
+ File baseDir = PathUtils.getTestDir(TestReplicationPolicy.class);
+ conf.set(DFSConfigKeys.DFS_NAMENODE_NAME_DIR_KEY,
+ new File(baseDir, "name").getPath());
+ DFSTestUtil.formatNameNode(conf);
+ NameNode namenode = new NameNode(conf);
+
+ final BlockManager bm = namenode.getNamesystem().getBlockManager();
+ BlockPlacementPolicy replicator = bm.getBlockPlacementPolicy();
+ NetworkTopology cluster = bm.getDatanodeManager().getNetworkTopology();
+ for (DatanodeDescriptor datanode : dataNodes) {
+ cluster.add(datanode);
+ }
+ // chsenDs are DISK StorageType to simulate not enough SDD Storage
+ List<DatanodeStorageInfo> chsenDs = new ArrayList<>();
+ chsenDs.add(diskStorages[0]);
+ chsenDs.add(diskStorages[1]);
+ DatanodeStorageInfo[] targets = replicator.chooseTarget("/foo", 1,
+ null, chsenDs, true,
+ new HashSet<Node>(), 0, policy, null);
+ Assert.assertEquals(3, targets.length);
+ }
+
@Test
public void testGetFileStoragePolicyAfterRestartNN() throws Exception {
//HDFS8219
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org