From f82441018ac21a81f2bbbf8a11e5d29c22a3197b Mon Sep 17 00:00:00 2001 From: Yong Zhang Date: Thu, 23 May 2019 17:39:57 +0800 Subject: [PATCH] =?UTF-8?q?`rereplicationEntryBatchSize`=20should=20be=20s?= =?UTF-8?q?maller=20than=20`maxPendingReadR=E2=80=A6=20(#4314)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #4213 --- conf/bookkeeper.conf | 2 +- .../src/main/java/org/apache/pulsar/PulsarBrokerStarter.java | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/conf/bookkeeper.conf b/conf/bookkeeper.conf index da68a3d69bd6b..451785934f962 100644 --- a/conf/bookkeeper.conf +++ b/conf/bookkeeper.conf @@ -224,7 +224,7 @@ maxPendingAddRequestsPerThread=10000 auditorPeriodicBookieCheckInterval=86400 # The number of entries that a replication will rereplicate in parallel. -rereplicationEntryBatchSize=5000 +rereplicationEntryBatchSize=100 # Auto-replication # The grace period, in seconds, that the replication worker waits before fencing and diff --git a/pulsar-broker/src/main/java/org/apache/pulsar/PulsarBrokerStarter.java b/pulsar-broker/src/main/java/org/apache/pulsar/PulsarBrokerStarter.java index 8f291ea31f4ef..b582bb5798291 100644 --- a/pulsar-broker/src/main/java/org/apache/pulsar/PulsarBrokerStarter.java +++ b/pulsar-broker/src/main/java/org/apache/pulsar/PulsarBrokerStarter.java @@ -106,6 +106,11 @@ private static ServerConfiguration readBookieConfFile(String bookieConfigFile) t log.error("Malformed configuration file: {}", bookieConfigFile, e); throw new IllegalArgumentException("Malformed configuration file"); } + + if (bookieConf.getMaxPendingReadRequestPerThread() < bookieConf.getRereplicationEntryBatchSize()) { + throw new IllegalArgumentException( + "rereplicationEntryBatchSize should be smaller than " + "maxPendingReadRequestPerThread"); + } return bookieConf; }