apache/iceberg · error · IllegalArgumentException

Invalid operator event type:

Error message

Invalid operator event type: 

What it means

TriggerManagerOperator.handleOperatorEvent only accepts LockReleaseEvent; any other OperatorEvent delivered to the maintenance task operator cannot be processed and is rejected with this IllegalArgumentException. It is the operator-side counterpart of the coordinator's event validation.

Source

Thrown at flink/v2.1/flink/src/main/java/org/apache/iceberg/flink/maintenance/operator/TriggerManagerOperator.java:219

      nextEvaluationTimeState.add(nextEvaluationTime);
    }

    accumulatedChangesState.update(accumulatedChanges);
    lastTriggerTimesState.update(lastTriggerTimes);
    LOG.info(
        "Storing state: nextEvaluationTime {}, accumulatedChanges {}, lastTriggerTimes {}",
        nextEvaluationTime,
        accumulatedChanges,
        lastTriggerTimes);
  }

  @Override
  public void handleOperatorEvent(OperatorEvent event) {
    if (event instanceof LockReleaseEvent) {
      LOG.info("Received lock released event: {}", event);
      handleLockRelease((LockReleaseEvent) event);
    } else {
      throw new IllegalArgumentException(
          "Invalid operator event type: " + event.getClass().getCanonicalName());
    }
  }

  @Override
  public void processElement(StreamRecord<TableChange> streamRecord) throws Exception {
    TableChange change = streamRecord.getValue();
    accumulatedChanges.forEach(tableChange -> tableChange.merge(change));
    if (nextEvaluationTime == null) {
      checkAndFire(getProcessingTimeService());
    } else {
      LOG.info(
          "Trigger manager rate limiter triggered current: {}, next: {}, accumulated changes: {},{}",
          getProcessingTimeService().getCurrentProcessingTime(),
          nextEvaluationTime,
          accumulatedChanges,
          maintenanceTaskNames);
      rateLimiterTriggeredCounter.inc();

View on GitHub (pinned to 86d9c8fc54)

Solutions

  1. Route trigger events and lock registrations to the TriggerManagerCoordinator, not the operator; only LockReleaseEvent belongs at the operator.
  2. Use matching Iceberg Flink versions for savepoint production and restore.
  3. Verify event wiring in any custom topology built with IcebergFlinkMaintenance builder APIs.
  4. If running a mixed-version cluster, restart the whole job on a single version.

Example fix

// before
taskOperator.sendOperatorEvent(new TimerTriggerEvent(cronSchedule));
// after
taskCoordinator.sendOperatorEvent(new TimerTriggerEvent(cronSchedule));
Defensive patterns

Strategy: type-guard

Validate before calling

if (!(event instanceof LockReleaseEvent)) {
  throw new IllegalArgumentException("Event not valid for operator: " + event.getClass());
}

Type guard

boolean isOperatorEvent(OperatorEvent e) {
  return e instanceof LockReleaseEvent;
}

Try / catch

try { operator.sendOperatorEvent(event); } catch (IllegalArgumentException e) { LOG.warn("Wrong endpoint for event {}", event.getClass(), e); }

Prevention

When it happens

Trigger: A non-LockReleaseEvent (e.g. CheckpointTriggerEvent, TimerTriggerEvent, or a LockRegisterEvent) is sent to the TriggerManagerOperator instead of the coordinator, or version-skewed event classes arrive after a job restore.

Common situations: Custom code or tooling addressing events to the wrong operator; savepoint/restore across different Iceberg versions where the event class set changed; event routing bugs in custom maintenance topologies.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12). Data as JSON: /api/errors/96a843279c5d7872. Report an issue: GitHub.