From 8aad756550f6665e5584a22d601d38b8d98d68ae Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 19 Apr 2023 09:53:46 +0800 Subject: [PATCH 1/4] build(deps): bump spring-core from 5.3.26 to 5.3.27 (#6604) Bumps [spring-core](https://github.com/spring-projects/spring-framework) from 5.3.26 to 5.3.27. - [Release notes](https://github.com/spring-projects/spring-framework/releases) - [Commits](https://github.com/spring-projects/spring-framework/compare/v5.3.26...v5.3.27) --- updated-dependencies: - dependency-name: org.springframework:spring-core dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c009d0c52d5..f658b210c64 100644 --- a/pom.xml +++ b/pom.xml @@ -131,7 +131,7 @@ 1.2.10 0.9.11 2.9.3 - 5.3.26 + 5.3.27 3.0.0 1.19.0 1.19.0-alpha From 073da6b971588d7fbb4cd48ae45691d3665b0f3c Mon Sep 17 00:00:00 2001 From: rongtong Date: Wed, 19 Apr 2023 09:54:52 +0800 Subject: [PATCH 2/4] Fix the issue broker startup failed when version upgrade from 5.1.0 to latest develop because compactionThreadNum is 0 (#6611) --- .../main/java/org/apache/rocketmq/store/kv/CompactionStore.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/store/src/main/java/org/apache/rocketmq/store/kv/CompactionStore.java b/store/src/main/java/org/apache/rocketmq/store/kv/CompactionStore.java index 3ba37df9571..b37c907267c 100644 --- a/store/src/main/java/org/apache/rocketmq/store/kv/CompactionStore.java +++ b/store/src/main/java/org/apache/rocketmq/store/kv/CompactionStore.java @@ -74,7 +74,7 @@ public CompactionStore(DefaultMessageStore defaultMessageStore) { this.compactionLogPath = Paths.get(compactionPath, COMPACTION_LOG_DIR).toString(); this.compactionCqPath = Paths.get(compactionPath, COMPACTION_CQ_DIR).toString(); this.positionMgr = new CompactionPositionMgr(compactionPath); - this.compactionThreadNum = Math.min(Runtime.getRuntime().availableProcessors(), config.getCompactionThreadNum()); + this.compactionThreadNum = Math.min(Runtime.getRuntime().availableProcessors(), Math.max(1, config.getCompactionThreadNum())); this.compactionSchedule = Executors.newScheduledThreadPool(this.compactionThreadNum, new ThreadFactoryImpl("compactionSchedule_")); From ea8b9d9f7a96a83d12006fd89c90356db658ef2e Mon Sep 17 00:00:00 2001 From: hiyo <77013030+miles-ton@users.noreply.github.com> Date: Wed, 19 Apr 2023 10:31:43 +0800 Subject: [PATCH 3/4] [ISSUE #6594] skip verification for admin user (#6613) --- .../acl/plain/PlainPermissionChecker.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/acl/src/main/java/org/apache/rocketmq/acl/plain/PlainPermissionChecker.java b/acl/src/main/java/org/apache/rocketmq/acl/plain/PlainPermissionChecker.java index 549c9fdce97..8e6c317b237 100644 --- a/acl/src/main/java/org/apache/rocketmq/acl/plain/PlainPermissionChecker.java +++ b/acl/src/main/java/org/apache/rocketmq/acl/plain/PlainPermissionChecker.java @@ -27,9 +27,15 @@ public class PlainPermissionChecker implements PermissionChecker { public void check(AccessResource checkedAccess, AccessResource ownedAccess) { PlainAccessResource checkedPlainAccess = (PlainAccessResource) checkedAccess; PlainAccessResource ownedPlainAccess = (PlainAccessResource) ownedAccess; - if (Permission.needAdminPerm(checkedPlainAccess.getRequestCode()) && !ownedPlainAccess.isAdmin()) { + + if (ownedPlainAccess.isAdmin()) { + // admin user don't need verification + return; + } + if (Permission.needAdminPerm(checkedPlainAccess.getRequestCode())) { throw new AclException(String.format("Need admin permission for request code=%d, but accessKey=%s is not", checkedPlainAccess.getRequestCode(), ownedPlainAccess.getAccessKey())); } + Map needCheckedPermMap = checkedPlainAccess.getResourcePermMap(); Map ownedPermMap = ownedPlainAccess.getResourcePermMap(); @@ -38,11 +44,6 @@ public void check(AccessResource checkedAccess, AccessResource ownedAccess) { return; } - if (ownedPermMap == null && ownedPlainAccess.isAdmin()) { - // If the ownedPermMap is null and it is an admin user, then return - return; - } - for (Map.Entry needCheckedEntry : needCheckedPermMap.entrySet()) { String resource = needCheckedEntry.getKey(); Byte neededPerm = needCheckedEntry.getValue(); @@ -58,7 +59,7 @@ public void check(AccessResource checkedAccess, AccessResource ownedAccess) { continue; } if (!Permission.checkPermission(neededPerm, ownedPermMap.get(resource))) { - throw new AclException(String.format("No default permission for %s", PlainAccessResource.printStr(resource, isGroup))); + throw new AclException(String.format("No permission for %s", PlainAccessResource.printStr(resource, isGroup))); } } } From af6a95f4c5b9bc468e2d152e225935c2f1e6309c Mon Sep 17 00:00:00 2001 From: Zhouxiang Zhan Date: Fri, 21 Apr 2023 15:50:41 +0800 Subject: [PATCH 4/4] [ISSUE #6627] Fix ConsumerLagCalculator#processAllGroup retry topic NPE (#6628) --- .../broker/metrics/ConsumerLagCalculator.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/broker/src/main/java/org/apache/rocketmq/broker/metrics/ConsumerLagCalculator.java b/broker/src/main/java/org/apache/rocketmq/broker/metrics/ConsumerLagCalculator.java index f2abdba74c2..a1afe7e57e3 100644 --- a/broker/src/main/java/org/apache/rocketmq/broker/metrics/ConsumerLagCalculator.java +++ b/broker/src/main/java/org/apache/rocketmq/broker/metrics/ConsumerLagCalculator.java @@ -177,12 +177,14 @@ private void processAllGroup(Consumer consumer) { if (isPop) { String retryTopic = KeyBuilder.buildPopRetryTopic(topic, group); TopicConfig retryTopicConfig = topicConfigManager.selectTopicConfig(retryTopic); - int retryTopicPerm = retryTopicConfig.getPerm() & brokerConfig.getBrokerPermission(); - if (PermName.isReadable(retryTopicPerm) || PermName.isWriteable(retryTopicPerm)) { - consumer.accept(new ProcessGroupInfo(group, topic, true, retryTopic)); - } else { - consumer.accept(new ProcessGroupInfo(group, topic, true, null)); + if (retryTopicConfig != null) { + int retryTopicPerm = retryTopicConfig.getPerm() & brokerConfig.getBrokerPermission(); + if (PermName.isReadable(retryTopicPerm) || PermName.isWriteable(retryTopicPerm)) { + consumer.accept(new ProcessGroupInfo(group, topic, true, retryTopic)); + continue; + } } + consumer.accept(new ProcessGroupInfo(group, topic, true, null)); } else { consumer.accept(new ProcessGroupInfo(group, topic, false, null)); }