From 64f2c2dbfe2352d0e32488a860914dc893220ed6 Mon Sep 17 00:00:00 2001 From: Enrico Olivelli Date: Wed, 21 Dec 2022 09:23:42 +0100 Subject: [PATCH] Use a dedicated timeout for WRITE_TXN_MARKERS and disable kafkaTxnPurgeAbortedTxnIntervalSeconds by default (cherry picked from commit e1e4562a035cba0d31f699e55002d073dd99e60d) --- .../pulsar/handlers/kop/KafkaRequestHandler.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/kafka-impl/src/main/java/io/streamnative/pulsar/handlers/kop/KafkaRequestHandler.java b/kafka-impl/src/main/java/io/streamnative/pulsar/handlers/kop/KafkaRequestHandler.java index 89d37ecb75..4ec2b706de 100644 --- a/kafka-impl/src/main/java/io/streamnative/pulsar/handlers/kop/KafkaRequestHandler.java +++ b/kafka-impl/src/main/java/io/streamnative/pulsar/handlers/kop/KafkaRequestHandler.java @@ -211,6 +211,12 @@ @Getter public class KafkaRequestHandler extends KafkaCommandDecoder { private static final int THROTTLE_TIME_MS = 10; + /** + * Request timeout for writes of the TXMARKERS + * Writing the TXMARKERS require recovery of the + * transactions on the PartitionLog at it may take much time. + */ + private static final int WRITE_TXN_MARKERS_TIMEOUT = 120000; private static final String POLICY_ROOT = "/admin/policies/"; private final PulsarService pulsarService; @@ -2441,7 +2447,7 @@ protected void handleWriteTxnMarkers(KafkaHeaderAndRequest kafkaHeaderAndRequest this.pendingTopicFuturesMap, ctx); getReplicaManager().appendRecords( - kafkaConfig.getRequestTimeoutMs(), + WRITE_TXN_MARKERS_TIMEOUT, (short) 1, true, currentNamespacePrefix(),