Support Questions
Find answers, ask questions, and share your expertise

clrQuota: Cannot clear namespace quota on root Ask Question

Explorer

hdfs dfsadmin -setQuota 3 / i set the quota for root directory in hadoop but i can't able to clear the quota for the root directory using hdfs dfsadmin -clrQuota / it givesclrQuota: Cannot clear namespace quota on root.

7 REPLIES 7

@Kuldeep Kulkarni Please Help, I am facing the same issue

Super Guru
@Abhinav Phutela

Can you please give me command with complete console output?

@Kuldeep Kulkarni

I'm attaching the console output with the commands I ran. Hope to get a solution from your end :

70421-quota.png

The error says :

clrQuota: Cannot clear namespace quota on root.

Super Guru

@Abhinav Phutela

I checked further and it looks like because it has caused FSImage corruption, community has disabled it intentionally.

Please check below code change as a part of patch on https://issues.apache.org/jira/browse/HDFS-1258

diff --git src/java/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java src/java/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
index 24510a4..2c632dd 100644
--- src/java/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
+++ src/java/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
@@ -1684,6 +1684,8 @@ class FSDirectory implements Closeable {
         throw new FileNotFoundException("Directory does not exist: " + srcs);
       } else if (!targetNode.isDirectory()) {
         throw new FileNotFoundException("Cannot set quota on a file: " + srcs);  
+      } else if (targetNode.isRoot() && nsQuota == FSConstants.QUOTA_RESET) {
+        throw new IllegalArgumentException("Cannot clear namespace quota on root.");
       } else { // a directory inode
         INodeDirectory dirNode = (INodeDirectory)targetNode;
         long oldNsQuota = dirNode.getNsQuota();

This one is still open https://issues.apache.org/jira/browse/HDFS-7133 to support clearing quota for /

Hope this helps.

Super Guru

@Abhinav Phutela

It's intentionally kept like that until we have a fix for HDFS-7133. We cannot do anything for now.

Sure Sir. Thanks

@Kuldeep Kulkarni

The issue is that I'm in administration so can you tell me who exactly can I apply this patch? or where exactly can I find this .java file which I need to edit?