<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Fixing Over-replicated Blocks in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Fixing-Over-replicated-Blocks/m-p/46872#M45059</link>
    <description>&lt;P&gt;Answering my question...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The source code of&amp;nbsp;&lt;FONT face="courier new,courier"&gt;org.apache.hadoop.hdfs.server.blockmanagement.BlockManager&lt;/FONT&gt;&amp;nbsp;says&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;...
    if (numCurrentReplica &amp;gt; expectedReplication) {
      if (num.replicasOnStaleNodes() &amp;gt; 0) {
        // If any of the replicas of this block are on nodes that are
        // considered "stale", then these replicas may in fact have
        // already been deleted. So, we cannot safely act on the
        // over-replication until a later point in time, when
        // the "stale" nodes have block reported.
        return MisReplicationResult.POSTPONE;
      }
...&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So the key point is whether the DataNodes are "stale". I don't know how to force the&amp;nbsp;nodes to have block reported besides restarting. So I restarted all DataNode and over-replicated blocks gone.&lt;/P&gt;</description>
    <pubDate>Wed, 02 Nov 2016 06:03:20 GMT</pubDate>
    <dc:creator>athtsang</dc:creator>
    <dc:date>2016-11-02T06:03:20Z</dc:date>
    <item>
      <title>Fixing Over-replicated Blocks</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Fixing-Over-replicated-Blocks/m-p/46868#M45057</link>
      <description>&lt;P&gt;&lt;SPAN&gt;CentOS 6.6&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;CDH 5.1.2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Due to space pressure, I need to reduce replication factor of existing files from 3 to 2.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;A command like the following is executed&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;[hdfs]$ hdfs dfs -setrep -R -w 2  /path/of/files&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;A warning about "waiting time may be long for DECREASING the number of replications" appeared.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am still waiting after tens of minutes. And fsck still showing over-replication.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;[hdfs]$ hdfs fsck /path/of/files
16/11/02 12:04:42 WARN ssl.FileBasedKeyStoresFactory: The property 'ssl.client.truststore.location' has not been set, no TrustStore will be loaded
Connecting to namenode via http://namenode1:50070
FSCK started by hdfs (auth:SIMPLE) from /192.168.88.38 for path /path/of/files at Wed Nov 02 12:04:43 HKT 2016
....Status: HEALTHY
 Total size:	129643323 B
 Total dirs:	1
 Total files:	4
 Total symlinks:		0
 Total blocks (validated):	4 (avg. block size 32410830 B)
 Minimally replicated blocks:	4 (100.0 %)
 Over-replicated blocks:	4 (75.0 %)
 Under-replicated blocks:	0 (0.0 %)
 Mis-replicated blocks:		0 (0.0 %)
 Default replication factor:	3
 Average block replication:	3
 Corrupt blocks:		0
 Missing replicas:		0 (0.0 %)
 Number of data-nodes:		6
 Number of racks:		1
FSCK ended at Wed Nov 02 12:04:43 HKT 2016 in 1 milliseconds


The filesystem under path ' /path/of/files' is HEALTHY&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Is this normal? How long should the wait be?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2016 04:09:16 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Fixing-Over-replicated-Blocks/m-p/46868#M45057</guid>
      <dc:creator>athtsang</dc:creator>
      <dc:date>2016-11-02T04:09:16Z</dc:date>
    </item>
    <item>
      <title>Re: Fixing Over-replicated Blocks</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Fixing-Over-replicated-Blocks/m-p/46869#M45058</link>
      <description>&lt;P&gt;The setrep command just completed. However, the fsck still showing over-replication.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2016 04:20:58 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Fixing-Over-replicated-Blocks/m-p/46869#M45058</guid>
      <dc:creator>athtsang</dc:creator>
      <dc:date>2016-11-02T04:20:58Z</dc:date>
    </item>
    <item>
      <title>Re: Fixing Over-replicated Blocks</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Fixing-Over-replicated-Blocks/m-p/46872#M45059</link>
      <description>&lt;P&gt;Answering my question...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The source code of&amp;nbsp;&lt;FONT face="courier new,courier"&gt;org.apache.hadoop.hdfs.server.blockmanagement.BlockManager&lt;/FONT&gt;&amp;nbsp;says&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;...
    if (numCurrentReplica &amp;gt; expectedReplication) {
      if (num.replicasOnStaleNodes() &amp;gt; 0) {
        // If any of the replicas of this block are on nodes that are
        // considered "stale", then these replicas may in fact have
        // already been deleted. So, we cannot safely act on the
        // over-replication until a later point in time, when
        // the "stale" nodes have block reported.
        return MisReplicationResult.POSTPONE;
      }
...&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So the key point is whether the DataNodes are "stale". I don't know how to force the&amp;nbsp;nodes to have block reported besides restarting. So I restarted all DataNode and over-replicated blocks gone.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2016 06:03:20 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Fixing-Over-replicated-Blocks/m-p/46872#M45059</guid>
      <dc:creator>athtsang</dc:creator>
      <dc:date>2016-11-02T06:03:20Z</dc:date>
    </item>
  </channel>
</rss>

