{"record":{"id":"4537f5331c1e4feb","repo":"apache/druid","slug":"segment-path-s-does-not-exist","errorCode":null,"errorMessage":"Segment path [%s] does not exist","messagePattern":"Segment path \\[(.+?)\\] does not exist","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"extensions-core/hdfs-storage/src/main/java/org/apache/druid/storage/hdfs/HdfsDataSegmentKiller.java","lineNumber":82,"sourceCode":"  {\n    return new Path(String.valueOf(segment.getLoadSpec().get(PATH_KEY)));\n  }\n\n  @Override\n  public void kill(DataSegment segment) throws SegmentLoadingException\n  {\n    final Path segmentPath = getPath(segment);\n    log.info(\"Killing segment[%s] mapped to path[%s]\", segment.getId(), segmentPath);\n\n    try (final FileSystem fs = segmentPath.getFileSystem(config)) {\n      final String filename = segmentPath.getName();\n      final CompressionUtils.Format compressionFormat = CompressionUtils.Format.fromFileName(filename);\n      if (compressionFormat != CompressionUtils.Format.ZIP && compressionFormat != CompressionUtils.Format.LZ4) {\n        throw new SegmentLoadingException(\"Unknown file type[%s]\", segmentPath);\n      } else {\n\n        if (!fs.exists(segmentPath)) {\n          log.warn(\"Segment path [%s] does not exist\", segmentPath);\n          return;\n        }\n\n        // There are 3 supported path formats for each segment compression format:\n        //    - hdfs://nn1/hdfs_base_directory/data_source_name/interval/version/shardNum/index.zip\n        //    - hdfs://nn1/hdfs_base_directory/data_source_name/interval/version/shardNum_index.zip\n        //    - hdfs://nn1/hdfs_base_directory/data_source_name/interval/version/shardNum_UUID_index.zip\n        // The same formats with an index.lz4 suffix are also supported.\n        final String[] segmentParts = filename.split(\"_\");\n\n        Path descriptorPath = new Path(segmentPath.getParent(), \"descriptor.json\");\n        if (segmentParts.length > 1) {\n          Preconditions.checkState(segmentParts.length <= 3 &&\n                                   StringUtils.isNumeric(segmentParts[0]) &&\n                                   (\"index\" + compressionFormat.getSuffix()).equals(\n                                       segmentParts[segmentParts.length - 1]\n                                   ),\n                                   \"Unexpected segmentPath format [%s]\", segmentPath","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/extensions-core/hdfs-storage/src/main/java/org/apache/druid/storage/hdfs/HdfsDataSegmentKiller.java#L64-L100","documentation":"HdfsDataSegmentKiller.kill() removes segment files from HDFS deep storage. Before deleting, it checks whether the segment path exists; if not, it logs this warning and returns silently instead of throwing. It is informational: the segment is considered already killed.","triggerScenarios":"Calling kill(DataSegment) for a segment whose index.zip / descriptor files were already deleted (or never pushed) at the computed HDFS path.","commonSituations":"Retrying a failed kill, running the Druid kill task twice, manually cleaning HDFS before the kill task runs, or segment paths changed after a deep-storage migration.","solutions":["No action required if the segment was intentionally deleted; treat as success","If the segment should exist, verify the path with `hdfs dfs -ls` against druid.storage.storageDirectory and the segment's dataSource/interval/version/partition","Check druid.storage.* config for base-directory changes that would make computed paths wrong"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// caller-side check before kill\nPath p = new Path(storageDir, segmentRelativePath);\nif (!fs.exists(p)) { /* already gone; skip kill */ }","typeGuard":null,"tryCatchPattern":"try {\n  killer.kill(segment);\n} catch (SegmentLoadingException e) {\n  if (!fs.exists(path)) { /* benign: already deleted */ } else { throw e; }\n}","preventionTips":["Make kill tasks idempotent — they already are on HDFS","Don't delete deep-storage files manually outside Druid","Keep druid.storage.* config stable across the cluster"],"tags":["hdfs","segment-kill","deep-storage","druid"],"backgroundTag":"file-not-found","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}