{"record":{"id":"3e54a8460006270c","repo":"apache/druid","slug":"previous-sequencenumbers-s-are-no-longer-availabl","errorCode":null,"errorMessage":"Previous sequenceNumbers %s are no longer available - automatically resetting sequences","messagePattern":"Previous sequenceNumbers (.+?) are no longer available - automatically resetting sequences","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"warning","filePath":"indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java","lineNumber":4450,"sourceCode":"        newTaskGroups.put(\n            groupId,\n            new TaskGroup(\n                groupId,\n                simpleStartingOffsets,\n                simpleUnfilteredStartingOffsets,\n                endOffsets,\n                minimumMessageTime,\n                maximumMessageTime,\n                exclusiveStartSequenceNumberPartitions\n            )\n        );\n      }\n    }\n\n    // If any partitions need a reset, issue a single batch reset.\n    if (!partitionsToReset.isEmpty()) {\n      resetInternal(createDataSourceMetaDataForReset(ioConfig.getStream(), partitionsToReset));\n      throw new StreamException(\n          new ISE(\n              \"Previous sequenceNumbers %s are no longer available - automatically resetting sequences\",\n              partitionsToReset\n          )\n      );\n    }\n\n    for (Entry<Integer, TaskGroup> entry : newTaskGroups.entrySet()) {\n      log.info(\"Initializing taskGroup[%d] with startingOffsets[%s].\", entry.getKey(), entry.getValue().startingSequences);\n      activelyReadingTaskGroups.put(entry.getKey(), entry.getValue());\n    }\n\n    // iterate through all the current task groups and make sure each one has the desired number of replica tasks\n    boolean createdTask = false;\n    for (Entry<Integer, TaskGroup> entry : activelyReadingTaskGroups.entrySet()) {\n      TaskGroup taskGroup = entry.getValue();\n      Integer groupId = entry.getKey();\n","sourceCodeStart":4432,"sourceCodeEnd":4468,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java#L4432-L4468","documentation":"During offset (sequence number) validation the supervisor found partitions whose stored sequence numbers no longer exist in the stream. When resetOffsetAutomatically is enabled it issues a batch reset and throws a StreamException wrapping an ISE to abort the current iteration — the reset will restart readers at valid offsets.","triggerScenarios":"checkSequenceAvailability detects unavailable offsets for some partitions while taskTuningConfig.isResetOffsetAutomatically() is true; the supervisor then resets those partitions and throws to signal the automatic reset happened.","commonSituations":"Kinesis shard expiry/merge deleting offsets the supervisor still has saved; stream retention shorter than ingestion downtime so old Kafka offsets were purged; re-created stream with different offsets.","solutions":["No action strictly needed — the supervisor already reset sequences; verify ingestion resumes and data loss from the reset window is acceptable.","If automatic data skipping is undesirable, set resetOffsetAutomatically: false in the tuning config and use the manual reset API instead.","Increase stream retention (Kafka retention.ms / Kinesis retention period) to survive downtime.","If resets happen repeatedly, investigate why offsets keep disappearing (shard expiry, stream recreation)."],"exampleFix":"// before: tuningConfig without automatic reset (manual intervention required)\n\"tuningConfig\": { \"type\": \"kafka\", \"resetOffsetAutomatically\": false }\n// after: allow automatic reset when offsets vanish\n\"tuningConfig\": { \"type\": \"kafka\", \"resetOffsetAutomatically\": true }","handlingStrategy":"retry","validationCode":"// check saved offsets against stream retention before resuming\nboolean offsetsValid = partitionsToReset.isEmpty();","typeGuard":null,"tryCatchPattern":"try { supervisor.runLoop(); } catch (StreamException e) { if (e.getMessage().contains(\"automatically resetting sequences\")) { awaitNextIteration(); } }","preventionTips":["Set stream retention well beyond max expected downtime","Enable resetOffsetAutomatically if data loss in gap is acceptable","Monitor reset logs for repeated occurrence"],"tags":["druid","supervisor","offsets","auto-reset"],"backgroundTag":"offset-out-of-range","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"}