feature: console supports creation and modification of transaction groups for Raft clusters#7878
feature: console supports creation and modification of transaction groups for Raft clusters#7878funky-eyes merged 24 commits intoapache:2.xfrom
Conversation
… and update version fetching logic
…d updating related logic
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 2.x #7878 +/- ##
============================================
+ Coverage 71.03% 71.06% +0.03%
Complexity 797 797
============================================
Files 1300 1300
Lines 49601 49602 +1
Branches 5871 5873 +2
============================================
+ Hits 35233 35250 +17
+ Misses 11455 11441 -14
+ Partials 2913 2911 -2
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR adds console support for creating and modifying transaction groups (vgroups) for Raft clusters in the naming server. The changes extend the V2 API to distinguish between RAFT and default cluster types, allowing unit-specific vgroup management for RAFT clusters while maintaining backward compatibility with other cluster types.
Key Changes:
- Enhanced the V2 namespace API to include cluster type, units, and unit-specific vgroup information
- Added logic to automatically select a unit when creating/changing vgroups in RAFT clusters
- Updated frontend components to display and manage unit selection for RAFT clusters
- Refactored the NamespaceData class from inner class to standalone BO class
Reviewed changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
| namingserver/src/main/java/org/apache/seata/namingserver/manager/NamingManager.java | Core logic for handling vgroup operations with RAFT cluster support, including automatic unit selection and namespace data collection enhancements |
| namingserver/src/main/java/org/apache/seata/namingserver/entity/vo/v2/NamespaceVO.java | Changed from Map<String, List> to Map<String, ClusterVO> to support richer cluster metadata |
| namingserver/src/main/java/org/apache/seata/namingserver/entity/vo/v2/ClusterVO.java | New VO class containing vgroups, units, unitVgroups map, and cluster type information |
| namingserver/src/main/java/org/apache/seata/namingserver/entity/bo/NamespaceData.java | Extracted inner helper class to standalone BO with added unitVgroupsMap for unit-level vgroup tracking |
| namingserver/src/test/java/org/apache/seata/namingserver/NamingManagerTest.java | Updated assertions to work with new ClusterVO structure instead of direct vgroup lists |
| namingserver/src/test/java/org/apache/seata/namingserver/NamingControllerV2Test.java | Updated test to verify ClusterVO structure including units and vgroups |
| namingserver/src/main/resources/application.yml | Removed trailing blank line (formatting) |
| namingserver/pom.xml | Added explicit maven-compiler-plugin configuration for Java 8 |
| console/src/main/resources/static/console-fe/src/service/transactionInfo.ts | Changed HTTP method to POST with form-urlencoded data and added qs import for parameter serialization |
| console/src/main/resources/static/console-fe/src/service/clusterManager.ts | Added changeGroup function (but with incorrect request format) |
| console/src/main/resources/static/console-fe/src/reducers/locale.ts | Changed locale type from ILocale to any to accommodate dynamic structure |
| console/src/main/resources/static/console-fe/src/pages/TransactionInfo/TransactionInfo.tsx | Major updates to support unit selection in vgroup create/change dialogs based on cluster type |
| console/src/main/resources/static/console-fe/src/pages/GlobalLockInfo/GlobalLockInfo.tsx | Updated to parse new ClusterVO structure from namespace API response |
| console/src/main/resources/static/console-fe/src/pages/ClusterManager/ClusterManager.tsx | Updated to handle clusterTypes in namespace options |
| console/src/main/resources/static/console-fe/src/module.d.ts | Changed GlobalProps locale type from ILocale to any |
| console/src/main/resources/static/console-fe/src/app.tsx | Fixed setState to use functional form with prevState |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
namingserver/src/main/java/org/apache/seata/namingserver/manager/NamingManager.java
Outdated
Show resolved
Hide resolved
namingserver/src/main/java/org/apache/seata/namingserver/manager/NamingManager.java
Outdated
Show resolved
Hide resolved
namingserver/src/main/java/org/apache/seata/namingserver/entity/vo/v2/ClusterVO.java
Outdated
Show resolved
Hide resolved
console/src/main/resources/static/console-fe/src/service/transactionInfo.ts
Show resolved
Hide resolved
console/src/main/resources/static/console-fe/src/service/clusterManager.ts
Outdated
Show resolved
Hide resolved
console/src/main/resources/static/console-fe/src/pages/TransactionInfo/TransactionInfo.tsx
Outdated
Show resolved
Hide resolved
console/src/main/resources/static/console-fe/src/pages/TransactionInfo/TransactionInfo.tsx
Outdated
Show resolved
Hide resolved
console/src/main/resources/static/console-fe/src/pages/ClusterManager/ClusterManager.tsx
Outdated
Show resolved
Hide resolved
console/src/main/resources/static/console-fe/src/pages/TransactionInfo/TransactionInfo.tsx
Outdated
Show resolved
Hide resolved
…er/NamingManager.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…er/NamingManager.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…Manager/ClusterManager.tsx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…tionInfo/TransactionInfo.tsx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…tionInfo/TransactionInfo.tsx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…er/NamingManager.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…er/NamingManager.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…d form data serialization
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 16 out of 17 changed files in this pull request and generated 11 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
console/src/main/resources/static/console-fe/src/pages/TransactionInfo/TransactionInfo.tsx
Outdated
Show resolved
Hide resolved
namingserver/src/main/java/org/apache/seata/namingserver/manager/NamingManager.java
Show resolved
Hide resolved
namingserver/src/main/java/org/apache/seata/namingserver/manager/NamingManager.java
Show resolved
Hide resolved
console/src/main/resources/static/console-fe/src/pages/TransactionInfo/TransactionInfo.tsx
Show resolved
Hide resolved
console/src/main/resources/static/console-fe/src/pages/TransactionInfo/TransactionInfo.tsx
Show resolved
Hide resolved
namingserver/src/main/java/org/apache/seata/namingserver/manager/NamingManager.java
Outdated
Show resolved
Hide resolved
console/src/main/resources/static/console-fe/src/service/clusterManager.ts
Outdated
Show resolved
Hide resolved
console/src/main/resources/static/console-fe/src/pages/TransactionInfo/TransactionInfo.tsx
Show resolved
Hide resolved
console/src/main/resources/static/console-fe/src/pages/ClusterManager/ClusterManager.tsx
Outdated
Show resolved
Hide resolved
…tionInfo/TransactionInfo.tsx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…erManager.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…Manager/ClusterManager.tsx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…oups for Raft clusters (apache#7878)
Ⅰ. Describe what this PR did
raft cluster:

other cluster:

change vgroup

other cluster -> raft cluster
raft cluster -> other cluster

Ⅱ. Does this pull request fix one issue?
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews