This is an automated email from the ASF dual-hosted git repository.

jinrongtong pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/rocketmq.git


The following commit(s) were added to refs/heads/develop by this push:
     new 311b831c02 [ISSUE #8829] Keep data version while reload and 
XXXConfigManagerV2 turns off sync
311b831c02 is described below

commit 311b831c0223c1c9a875a844e869e19b58dae297
Author: Zhanhui Li <lizhan...@apache.org>
AuthorDate: Wed Nov 6 10:12:24 2024 +0800

    [ISSUE #8829] Keep data version while reload and XXXConfigManagerV2 turns 
off sync
    
    Signed-off-by: Li Zhanhui <lizhan...@gmail.com>
---
 .../main/java/org/apache/rocketmq/broker/config/v2/ConfigStorage.java | 4 ++--
 .../apache/rocketmq/broker/config/v2/SubscriptionGroupManagerV2.java  | 2 +-
 .../org/apache/rocketmq/broker/config/v2/TopicConfigManagerV2.java    | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git 
a/broker/src/main/java/org/apache/rocketmq/broker/config/v2/ConfigStorage.java 
b/broker/src/main/java/org/apache/rocketmq/broker/config/v2/ConfigStorage.java
index a31b573daa..6bc62957a8 100644
--- 
a/broker/src/main/java/org/apache/rocketmq/broker/config/v2/ConfigStorage.java
+++ 
b/broker/src/main/java/org/apache/rocketmq/broker/config/v2/ConfigStorage.java
@@ -87,8 +87,8 @@ public class ConfigStorage extends AbstractRocksDBStorage {
     protected void initAbleWalWriteOptions() {
         this.ableWalWriteOptions = new WriteOptions();
 
-        // For metadata, prioritize data integrity
-        this.ableWalWriteOptions.setSync(true);
+        // Given that fdatasync is kind of expensive, sync-WAL for every write 
cannot be afforded.
+        this.ableWalWriteOptions.setSync(false);
 
         // We need WAL for config changes
         this.ableWalWriteOptions.setDisableWAL(false);
diff --git 
a/broker/src/main/java/org/apache/rocketmq/broker/config/v2/SubscriptionGroupManagerV2.java
 
b/broker/src/main/java/org/apache/rocketmq/broker/config/v2/SubscriptionGroupManagerV2.java
index f535fa195a..dea8a2d2c1 100644
--- 
a/broker/src/main/java/org/apache/rocketmq/broker/config/v2/SubscriptionGroupManagerV2.java
+++ 
b/broker/src/main/java/org/apache/rocketmq/broker/config/v2/SubscriptionGroupManagerV2.java
@@ -72,7 +72,7 @@ public class SubscriptionGroupManagerV2 extends 
SubscriptionGroupManager {
             while (iterator.isValid()) {
                 SubscriptionGroupConfig subscriptionGroupConfig = 
parseSubscription(iterator.key(), iterator.value());
                 if (null != subscriptionGroupConfig) {
-                    
super.updateSubscriptionGroupConfigWithoutPersist(subscriptionGroupConfig);
+                    super.putSubscriptionGroupConfig(subscriptionGroupConfig);
                 }
                 iterator.next();
             }
diff --git 
a/broker/src/main/java/org/apache/rocketmq/broker/config/v2/TopicConfigManagerV2.java
 
b/broker/src/main/java/org/apache/rocketmq/broker/config/v2/TopicConfigManagerV2.java
index b1a3d2d85c..4e36b08727 100644
--- 
a/broker/src/main/java/org/apache/rocketmq/broker/config/v2/TopicConfigManagerV2.java
+++ 
b/broker/src/main/java/org/apache/rocketmq/broker/config/v2/TopicConfigManagerV2.java
@@ -76,7 +76,7 @@ public class TopicConfigManagerV2 extends TopicConfigManager {
                 byte[] value = iterator.value();
                 TopicConfig topicConfig = parseTopicConfig(key, value);
                 if (null != topicConfig) {
-                    super.updateSingleTopicConfigWithoutPersist(topicConfig);
+                    super.putTopicConfig(topicConfig);
                 }
                 iterator.next();
             }

Reply via email to