apache/hadoop · error · HadoopIllegalArgumentException

Snapshot " + from + " should be newer than " + to

Error message

Snapshot " + from + " should be newer than " + to

What it means

Error "Snapshot " + from + " should be newer than " + to" thrown in apache/hadoop.

Source

Thrown at hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/DistCpSync.java:137

    final String from = getSnapshotName(
        context.getFromSnapshot());
    final String to = getSnapshotName(
        context.getToSnapshot());

    try {
      final FileStatus fromSnapshotStat =
          snapshotDiffFs.getFileStatus(getSnapshotPath(snapshotDiffDir, from));

      final FileStatus toSnapshotStat =
          snapshotDiffFs.getFileStatus(getSnapshotPath(snapshotDiffDir, to));

      if (isRdiff()) {
        // If fromSnapshot isn't current dir then do a time check
        if (!from.equals("")
            && fromSnapshotStat.getModificationTime() < toSnapshotStat
            .getModificationTime()) {
          throw new HadoopIllegalArgumentException("Snapshot " + from
              + " should be newer than " + to);
        }
      } else {
        // If toSnapshot isn't current dir then do a time check
        if(!to.equals("")
            && fromSnapshotStat.getModificationTime() > toSnapshotStat
            .getModificationTime()) {
          throw new HadoopIllegalArgumentException("Snapshot " + to
              + " should be newer than " + from);
        }
      }
    } catch (FileNotFoundException nfe) {
      throw new InvalidInputException("Input snapshot is not found", nfe);
    }

    return true;
  }

View on GitHub (pinned to 2add963021)

Solutions

  1. Swap the snapshot arguments: the 'from' snapshot must be newer than 'to' for -rdiff.
  2. Verify snapshot creation times with hdfs lsSnapshottableDir / snapshot listings.

When it happens

Trigger: -rdiff is given snapshots in the wrong chronological order.

Common situations: See trigger scenarios.


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