{"record":{"id":"62a5562df29fc6fc","repo":"apache/seatunnel","slug":"interrupted-while-waiting-for-valid-replication-sl","errorCode":null,"errorMessage":"Interrupted while waiting for valid replication slot info","messagePattern":"Interrupted while waiting for valid replication slot info","errorType":"exception","errorClass":"ConnectException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-cdc/connector-cdc-opengauss/src/main/java/io/debezium/connector/postgresql/connection/PostgresConnection.java","lineNumber":263,"sourceCode":"     *\n     * @param slotName the name of the slot\n     * @param pluginName the name of the plugin used for the desired slot\n     * @return the {@link SlotState} or null, if no slot state is found\n     * @throws SQLException\n     */\n    public SlotState getReplicationSlotState(String slotName, String pluginName)\n            throws SQLException {\n        ServerInfo.ReplicationSlot slot;\n        try {\n            slot = readReplicationSlotInfo(slotName, pluginName);\n            if (slot.equals(ServerInfo.ReplicationSlot.INVALID)) {\n                return null;\n            } else {\n                return slot.asSlotState();\n            }\n        } catch (InterruptedException e) {\n            Thread.currentThread().interrupt();\n            throw new ConnectException(\n                    \"Interrupted while waiting for valid replication slot info\", e);\n        }\n    }\n\n    /**\n     * Fetches the state of a replication stage given a slot name and plugin name\n     *\n     * @param slotName the name of the slot\n     * @param pluginName the name of the plugin used for the desired slot\n     * @return the {@link ServerInfo.ReplicationSlot} object or a {@link\n     *     ServerInfo.ReplicationSlot#INVALID} if the slot is not valid\n     * @throws SQLException is thrown by the underlying JDBC\n     */\n    private ServerInfo.ReplicationSlot fetchReplicationSlotInfo(String slotName, String pluginName)\n            throws SQLException {\n        final String database = database();\n        final ServerInfo.ReplicationSlot slot =\n                queryForSlot(","sourceCodeStart":245,"sourceCodeEnd":281,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-cdc/connector-cdc-opengauss/src/main/java/io/debezium/connector/postgresql/connection/PostgresConnection.java#L245-L281","documentation":"PostgresConnection.getReplicationSlotState polls for a valid replication slot status and, if the waiting thread is interrupted before slot info is obtained, restores the interrupt flag and wraps the event in a ConnectException with this message. It signals that the connector's attempt to read the replication slot's state (used by opengauss/Postgres CDC to decide whether to snapshot or resume) was aborted mid-wait.","triggerScenarios":"Calling getReplicationSlotState when the task thread receives an interrupt while waiting for slot query results: job cancellation, engine shutdown, task restart/failover, or watchdog interrupt during a slow query against pg_replication_slots.","commonSituations":"Cancelling a stuck opengauss/postgres CDC job; slot query hanging because the DB is overloaded or the slot name/plugin is wrong causing retries; Zeta worker restart during startup; checkpoint timeout triggering task cancellation.","solutions":["Determine who interrupted the thread (job cancel vs. failure) from engine logs; if the cancel was unintended, resubmit the job","Verify the replication slot exists and is healthy: SELECT * FROM pg_replication_slots; check slot_name/plugin config","Check database responsiveness (long-running queries, lock contention) that could stall the slot-info wait","If the slot is orphaned/invalid, drop and recreate it, then restart the connector"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"SELECT slot_name, plugin, active FROM pg_replication_slots; -- verify slot exists before starting","typeGuard":null,"tryCatchPattern":"try {\n    SlotState state = connection.getReplicationSlotState(slotName, plugin);\n} catch (ConnectException e) {\n    // interrupted: resubmit task or check engine cancellation logs\n}","preventionTips":["Keep the replication slot valid and drop orphans","Avoid cancelling jobs during slot-state checks unless necessary","Ensure the DB is responsive (watch for lock contention/overload)","Align checkpoint/cancel timeouts so slow startups aren't killed prematurely"],"tags":["postgres","opengauss","cdc","replication-slot","interruption"],"backgroundTag":"thread-interrupted","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}