{"record":{"id":"f5239dfb31e6da16","repo":"apache/druid","slug":"exclusive-start-partitions-s-for-new-sequence-do","errorCode":null,"errorMessage":"Exclusive start partitions[%s] for new sequence don't match to the prior offset[%s]","messagePattern":"Exclusive start partitions\\[(.+?)\\] for new sequence don't match to the prior offset\\[(.+?)\\]","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskRunner.java","lineNumber":1349,"sourceCode":"        final PartitionIdType partition = entry.getKey();\n        final SequenceOffsetType startOffset = entry.getValue();\n\n        if (latestSequence != null) {\n          final SequenceOffsetType priorOffset = latestSequence.getEndOffsets().get(partition);\n\n          if (!startOffset.equals(priorOffset)) {\n            throw new ISE(\n                \"New sequence startOffset[%s] does not equal expected prior offset[%s]\",\n                startOffset,\n                priorOffset\n            );\n          }\n        }\n      }\n\n      if (!isEndOffsetExclusive() && latestSequence != null) {\n        if (!latestSequence.getEndOffsets().keySet().equals(sequenceMetadata.getExclusiveStartPartitions())) {\n          throw new ISE(\n              \"Exclusive start partitions[%s] for new sequence don't match to the prior offset[%s]\",\n              sequenceMetadata.getExclusiveStartPartitions(),\n              latestSequence\n          );\n        }\n      }\n\n      // Actually do the add.\n      sequences.add(sequenceMetadata);\n    }\n    finally {\n      sequencesLock.unlock();\n    }\n  }\n\n  private void removeSequence(final SequenceMetadata<PartitionIdType, SequenceOffsetType> sequenceMetadata)\n  {\n    sequencesLock.lock();","sourceCodeStart":1331,"sourceCodeEnd":1367,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskRunner.java#L1331-L1367","documentation":"During task resume, SeekableStreamIndexTaskRunner checks that the exclusive start partitions of the new SequenceMetadata equal the partition set of the latest prior sequence's endOffsets (when the end offsets are exclusive). If the partition sets differ, it throws this IllegalStateException, since resuming on a different partition set than the previous sequence would skip or duplicate partitions.","triggerScenarios":"Task restart/resume where sequenceMetadata.getExclusiveStartPartitions() no longer matches latestSequence.getEndOffsets().keySet() — e.g. the topic was re-partitioned (partitions added/removed) between the two sequences, or checkpoints were manually edited so the partition list changed.","commonSituations":"Kafka topic re-created or expanded (partitions added) while a task was stopped; Kinesis resharding (shards split/merged) between task runs; hand-edited checkpoint JSON with wrong partition IDs; resuming tasks backed up from a different topic.","solutions":["POST /druid/indexer/v1/supervisor/<id>/reset to rebuild checkpoints and sequence metadata consistent with the current partition layout.","Re-create/adjust the supervisor spec's partitions/topic to match the current stream partition set and restart.","If resharding is expected, upgrade tasks so they handle new partitions gracefully rather than resuming stale sequence metadata.","Audit the saved checkpoints (task storage) and correct the partition list to match the prior sequence's endOffsets keys."],"exampleFix":"// before: spec partitions stale after topic repartition\n\"ioConfig\": {\"topic\": \"events\", \"partitions\": [0, 1]}\n// after: reset supervisor then update spec to current partitions\ncurl -X POST 'http://overlord:8087/druid/indexer/v1/supervisor/events-supervisor/reset'\n\"ioConfig\": {\"topic\": \"events\", \"partitions\": [0, 1, 2]}","handlingStrategy":"validation","validationCode":"// confirm partition set unchanged since the last sequence\nif (!latestSeq.getEndOffsets().keySet().equals(newSeq.getExclusiveStartPartitions())) { resetSupervisor(); }","typeGuard":null,"tryCatchPattern":"try { resumeSupervisor(id); } catch (IllegalStateException e) { if (e.getMessage().contains(\"don't match to the prior offset\")) { resetSupervisor(id); } else { throw e; } }","preventionTips":["Plan for resharding: stop supervisor, reset, update partitions, restart","Verify topic/shard layout after any re-partition before resuming tasks","Do not restore task state from a different topic/cluster"],"tags":["druid","kafka","kinesis","resharding","checkpoints"],"backgroundTag":"invalid-state-transition","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}