You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@seata.apache.org by ji...@apache.org on 2024/11/22 06:04:16 UTC
(incubator-seata) branch 2.x updated: bugfix: fix vGroupMappingManager is NOT init (#7025)
This is an automated email from the ASF dual-hosted git repository.
jiangjunmin pushed a commit to branch 2.x
in repository https://gitbox.apache.org/repos/asf/incubator-seata.git
The following commit(s) were added to refs/heads/2.x by this push:
new b6f5d68815 bugfix: fix vGroupMappingManager is NOT init (#7025)
b6f5d68815 is described below
commit b6f5d688159f9b6c66be108d476c75964cbec603
Author: ggbocoder <11...@users.noreply.github.com>
AuthorDate: Fri Nov 22 14:04:11 2024 +0800
bugfix: fix vGroupMappingManager is NOT init (#7025)
---
changes/en-us/2.x.md | 3 ++-
changes/zh-cn/2.x.md | 1 +
.../seata/server/controller/VGroupMappingController.java | 13 ++-----------
3 files changed, 5 insertions(+), 12 deletions(-)
diff --git a/changes/en-us/2.x.md b/changes/en-us/2.x.md
index 7641369d36..7033f80801 100644
--- a/changes/en-us/2.x.md
+++ b/changes/en-us/2.x.md
@@ -27,7 +27,8 @@ Add changes here for all PR submitted to the 2.x branch.
- [[#7005](https://github.com/apache/incubator-seata/pull/7005)] fix the Raft NPE issue caused by two-phase concurrency
- [[#7010](https://github.com/apache/incubator-seata/pull/7010)] fix error while the "context" is key word in DM8 when delete undolog
- [[#7022](https://github.com/apache/incubator-seata/pull/7022)] fix `store.mode` property in `application.raft.example.yml`
-
+- [[#7025](https://github.com/apache/incubator-seata/pull/7025)] fix vGroupMappingManager is NOT init
+-
### optimize:
- [[#6826](https://github.com/apache/incubator-seata/pull/6826)] remove the branch registration operation of the XA read-only transaction
- [[#6874](https://github.com/apache/incubator-seata/pull/6874)] modify the version to 2.3.0-SNAPSHOT
diff --git a/changes/zh-cn/2.x.md b/changes/zh-cn/2.x.md
index 1e5bfc9be1..93eea2911d 100644
--- a/changes/zh-cn/2.x.md
+++ b/changes/zh-cn/2.x.md
@@ -27,6 +27,7 @@
- [[#7005](https://github.com/apache/incubator-seata/pull/7005)] 修复Raft模式下两阶段并发可能导致NPE的问题
- [[#7010](https://github.com/apache/incubator-seata/pull/7010)] 修复使用达梦数据库时删除undolog发生SQL语法错误
- [[#7022](https://github.com/apache/incubator-seata/pull/7022)] 修复 `application.raft.example.yml`的 `store.mode`属性
+- [[#7025](https://github.com/apache/incubator-seata/pull/7025)] 修复vGroupMappingManager未初始化的问题
### optimize:
- [[#6826](https://github.com/apache/incubator-seata/pull/6826)] 移除只读XA事务的分支注册操作
diff --git a/server/src/main/java/org/apache/seata/server/controller/VGroupMappingController.java b/server/src/main/java/org/apache/seata/server/controller/VGroupMappingController.java
index 348a750283..09c3f8c788 100644
--- a/server/src/main/java/org/apache/seata/server/controller/VGroupMappingController.java
+++ b/server/src/main/java/org/apache/seata/server/controller/VGroupMappingController.java
@@ -44,15 +44,6 @@ public class VGroupMappingController {
protected static final Configuration CONFIG = ConfigurationFactory.getInstance();
- @PostConstruct
- private void init() {
- String type =
- ConfigurationFactory.getInstance().getConfig(FILE_ROOT_REGISTRY + FILE_CONFIG_SPLIT_CHAR + FILE_ROOT_TYPE);
- if (StringUtils.equals(type, NAMING_SERVER)) {
- vGroupMappingStoreManager = SessionHolder.getRootVGroupMappingManager();
- }
- }
-
/**
* add vGroup in cluster
*
@@ -67,7 +58,7 @@ public class VGroupMappingController {
mappingDO.setCluster(Instance.getInstance().getClusterName());
mappingDO.setUnit(unit);
mappingDO.setVGroup(vGroup);
- boolean rst = vGroupMappingStoreManager.addVGroup(mappingDO);
+ boolean rst = SessionHolder.getRootVGroupMappingManager().addVGroup(mappingDO);
Instance.getInstance().setTerm(System.currentTimeMillis());
if (!rst) {
result.setCode("500");
@@ -85,7 +76,7 @@ public class VGroupMappingController {
@GetMapping("/removeVGroup")
public Result<?> removeVGroup(@RequestParam String vGroup) {
Result<?> result = new Result<>();
- boolean rst = vGroupMappingStoreManager.removeVGroup(vGroup);
+ boolean rst = SessionHolder.getRootVGroupMappingManager().removeVGroup(vGroup);
Instance.getInstance().setTerm(System.currentTimeMillis());
if (!rst) {
result.setCode("500");
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org