{"record":{"id":"c39d69e14c2f6f14","repo":"apache/pulsar","slug":"the-only-supported-actiontype-is-delete","errorCode":null,"errorMessage":"The only supported ActionType is DELETE","messagePattern":"The only supported ActionType is DELETE","errorType":"validation","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"pulsar-broker/src/main/java/org/apache/pulsar/broker/systopic/TopicPoliciesSystemTopicClient.java","lineNumber":157,"sourceCode":"                systemTopicClient.getWriters().remove(TopicPolicyWriter.this);\n            });\n        }\n\n        @Override\n        public SystemTopicClient<PulsarEvent> getSystemTopicClient() {\n            return systemTopicClient;\n        }\n    }\n\n    private static void setReplicateCluster(PulsarEvent event, TypedMessageBuilder<PulsarEvent> builder) {\n        if (event.getReplicateTo() != null) {\n            builder.replicationClusters(new ArrayList<>(event.getReplicateTo()));\n        }\n    }\n\n    private static void validateActionType(PulsarEvent event) {\n        if (event == null || !ActionType.DELETE.equals(event.getActionType())) {\n            throw new UnsupportedOperationException(\"The only supported ActionType is DELETE\");\n        }\n    }\n\n    private static class TopicPolicyReader implements Reader<PulsarEvent> {\n\n        private final org.apache.pulsar.client.api.Reader<PulsarEvent> reader;\n        private final TopicPoliciesSystemTopicClient systemTopic;\n\n        private TopicPolicyReader(org.apache.pulsar.client.api.Reader<PulsarEvent> reader,\n                                  TopicPoliciesSystemTopicClient systemTopic) {\n            this.reader = reader;\n            this.systemTopic = systemTopic;\n        }\n\n        @Override\n        public Message<PulsarEvent> readNext() throws PulsarClientException {\n            return reader.readNext();\n        }","sourceCodeStart":139,"sourceCodeEnd":175,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-broker/src/main/java/org/apache/pulsar/broker/systopic/TopicPoliciesSystemTopicClient.java#L139-L175","documentation":"validateActionType guards writes to the topic-policies system topic: the PulsarEvent's ActionType is missing or is not DELETE, the only action this writer supports, so the malformed policy event is rejected.","triggerScenarios":"Thrown at pulsar-broker/src/main/java/org/apache/pulsar/broker/systopic/TopicPoliciesSystemTopicClient.java:157 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Emit only DELETE action events on this code path"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"820761864ed8e2a7d2e52dd9763ad2ae117c1395","analyzedAt":"2026-09-06T00:14:20.138Z","contentChangedAt":"2026-09-06T00:14:20.138Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}