{"record":{"id":"d4b7593c45943e4c","repo":"apache/hadoop","slug":"need-d-bytes-but-only-d-bytes-available","errorCode":null,"errorMessage":"Need %d bytes, but only %d bytes available","messagePattern":"Need (.+?) bytes, but only (.+?) bytes available","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/LocalReplicaInPipeline.java","lineNumber":212,"sourceCode":"  @Override\n  public ChunkChecksum getLastChecksumAndDataLen() {\n    lock.lock();\n    try {\n      return new ChunkChecksum(getBytesOnDisk(), lastChecksum);\n    } finally {\n      lock.unlock();\n    }\n  }\n\n  @Override\n  public void waitForMinLength(long minLength, long time, TimeUnit unit)\n      throws IOException {\n    long nanos = unit.toNanos(time);\n    lock.lock();\n    try {\n      while (bytesOnDisk < minLength) {\n        if (nanos <= 0L) {\n          throw new IOException(\n              String.format(\"Need %d bytes, but only %d bytes available\",\n                  minLength, bytesOnDisk));\n        }\n        nanos = bytesOnDiskChange.awaitNanos(nanos);\n      }\n    } catch (InterruptedException e) {\n      throw new IOException(e);\n    } finally {\n      lock.unlock();\n    }\n  }\n\n  @Override // ReplicaInPipeline\n  public void setWriter(Thread writer) {\n    this.writer.set(writer);\n  }\n\n  @Override","sourceCodeStart":194,"sourceCodeEnd":230,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/LocalReplicaInPipeline.java#L194-L230","documentation":"Error \"Need %d bytes, but only %d bytes available\" thrown in apache/hadoop.","triggerScenarios":"Writing/appending to a replica-in-pipeline needs more bytes than remain available on the volume after accounting for reserved space.","commonSituations":"The volume lacks the free space needed for the replica. Add capacity, rebalance, or lower replication to free space.","solutions":["Free space on the volume or add capacity; the required bytes exceed the available space for the RBW replica.","Adjust dfs.datanode.du.reserved if reserved space is consuming capacity needed for writes."],"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"}