apache/hadoop · error · IOException

{} = storedGS < b.getGenerationStamp(), b={}

Error message

{} = storedGS < b.getGenerationStamp(), b={}

What it means

Error "{} = storedGS < b.getGenerationStamp(), b={}" thrown in apache/hadoop.

Source

Thrown at hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java:3643

  void transferReplicaForPipelineRecovery(final ExtendedBlock b,
      final DatanodeInfo[] targets, final StorageType[] targetStorageTypes,
      final String[] targetStorageIds, final String client)
      throws IOException {
    final long storedGS;
    final long visible;
    final BlockConstructionStage stage;

    //get replica information
    try (AutoCloseableLock lock = dataSetLockManager.readLock(
        LockLevel.BLOCK_POOl, b.getBlockPoolId())) {
      Block storedBlock = data.getStoredBlock(b.getBlockPoolId(),
          b.getBlockId());
      if (null == storedBlock) {
        throw new IOException(b + " not found in datanode.");
      }
      storedGS = storedBlock.getGenerationStamp();
      if (storedGS < b.getGenerationStamp()) {
        throw new IOException(storedGS
            + " = storedGS < b.getGenerationStamp(), b=" + b);
      }
      // Update the genstamp with storedGS
      b.setGenerationStamp(storedGS);
      if (data.isValidRbw(b)) {
        stage = BlockConstructionStage.TRANSFER_RBW;
        LOG.debug("Replica is being written!");
      } else if (data.isValidBlock(b)) {
        stage = BlockConstructionStage.TRANSFER_FINALIZED;
        LOG.debug("Replica is finalized!");
      } else {
        final String r = data.getReplicaString(b.getBlockPoolId(), b.getBlockId());
        throw new IOException(b + " is neither a RBW nor a Finalized, r=" + r);
      }
      visible = data.getReplicaVisibleLength(b);
    }
    //set visible length
    b.setNumBytes(visible);

View on GitHub (pinned to 2add963021)

Solutions

  1. Check for stale replicas: the stored generation stamp is older than the block's generation stamp from the NameNode; let the DataNode process pending block reports/invalidations.
  2. If persistent, restart the DataNode and verify clocks are synchronized (NTP) across the cluster.

When it happens

Trigger: During append/recovery, the replica's stored generation stamp is lower than the generation stamp of the block supplied by the NameNode.

Common situations: The stored replica generation stamp is older than the block's, indicating a stale replica. Let block recovery update the replica; check for missed commits.


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