{"record":{"id":"cae130e7f94b2921","repo":"apache/iceberg","slug":"invalid-operator-event-type-cae130","errorCode":null,"errorMessage":"Invalid operator event type: ","messagePattern":"Invalid operator event type: ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"flink/v2.1/flink/src/main/java/org/apache/iceberg/flink/maintenance/operator/TriggerManagerCoordinator.java","lineNumber":48,"sourceCode":"  TriggerManagerCoordinator(String operatorName, Context context) {\n    super(operatorName, context);\n    LOG.info(\"Created TriggerManagerCoordinator: {}\", operatorName);\n  }\n\n  @Override\n  public void handleEventFromOperator(int subtask, int attemptNumber, OperatorEvent event) {\n    runInCoordinatorThread(\n        () -> {\n          LOG.debug(\n              \"Handling event from subtask {} (#{}) of {}: {}\",\n              subtask,\n              attemptNumber,\n              operatorName(),\n              event);\n          if (event instanceof LockRegisterEvent) {\n            registerLock((LockRegisterEvent) event);\n          } else {\n            throw new IllegalArgumentException(\n                \"Invalid operator event type: \" + event.getClass().getCanonicalName());\n          }\n        },\n        String.format(\n            Locale.ROOT,\n            \"handling operator event %s from subtask %d (#%d)\",\n            event.getClass(),\n            subtask,\n            attemptNumber));\n  }\n}\n","sourceCodeStart":30,"sourceCodeEnd":60,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/flink/v2.1/flink/src/main/java/org/apache/iceberg/flink/maintenance/operator/TriggerManagerCoordinator.java#L30-L60","documentation":"TriggerManagerCoordinator receives OperatorEvents from its subtask operators. It only recognizes CheckpointTriggerEvent, TimerTriggerEvent (and LockRegisterEvent for registration); any other event type is rejected with this IllegalArgumentException, since the coordinator cannot meaningfully process it.","triggerScenarios":"An OperatorEvent of a type other than CheckpointTriggerEvent/TimerTriggerEvent/LockRegisterEvent arrives at the TriggerManagerCoordinator, e.g. a LockReleaseEvent sent to the coordinator instead of the operator, or an event from a mismatched operator version during job upgrade.","commonSituations":"Sending lock-release events to the wrong endpoint (coordinator vs operator); restoring a job from a savepoint produced by a different Iceberg version with a different event hierarchy; custom code firing events at the coordinator.","solutions":["Send each event type to the correct endpoint: LockReleaseEvent goes to TriggerManagerOperator, trigger/lock-register events to the coordinator.","Ensure the Iceberg Flink runtime version is identical across the job (job jar and cluster classpath).","Restart the job from scratch or from a savepoint produced by the same version instead of mixing versions during restore.","Check that no custom operator events are being routed to the maintenance topology's coordinator."],"exampleFix":"// before\ntargetCoordinator.sendOperatorEvent(new LockReleaseEvent(lockId));\n// after\ntargetOperator.sendOperatorEvent(new LockReleaseEvent(lockId));","handlingStrategy":"type-guard","validationCode":"if (!(event instanceof CheckpointTriggerEvent) && !(event instanceof TimerTriggerEvent) && !(event instanceof LockRegisterEvent)) {\n  throw new IllegalArgumentException(\"Event not valid for coordinator: \" + event.getClass());\n}","typeGuard":"boolean isCoordinatorEvent(OperatorEvent e) {\n  return e instanceof CheckpointTriggerEvent || e instanceof TimerTriggerEvent || e instanceof LockRegisterEvent;\n}","tryCatchPattern":"try { coordinator.sendOperatorEvent(event); } catch (IllegalArgumentException e) { LOG.warn(\"Rejected coordinator event {}\", event.getClass(), e); }","preventionTips":["Route events by type: LockReleaseEvent only to the operator, others to the coordinator.","Use the IcebergFlinkMaintenance builder API instead of hand-wiring operator event gateways.","Never mix Iceberg versions between savepoint creation and restore."],"tags":["flink","operator-event","maintenance","type-mismatch"],"backgroundTag":"invalid-enum-value","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}