{"record":{"id":"bcbb3d3738862071","repo":"apache/hadoop","slug":"storedgs-b-getgenerationstamp-b","errorCode":null,"errorMessage":"{} = storedGS < b.getGenerationStamp(), b={}","messagePattern":"(.+?) = storedGS < b\\.getGenerationStamp\\(\\), b=(.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java","lineNumber":3643,"sourceCode":"  void transferReplicaForPipelineRecovery(final ExtendedBlock b,\n      final DatanodeInfo[] targets, final StorageType[] targetStorageTypes,\n      final String[] targetStorageIds, final String client)\n      throws IOException {\n    final long storedGS;\n    final long visible;\n    final BlockConstructionStage stage;\n\n    //get replica information\n    try (AutoCloseableLock lock = dataSetLockManager.readLock(\n        LockLevel.BLOCK_POOl, b.getBlockPoolId())) {\n      Block storedBlock = data.getStoredBlock(b.getBlockPoolId(),\n          b.getBlockId());\n      if (null == storedBlock) {\n        throw new IOException(b + \" not found in datanode.\");\n      }\n      storedGS = storedBlock.getGenerationStamp();\n      if (storedGS < b.getGenerationStamp()) {\n        throw new IOException(storedGS\n            + \" = storedGS < b.getGenerationStamp(), b=\" + b);\n      }\n      // Update the genstamp with storedGS\n      b.setGenerationStamp(storedGS);\n      if (data.isValidRbw(b)) {\n        stage = BlockConstructionStage.TRANSFER_RBW;\n        LOG.debug(\"Replica is being written!\");\n      } else if (data.isValidBlock(b)) {\n        stage = BlockConstructionStage.TRANSFER_FINALIZED;\n        LOG.debug(\"Replica is finalized!\");\n      } else {\n        final String r = data.getReplicaString(b.getBlockPoolId(), b.getBlockId());\n        throw new IOException(b + \" is neither a RBW nor a Finalized, r=\" + r);\n      }\n      visible = data.getReplicaVisibleLength(b);\n    }\n    //set visible length\n    b.setNumBytes(visible);","sourceCodeStart":3625,"sourceCodeEnd":3661,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java#L3625-L3661","documentation":"Error \"{} = storedGS < b.getGenerationStamp(), b={}\" thrown in apache/hadoop.","triggerScenarios":"During append/recovery, the replica's stored generation stamp is lower than the generation stamp of the block supplied by the NameNode.","commonSituations":"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.","solutions":["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.","If persistent, restart the DataNode and verify clocks are synchronized (NTP) across the cluster."],"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-22T20:17:22.307Z"}