{"record":{"id":"12fc214eec39b2fc","repo":"apache/druid","slug":"failed-to-write-partial-info-file-for-segment-s","errorCode":null,"errorMessage":"Failed to write partial info file for segment[%s]","messagePattern":"Failed to write partial info file for segment\\[(.+?)\\]","errorType":"exception","errorClass":"SegmentLoadingException","httpStatus":null,"severity":"error","filePath":"server/src/main/java/org/apache/druid/segment/loading/SegmentLocalCacheManager.java","lineNumber":1089,"sourceCode":"                wrapper.getFingerprint()\n            );\n          }\n          // Rule couldn't be applied, nothing partial materialized, so hand back the plain segment; the\n          // announcement layer will fall back to segment.getSize() for loadedBytes.\n          return dataSegment;\n        }\n\n        final ReservedPartial reserved = findOrReservePartial(dataSegment, rangeReader);\n        try {\n          final PartialSegmentMetadataCacheEntry metadata = reserved.metadata();\n          // findOrReservePartial only invokes reservePartial (which writes the info file) on the fresh-reserve\n          // branch. On the find-existing branch the info file on disk still carries the PRIOR rule's wrapped\n          // load spec, so a rule swap here would apply in memory only. Rewrite unconditionally before mount.\n          try {\n            rewriteInfoFile(dataSegment);\n          }\n          catch (IOException e) {\n            throw new SegmentLoadingException(\n                e,\n                \"Failed to write partial info file for segment[%s]\",\n                dataSegment.getId()\n            );\n          }\n          try {\n            metadata.mount(reserved.location());\n          }\n          catch (IOException e) {\n            throw new SegmentLoadingException(\n                e,\n                \"Failed to mount partial metadata for segment[%s]\",\n                dataSegment.getId()\n            );\n          }\n          final PartialSegmentFileMapperV10 mapper = metadata.getFileMapper();\n          if (mapper == null) {\n            throw DruidException.defensive(","sourceCodeStart":1071,"sourceCodeEnd":1107,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/server/src/main/java/org/apache/druid/segment/loading/SegmentLocalCacheManager.java#L1071-L1107","documentation":"When a segment is loaded for a partial-load rule, SegmentLocalCacheManager rewrites the on-disk info file so it carries the current rule's wrapped loadSpec before mounting. If that rewrite fails with an IOException, it is wrapped in this SegmentLoadingException.","triggerScenarios":"loadPartial path calls rewriteInfoFile(dataSegment) and the underlying file write throws (disk full, permissions, location offline, missing directory).","commonSituations":"Cache disk full or read-only filesystem; cache directory permissions changed; info-hierarchy directory deleted underneath a running historical; disk hardware failure.","solutions":["Check disk space and filesystem health on the segment cache location (druid.segmentCache.locations).","Fix permissions/ownership on the cache info directory so the historical can write info files.","Ensure the cache location directories exist and are writable at startup; remount if offline.","After fixing the disk, let the coordinator re-queue the segment load."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"final File infoDir = new File(location.getPath(), \"info_dir\");\nif (!infoDir.canWrite() || infoDir.getFreeSpace() < MIN_FREE_BYTES) {\n  throw new IllegalStateException(\"Cache location not writable or low on disk: \" + infoDir);\n}","typeGuard":null,"tryCatchPattern":"try {\n  cacheManager.loadPartial(segment, rule);\n} catch (SegmentLoadingException e) {\n  if (e.getCause() instanceof IOException ioe && ioe.getMessage() != null && ioe.getMessage().contains(\"info file\")) {\n    alertDiskProblem(e); // check disk space/permissions before retrying\n  } else {\n    throw e;\n  }\n}","preventionTips":["Monitor free space on all druid.segmentCache.locations.","Ensure cache directories are writable by the historical process user.","Don't externally clean the info-hierarchy while the node runs.","Set up disk-failure alerting; retry loads only after the disk issue is fixed."],"tags":["file-write","disk","segment-cache","io"],"backgroundTag":"file-write-failed","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"}