apache/hadoop · error · IOException

Rec# {recNo}: Failed to skip past value of length: {currentV

Error message

Rec# {recNo}: Failed to skip past value of length: {currentValueLength}

What it means

InMemoryReader.nextRawValue() exposes the value bytes then skips currentValueLength bytes to advance to the next record. A skip returning fewer bytes means the in-memory segment holds less data than the record header declared, i.e. corrupted in-memory map output. dumpOnError() dumps the segment before rethrowing.

Source

Thrown at hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/task/reduce/InMemoryReader.java:124

      // Record the byte
      bytesRead += currentKeyLength;
      return true;
    } catch (IOException ioe) {
      dumpOnError();
      throw ioe;
    }
  }
  
  public void nextRawValue(DataInputBuffer value) throws IOException {
    try {
      int pos = memDataIn.getPosition();
      byte[] data = memDataIn.getData();
      value.reset(data, pos, currentValueLength);

      // Position for the next record
      long skipped = memDataIn.skip(currentValueLength);
      if (skipped != currentValueLength) {
        throw new IOException("Rec# " + recNo + 
            ": Failed to skip past value of length: " + 
            currentValueLength);
      }
      // Record the byte
      bytesRead += currentValueLength;

      ++recNo;
    } catch (IOException ioe) {
      dumpOnError();
      throw ioe;
    }
  }
    
  public void close() {
    // Release
    dataIn = null;
    buffer = null;
      // Inform the MergeManager

View on GitHub (pinned to 2add963021)

Solutions

  1. Inspect the dumpOnError() segment dump logged with the failure.
  2. Check the NodeManager that served the failing map output (disk, logs, recent restarts).
  3. Retry so the map is re-fetched or re-run; restart the serving NM if it stays broken.
  4. Open a MapReduce JIRA with the dump and stack trace if reproducible.
Defensive patterns

Strategy: try-catch

Try / catch

catch (java.io.IOException e) { if (String.valueOf(e.getMessage()).contains("Failed to skip past value")) { /* corrupt in-memory segment: diagnostics dumped; retry the job */ } else { throw e; } }

Prevention

When it happens

Trigger: Same class as the key-skip failure: corrupt in-memory segment from a bad fetch, wrong reader buffer boundaries, or IFile serialization mismatch, detected one field later while positioning for the next record.

Common situations: Shuffle data corruption on a specific map output surfacing during merge; framework-internal path used by MergeManagerImpl, not direct user API.

Related errors


AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22). Data as JSON: /api/errors/20bbf86842195bf8. Report an issue: GitHub.