{"record":{"id":"c17c762c6a3f677f","repo":"apache/druid","slug":"no-such-previous-checkpoint-s-found","errorCode":null,"errorMessage":"No such previous checkpoint [%s] found","messagePattern":"No such previous checkpoint \\[(.+?)\\] found","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java","lineNumber":955,"sourceCode":"\n      if (isValidTaskGroup(taskGroupId, taskGroup)) {\n        final TreeMap<Integer, Map<PartitionIdType, SequenceOffsetType>> checkpoints = taskGroup.checkpointSequences;\n\n        // check validity of previousCheckpoint\n        int index = checkpoints.size();\n        for (int sequenceId : checkpoints.descendingKeySet()) {\n          Map<PartitionIdType, SequenceOffsetType> checkpoint = checkpoints.get(sequenceId);\n          // We have already verified the stream of the current checkpoint is same with that in ioConfig.\n          // See checkpoint().\n          if (checkpoint.equals(checkpointMetadata.getSeekableStreamSequenceNumbers()\n                                                  .getPartitionSequenceNumberMap()\n          )) {\n            break;\n          }\n          index--;\n        }\n        if (index == 0) {\n          throw new ISE(\"No such previous checkpoint [%s] found\", checkpointMetadata);\n        } else if (index < checkpoints.size()) {\n          // if the found checkpoint is not the latest one then already checkpointed by a replica\n          Preconditions.checkState(index == checkpoints.size() - 1, \"checkpoint consistency failure\");\n          log.info(\"Already checkpointed with sequences [%s]\", checkpoints.lastEntry().getValue());\n          return;\n        }\n        final Map<PartitionIdType, SequenceOffsetType> newCheckpoint = checkpointTaskGroup(taskGroup, false).get();\n        if (MapUtils.isNotEmpty(newCheckpoint)) {\n          taskGroup.addNewCheckpoint(newCheckpoint);\n          log.info(\"Handled checkpoint notice, new checkpoint is [%s] for taskGroup [%s]\", newCheckpoint, taskGroupId);\n        } else {\n          log.warn(\"New checkpoint is null for taskGroup [%s]\", taskGroupId);\n        }\n      }\n    }\n\n    boolean isValidTaskGroup(int taskGroupId, @Nullable TaskGroup taskGroup)\n    {","sourceCodeStart":937,"sourceCodeEnd":973,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java#L937-L973","documentation":"When a checkpoint request arrives, the supervisor walks the task group's stored checkpoint history (a map keyed by descending index) to find an entry matching the requested checkpoint metadata. If it walks all the way to index 0 without a match, the requested checkpoint does not correspond to any previously recorded checkpoint, and an ISE is thrown.","triggerScenarios":"Calling the supervisor's checkpoint REST endpoint (createCheckpointFromTaskStopMetadataCheckpoints / checkpoint handling) with a CheckpointDataSourceMetadata whose sequence number/offsets do not match any entry in the task group's sortedCheckpoints history, or when the checkpoint history is empty.","commonSituations":"Checkpointing a task whose replicas already diverged; sending checkpoints for an old sequence after the supervisor has pruned history; double-checkpointing or restarting supervisor which lost in-memory checkpoint state; wrong sequence number in the checkpoint request body.","solutions":["Verify the checkpoint request's sequence number and offsets match a currently active sequence in the task group","Re-issue the checkpoint only for sequences the task has actually reported (check task reports / logs)","If supervisor state was lost, restart tasks so checkpoints are rebuilt from the beginning of the sequence"],"exampleFix":"null","handlingStrategy":"try-catch","validationCode":"// Before requesting a checkpoint, confirm the sequence is active in the group:\nboolean isActive = supervisor.checkpointIsActive(taskGroupId, checkpointMetadata.getSequenceNumber());\nif (!isActive) { /* don't POST the checkpoint */ }","typeGuard":null,"tryCatchPattern":"try {\n  supervisor.checkpoint(taskGroupId, checkpointMetadata);\n} catch (IllegalStateException e) {\n  if (e.getMessage().startsWith(\"No such previous checkpoint\")) {\n    log.warn(\"Checkpoint for stale/unknown sequence ignored: %s\", checkpointMetadata);\n  } else throw e;\n}","preventionTips":["Only checkpoint sequences currently reported by the task","Avoid re-sending old checkpoint requests after supervisor restarts","Check task reports for the current sequence before building checkpoint payloads"],"tags":["checkpoint","kafka","kinesis","supervisor"],"backgroundTag":"record-not-found","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}