{"record":{"id":"fcbfa4dffa5e4007","repo":"apache/hadoop","slug":"quota-for-storage-type-type-is-not-supported","errorCode":null,"errorMessage":"Quota for storage type '${type}' is not supported","messagePattern":"Quota for storage type '(.+?)' is not supported","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java","lineNumber":2083,"sourceCode":"    statistics.incrementWriteOps(1);\n    storageStatistics.incrementOpCounter(OpType.SET_QUOTA_USAGE);\n\n    final HttpOpParam.Op op = PutOpParam.Op.SETQUOTA;\n    new FsPathRunner(op, p, new NameSpaceQuotaParam(namespaceQuota),\n        new StorageSpaceQuotaParam(storagespaceQuota)).run();\n  }\n\n  @Override\n  public void setQuotaByStorageType(Path path, StorageType type, long quota)\n      throws IOException {\n    if (quota <= 0 && quota != HdfsConstants.QUOTA_RESET) {\n      throw new IllegalArgumentException(\"Invalid values for quota :\" + quota);\n    }\n    if (type == null) {\n      throw new IllegalArgumentException(\"Invalid storage type (null)\");\n    }\n    if (!type.supportTypeQuota()) {\n      throw new IllegalArgumentException(\n          \"Quota for storage type '\" + type.toString() + \"' is not supported\");\n    }\n\n    statistics.incrementWriteOps(1);\n    storageStatistics.incrementOpCounter(OpType.SET_QUOTA_BYTSTORAGEYPE);\n\n    final HttpOpParam.Op op = PutOpParam.Op.SETQUOTABYSTORAGETYPE;\n    new FsPathRunner(op, path, new StorageTypeParam(type.name()),\n        new StorageSpaceQuotaParam(quota)).run();\n  }\n\n  @Override\n  public MD5MD5CRC32FileChecksum getFileChecksum(final Path p\n  ) throws IOException {\n    statistics.incrementReadOps(1);\n    storageStatistics.incrementOpCounter(OpType.GET_FILE_CHECKSUM);\n\n    final HttpOpParam.Op op = GetOpParam.Op.GETFILECHECKSUM;","sourceCodeStart":2065,"sourceCodeEnd":2101,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java#L2065-L2101","documentation":"WebHdfsFileSystem.setQuotaByStorageType rejects storage types that cannot carry a type quota, checked via StorageType.supportTypeQuota(), which returns !isTransient. In the current enum only RAM_DISK is transient, so RAM_DISK is the type that triggers this IllegalArgumentException. Per-type quotas are meaningless for transient storage because RAM_DISK blocks are lazily persisted to DISK and evicted.","triggerScenarios":"Calling fs.setQuotaByStorageType(path, StorageType.RAM_DISK, quota) — RAM_DISK is transient (StorageType.java:37, supportTypeQuota() at :66-68) so the check fails; any future transient type added to the enum would also fail.","commonSituations":"Generic 'apply quota to every storage type' loops that iterate StorageType.values(); config-driven quota tooling that receives 'RAM_DISK' as a target; misunderstanding that memory storage is capped differently (via LAZY_PERSIST policy and memory limits, not type quotas).","solutions":["Skip transient types (RAM_DISK) when applying quotas programmatically: filter with type.supportTypeQuota()","Use DISK/SSD/ARCHIVE (non-transient types) for type quotas","To limit memory usage of LAZY_PERSIST writes, use the storage policy mechanism and datanode memory limits instead of quotas"],"exampleFix":"// before\nfor (StorageType t : StorageType.values()) {\n  fs.setQuotaByStorageType(path, t, quota); // throws on RAM_DISK\n}\n// after\nfor (StorageType t : StorageType.values()) {\n  if (t.supportTypeQuota()) {\n    fs.setQuotaByStorageType(path, t, quota);\n  }\n}","handlingStrategy":"type-guard","validationCode":"for (StorageType t : StorageType.values()) {\n  if (t.supportTypeQuota()) {   // false only for transient types (RAM_DISK)\n    fs.setQuotaByStorageType(path, t, quota);\n  }\n}","typeGuard":"static boolean supportsTypeQuota(StorageType t) {\n  return t != null && t.supportTypeQuota(); // excludes RAM_DISK (transient)\n}","tryCatchPattern":null,"preventionTips":["Filter storage types with supportTypeQuota() in any generic quota loop","Remember RAM_DISK capacity is managed via lazy-persist policy, not type quotas"],"tags":["webhdfs","quota","storage-type","ram-disk"],"backgroundTag":"unsupported-storage-type","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}