apache/druid · error · UnsupportedOperationException

This supervisor type does not support partition expiration.

Error message

This supervisor type does not support partition expiration.

What it means

recomputePartitionGroupsForExpiration is an optional extension point used only by systems whose partitions can expire (Kinesis). The base SeekableStreamSupervisor implementation (and supervisors like Kafka whose partitions never expire) throws UnsupportedOperationException, meaning partition expiration is not supported for this supervisor type.

Source

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

  /**
   * When partitions are removed due to expiration it may be necessary to recompute the partitionID -> groupID
   * mappings to ensure balanced distribution of partitions.
   * <p>
   * This function should return a copy of partitionGroups, using the provided availablePartitions as the list of
   * active partitions, reassigning partitions to different groups if necessary.
   * <p>
   * If a partition is not in availablePartitions, it should be filtered out of the new partition groups returned
   * by this method.
   *
   * @param availablePartitions
   * @return a remapped copy of partitionGroups, containing only the partitions in availablePartitions
   */
  protected Map<Integer, Set<PartitionIdType>> recomputePartitionGroupsForExpiration(
      Set<PartitionIdType> availablePartitions
  )
  {
    throw new UnsupportedOperationException("This supervisor type does not support partition expiration.");
  }

  /**
   * Some seekable stream systems such as Kinesis allow partitions to expire. When this occurs, the supervisor should
   * mark the expired partitions in the saved metadata. This method returns a copy of the current metadata
   * with any expired partitions marked with an implementation-specific offset value that represents the expired state.
   *
   * @param currentMetadata     The current DataSourceMetadata from metadata storage
   * @param expiredPartitionIds The set of expired partition IDs.
   * @return currentMetadata but with any expired partitions removed.
   */
  protected SeekableStreamDataSourceMetadata<PartitionIdType, SequenceOffsetType> createDataSourceMetadataWithExpiredPartitions(
      SeekableStreamDataSourceMetadata<PartitionIdType, SequenceOffsetType> currentMetadata,
      Set<PartitionIdType> expiredPartitionIds
  )
  {
    throw new UnsupportedOperationException("This supervisor type does not support partition expiration.");
  }

View on GitHub (pinned to 9b90983fd2)

Solutions

  1. Do not enable or rely on partition expiration with Kafka (or other non-expiring) supervisors; partitions there are never considered expired.
  2. If you implement a custom supervisor over an expiring stream, override recomputePartitionGroupsForExpiration and createDataSourceMetadataWithExpiredPartitions.
  3. Confirm you are running the intended supervisor type; a misconfigured spec (Kinesis type under a Kafka-style config) can route to the wrong implementation.
Defensive patterns

Strategy: type-guard

Validate before calling

// Only Kinesis-style supervisors support expiration
boolean supportsExpiration = supervisor instanceof KinesisSupervisor;

Type guard

if (!(supervisor instanceof ExpirationCapable)) return; // skip expiration path

Try / catch

try { recomputeForExpiration(); } catch (UnsupportedOperationException e) { log.info("Partition expiration not supported; skipping"); }

Prevention

When it happens

Trigger: Any code path invoking partition-expiration handling (expired-partition detection during partition discovery) on a supervisor that did not override recomputePartitionGroupsForExpiration, e.g. a Kafka supervisor.

Common situations: Custom seekable-stream supervisor implementations calling the shared expiration machinery; users expecting Kafka partitions to 'expire' like Kinesis shards; internal misuse of the protected hook.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


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