apache/druid · error · IllegalStateException

Base sequence names do not match for the tasks in the task…

Error message

Base sequence names do not match for the tasks in the task group with ID [%s]

What it means

Within a task group all replica tasks must share the same base sequence name so they read the same segments and can be swapped in atomically. The supervisor collects getBaseSequenceName() from every task in the group and throws IllegalStateException if they disagree, since inconsistent replicas would publish divergent data.

Solutions

  1. Restart the supervisor so it rebuilds task groups with consistent tasks.
  2. Check task logs to identify the odd task and kill it (POST /druid/indexer/v1/supervisor/<id>/terminate or task shutdown endpoint) letting the supervisor create a fresh replica.
  3. If groups are persistently inconsistent, reset the supervisor and resume from saved offsets.
  4. Upgrade Druid if this recurs during rolling restarts; several sequence-name race fixes landed over time.

Example fix

// before: manually resubmitting only one replica task, leaving mixed sequences
// after: suspend, then resume the supervisor so all replicas are recreated together
curl -X POST .../druid/indexer/v1/supervisor/<id>/suspend
curl -X POST .../druid/indexer/v1/supervisor/<id>/resume
Defensive patterns

Strategy: try-catch

Try / catch

try { supervisorLifecycleOp(); } catch (ISE e) { if (e.getMessage().contains("Base sequence names do not match")) { suspendAndResumeSupervisor(); } }

Prevention

When it happens

Trigger: During task-group validation (e.g. before changing offsets or killing/restarting a group) when tasks in one group were created at different times or by different supervisor generations and thus got different base sequence names.

Common situations: Supervisor restarted mid-rolling-update leaving mixed-generation tasks in a group; manual task manipulation or task failure and recreation racing a supervisor lifecycle change; bugs in custom task provisioning.

Understand the failure class

Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.

Related errors


AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07). Data as JSON: /api/errors/d6aa82bb5b0495f3. Report an issue: GitHub.

Appendix: source

Thrown at indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:3063

    String taskGroupSequenceName = activelyReadingTaskGroups.get(groupId).baseSequenceName;
    boolean allSequenceNamesMatch =
        activelyReadingTaskGroups.get(groupId)
            .tasks
            .keySet()
            .stream()
            .map(x -> {
              Optional<Task> taskOptional = taskStorage.getTask(x);
              if (!taskOptional.isPresent() || !doesTaskMatchSupervisor(taskOptional.get())) {
                return false;
              }
              @SuppressWarnings("unchecked")
              SeekableStreamIndexTask<PartitionIdType, SequenceOffsetType, RecordType> task =
                  (SeekableStreamIndexTask<PartitionIdType, SequenceOffsetType, RecordType>) taskOptional.get();
              return task.getIOConfig().getBaseSequenceName();
            })
            .allMatch(taskSeqName -> taskSeqName.equals(taskGroupSequenceName));
    if (!allSequenceNamesMatch) {
      throw new ISE(
          "Base sequence names do not match for the tasks in the task group with ID [%s]",
          groupId
      );
    }
  }

  private ListenableFuture<Void> stopTask(final String id, final boolean publish)
  {
    return Futures.transform(
        taskClient.stopAsync(id, publish), new Function<>()
        {
          @Nullable
          @Override
          public Void apply(@Nullable Boolean result)
          {
            if (result == null || !result) {
              log.info("Killing task[%s] as it failed to stop in a timely manner.", id);
              killTask(id, "Failed to stop in a timely manner");

View on GitHub (pinned to 9b90983fd2)