{"record":{"id":"cf42ca7f6e291c45","repo":"apache/iceberg","slug":"invalid-operator-event-type-eventtype","errorCode":null,"errorMessage":"Invalid operator event type: ${eventType}","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/sink/shuffle/DataStatisticsCoordinator.java","lineNumber":322,"sourceCode":"    }\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 StatisticsEvent) {\n            handleDataStatisticRequest(subtask, ((StatisticsEvent) event));\n          } else if (event instanceof RequestGlobalStatisticsEvent) {\n            handleRequestGlobalStatisticsEvent(subtask, (RequestGlobalStatisticsEvent) 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  @Override\n  public void checkpointCoordinator(long checkpointId, CompletableFuture<byte[]> resultFuture) {\n    runInCoordinatorThread(\n        () -> {\n          LOG.debug(\n              \"Snapshotting data statistics coordinator {} for checkpoint {}\",\n              operatorName,","sourceCodeStart":304,"sourceCodeEnd":340,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/flink/v2.1/flink/src/main/java/org/apache/iceberg/flink/sink/shuffle/DataStatisticsCoordinator.java#L304-L340","documentation":"DataStatisticsCoordinator.handleEventFromOperator processes OperatorEvents sent from upstream subtasks during the shuffle data-statistics protocol. Only StatisticsEvent and RequestGlobalStatisticsEvent are recognized; any other event type is rejected. This is a defensive check against protocol mismatches between operator and coordinator.","triggerScenarios":"Sending a custom/unknown OperatorEvent to the coordinator, or mismatched connector versions where one side emits an event type the other does not recognize.","commonSituations":"Mixing Iceberg connector jar versions within one Flink job (e.g. different versions on coordinator and operator classpaths), or custom operator event injection in tests/patches.","solutions":["Ensure all TaskManager nodes use the same Iceberg connector version (check the job classpath/uber-jar).","Fully restart the job rather than hot-swapping jars so event protocol versions match.","If adding custom events, extend the coordinator's handler instead of reusing this one."],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"if (!(event instanceof StatisticsEvent) && !(event instanceof RequestGlobalStatisticsEvent)) {\n  throw new IllegalArgumentException(\"Unsupported operator event for DataStatisticsCoordinator: \" + event.getClass().getName());\n}","typeGuard":"boolean isHandledEvent(OperatorEvent e) {\n  return e instanceof StatisticsEvent || e instanceof RequestGlobalStatisticsEvent;\n}","tryCatchPattern":"try {\n  coordinator.handleEventFromOperator(subtask, event, index);\n} catch (IllegalArgumentException e) {\n  if (e.getMessage().startsWith(\"Invalid operator event type\")) {\n    LOG.warn(\"Ignoring unknown operator event {} — check for version skew\", event.getClass().getName());\n  } else throw e;\n}","preventionTips":["Run the same connector version on all TaskManagers and the JobManager.","Restart the whole job after upgrading jars; never mix versions mid-job.","Do not send custom OperatorEvents to the coordinator."],"tags":["flink","operator-event","shuffle"],"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-14T11:17:12.474Z"}