You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tubemq.apache.org by la...@apache.org on 2020/05/20 02:50:32 UTC
[incubator-tubemq] branch master updated: [TUBEMQ-128] Shorten the
log clearup check cycle (#86)
This is an automated email from the ASF dual-hosted git repository.
lamberliu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-tubemq.git
The following commit(s) were added to refs/heads/master by this push:
new aca1fb2 [TUBEMQ-128] Shorten the log clearup check cycle (#86)
aca1fb2 is described below
commit aca1fb2096c205715a458c816199081ac56c6070
Author: gosonzhang <46...@qq.com>
AuthorDate: Wed May 20 02:50:25 2020 +0000
[TUBEMQ-128] Shorten the log clearup check cycle (#86)
Co-authored-by: gosonzhang <go...@tencent.com>
---
docs/tubemq_config_introduction.md | 2 +-
docs/tubemq_config_introduction_cn.doc | Bin 182272 -> 182272 bytes
.../apache/tubemq/server/broker/BrokerConfig.java | 6 +++---
.../broker/msgstore/MessageStoreManager.java | 2 +-
4 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/docs/tubemq_config_introduction.md b/docs/tubemq_config_introduction.md
index 43b1529..61026e4 100644
--- a/docs/tubemq_config_introduction.md
+++ b/docs/tubemq_config_introduction.md
@@ -112,7 +112,7 @@ In addition to the back-end system configuration file, the Master also stores th
| maxSSDTotalFileSizes | no | long | The SSD where the Broker is located allows the maximum size of the data file to be saved. The optional field is 32G by default. |
| tcpWriteServiceThread | no | int | Broker supports the number of socket worker threads for TCP production services, optional fields, and defaults to 2 times the number of CPUs of the machine. |
| tcpReadServiceThread | no | int | Broker supports the number of socket worker threads for TCP consumer services, optional fields, defaults to 2 times the number of CPUs of the machine |
-| logClearupDurationMs | no | long | The aging cleanup period of the message file, in milliseconds. The default is 30 minutes for a log cleanup operation. The minimum is 30 minutes. |
+| logClearupDurationMs | no | long | The aging cleanup period of the message file, in milliseconds. The default is 3 minutes for a log cleanup operation. The minimum is 1 minutes. |
| logFlushDiskDurMs | no | long | Batch check message persistence to file check cycle, in milliseconds, default is 20 seconds for a full check and brush |
| visitTokenCheckInValidTimeMs | no | long | The length of the delay check for the visitToken check since the Broker is registered, in ms, the default is 120000, the value range [60000, 300000]. |
| visitMasterAuth | no | boolean | Whether the authentication of the master is enabled, the default is false. If true, the user name and signature information are added to the signaling reported to the master. |
diff --git a/docs/tubemq_config_introduction_cn.doc b/docs/tubemq_config_introduction_cn.doc
index 9e8c106..89fd19c 100644
Binary files a/docs/tubemq_config_introduction_cn.doc and b/docs/tubemq_config_introduction_cn.doc differ
diff --git a/tubemq-server/src/main/java/org/apache/tubemq/server/broker/BrokerConfig.java b/tubemq-server/src/main/java/org/apache/tubemq/server/broker/BrokerConfig.java
index fabc30e..7644aed 100644
--- a/tubemq-server/src/main/java/org/apache/tubemq/server/broker/BrokerConfig.java
+++ b/tubemq-server/src/main/java/org/apache/tubemq/server/broker/BrokerConfig.java
@@ -89,7 +89,7 @@ public class BrokerConfig extends AbstractFileConfig {
// netty write buffer low water mark
private long nettyWriteBufferLowWaterMark = 5 * 1024 * 1024;
// log cleanup interval in milliseconds
- private long logClearupDurationMs = 30 * 60 * 1000;
+ private long logClearupDurationMs = 3 * 60 * 1000;
// log flush to disk interval in milliseconds
private long logFlushDiskDurMs = 20 * 1000;
// memory flush to disk interval in milliseconds
@@ -239,8 +239,8 @@ public class BrokerConfig extends AbstractFileConfig {
}
if (TStringUtils.isNotBlank(brokerSect.get("logClearupDurationMs"))) {
this.logClearupDurationMs = getLong(brokerSect, "logClearupDurationMs");
- if (this.logClearupDurationMs < 20 * 60 * 1000) {
- this.logClearupDurationMs = 20 * 60 * 1000;
+ if (this.logClearupDurationMs < 1 * 60 * 1000) {
+ this.logClearupDurationMs = 1 * 60 * 1000;
}
}
if (TStringUtils.isNotBlank(brokerSect.get("logFlushDiskDurMs"))) {
diff --git a/tubemq-server/src/main/java/org/apache/tubemq/server/broker/msgstore/MessageStoreManager.java b/tubemq-server/src/main/java/org/apache/tubemq/server/broker/msgstore/MessageStoreManager.java
index daa8ba7..344c9b6 100644
--- a/tubemq-server/src/main/java/org/apache/tubemq/server/broker/msgstore/MessageStoreManager.java
+++ b/tubemq-server/src/main/java/org/apache/tubemq/server/broker/msgstore/MessageStoreManager.java
@@ -145,7 +145,7 @@ public class MessageStoreManager implements StoreService {
Thread.currentThread().interrupt();
}
this.logClearScheduler.scheduleWithFixedDelay(new LogClearRunner(),
- tubeConfig.getLogClearupDurationMs() / 2,
+ tubeConfig.getLogClearupDurationMs(),
tubeConfig.getLogClearupDurationMs(),
TimeUnit.MILLISECONDS);