{"record":{"id":"0f3a1601c3481866","repo":"apache/hadoop","slug":"filtering-by-replication-is-unsupported","errorCode":null,"errorMessage":"Filtering by replication is unsupported.","messagePattern":"Filtering by replication is unsupported\\.","errorType":"exception","errorClass":"InvalidRequestException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/CacheManager.java","lineNumber":751,"sourceCode":"    } catch (IOException e) {\n      LOG.warn(\"removeDirective of \" + id + \" failed: \", e);\n      throw e;\n    }\n    LOG.info(\"removeDirective of \" + id + \" successful.\");\n  }\n\n  public BatchedListEntries<CacheDirectiveEntry> \n        listCacheDirectives(long prevId,\n            CacheDirectiveInfo filter,\n            FSPermissionChecker pc) throws IOException {\n    assert namesystem.hasReadLock(RwLockMode.FS);\n    final int NUM_PRE_ALLOCATED_ENTRIES = 16;\n    String filterPath = null;\n    if (filter.getPath() != null) {\n      filterPath = validatePath(filter);\n    }\n    if (filter.getReplication() != null) {\n      throw new InvalidRequestException(\n          \"Filtering by replication is unsupported.\");\n    }\n\n    // Querying for a single ID\n    final Long id = filter.getId();\n    if (id != null) {\n      if (!directivesById.containsKey(id)) {\n        throw new InvalidRequestException(\"Did not find requested id \" + id);\n      }\n      // Since we use a tailMap on directivesById, setting prev to id-1 gets\n      // us the directive with the id (if present)\n      prevId = id - 1;\n    }\n\n    ArrayList<CacheDirectiveEntry> replies =\n        new ArrayList<CacheDirectiveEntry>(NUM_PRE_ALLOCATED_ENTRIES);\n    int numReplies = 0;\n    SortedMap<Long, CacheDirective> tailMap =","sourceCodeStart":733,"sourceCodeEnd":769,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/CacheManager.java#L733-L769","documentation":"Error \"Filtering by replication is unsupported.\" thrown in apache/hadoop.","triggerScenarios":"listCacheDirectives with a replication filter, which is not supported.","commonSituations":"See trigger scenarios.","solutions":["Remove the replication filter from the listDirectives query; filtering by replication is not supported."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}