{"record":{"id":"0af85ec6216c6104","repo":"apache/hadoop","slug":"exceeded-the-configured-number-of-objects-in-th","errorCode":null,"errorMessage":"Exceeded the configured number of objects {} in the filesystem.","messagePattern":"Exceeded the configured number of objects (.+?) in the filesystem\\.","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java","lineNumber":5507,"sourceCode":"    if (isPermissionEnabled) {\n      FSPermissionChecker pc = getPermissionChecker();\n      pc.checkSuperuserPrivilege(null);\n    }\n  }\n\n  void checkSuperuserPrivilege(String operationName)\n      throws IOException {\n    checkSuperuserPrivilege(operationName, null);\n  }\n\n  /**\n   * Check to see if we have exceeded the limit on the number\n   * of inodes.\n   */\n  void checkFsObjectLimit() throws IOException {\n    if (maxFsObjects != 0 &&\n        maxFsObjects <= dir.totalInodes() + getBlocksTotal()) {\n      throw new IOException(\"Exceeded the configured number of objects \" +\n                             maxFsObjects + \" in the filesystem.\");\n    }\n  }\n\n  @Override // FSNamesystemMBean\n  public long getMaxObjects() {\n    return maxFsObjects;\n  }\n\n  @Override // FSNamesystemMBean\n  @Metric\n  public long getFilesTotal() {\n    // There is no need to take fSNamesystem's lock as\n    // FSDirectory has its own lock.\n    return this.dir.totalInodes();\n  }\n\n  /**","sourceCodeStart":5489,"sourceCodeEnd":5525,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java#L5489-L5525","documentation":"checkFsObjectLimit throws when total inodes plus blocks has reached dfs.namenode.max.objects (maxFsObjects; 0 means unlimited). This caps namespace growth, so file creation, mkdir, and new block allocation fail once the ceiling is hit.","triggerScenarios":"Any create/mkdir/addBlock once dir.totalInodes() + getBlocksTotal() >= maxFsObjects, typically with a small configured cap or a many-small-files workload.","commonSituations":"A low dfs.namenode.max.objects set for testing left in production; millions of small files; small block size inflating block count faster than inode count.","solutions":["Raise dfs.namenode.max.objects (or set 0 to disable) in hdfs-site.xml and restart the NameNode","Reduce object count: compact small files (HAR, sequence files, ORC), delete stale data","Increase dfs.blocksize so fewer blocks represent the same bytes","Monitor filesTotal/blocksTotal JMX metrics against the configured cap"],"exampleFix":"<!-- before -->\n<property><name>dfs.namenode.max.objects</name><value>1000000</value></property>\n\n<!-- after -->\n<property><name>dfs.namenode.max.objects</name><value>0</value></property> <!-- unlimited, or a larger ceiling -->","handlingStrategy":"validation","validationCode":"// via JMX or ClientProtocol.getMBean-backed metrics before mass creates\nlong maxObjects = dfsAdmin.getMetrics().getLong(\"MaxObjects\");\nlong used = filesTotal + blocksTotal;\nif (maxObjects > 0 && used >= maxObjects * 0.9) {\n  alertOrThrottle(\"Approaching dfs.namenode.max.objects\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  fs.create(path);\n} catch (IOException e) {\n  if (e.getMessage().contains(\"Exceeded the configured number of objects\")) {\n    // quota ceiling: stop creating, compact files, or raise max.objects\n  }\n}","preventionTips":["Set dfs.namenode.max.objects to 0 or a realistic ceiling for production","Compact small files (HAR/ORC/sequence files) instead of accumulating millions","Watch filesTotal and blocksTotal trends against the cap"],"tags":["hdfs","namenode","quota","small-files","capacity"],"backgroundTag":"resource-quota-exceeded","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}