Replies: 2 comments 1 reply
-
|
Please put a copy of the technical solution here in content form. Thanks. |
Beta Was this translation helpful? Give feedback.
-
|
INCUBATOR APACHE SEATA - GOOGLE SUMMER OF CODE
Project AbstractApache Seata-Go serves as the Go implementation of the Seata distributed transaction framework. Currently, the infrastructure layer of Seata-Go lacks the variety of registry adapters that are available in the Java version, and the operational toolchain, seata-ctl, is still in its early stages. This project aims to bridge the gap by:
Background & Problem StatementCurrent StatusThis section is based on prototype work and code exploration in incubator-seata-go and incubator-seata-ctl, reflecting the actual implementation gap beyond the initial project page description. Before this effort, Seata-Go still lagged behind Java Seata at the service-discovery layer. Existing paths covered only part of the deployment space, while common production setups rely on Nacos, ZooKeeper, Consul, or Redis. At the same time, seata-ctl still lacked a clear troubleshooting path from a failed transaction to the exact failing layer. The Identified NeedBeyond simply expanding the adapter and command sets, ensuring correct behavior under real operational constraints remains the core challenge.
Alignment First, Literal Porting SecondJava Seata serves as the compatibility baseline, while the internal Go architecture will adapt to Go-native paradigms. The externally visible behavior should stay aligned with Java, but the internal realization should still respect Go's own runtime model. In practice, that means matching Java on semantics while allowing Go-specific choices for goroutine structure, cache refresh, shutdown handling, and error propagation. The primary metric for this project is interoperability, superseding strict adherence to Java's internal implementations. Performance PerspectiveThe goal is simple: keep warm, look up cheap, and ensure first-ready latency is dominated by the registry backend, minimizing client-side bookkeeping overhead. I have already prepared a local benchmark harness for the Nacos and ZooKeeper discovery paths. On the current PoC prototype (Ubuntu 22.04/amd64, i7-13700H, 5 benchmark runs), the client-side normalization overhead is already quite small:
Table 1. Client-side normalization overhead on the local PoC prototype (Environment: Ubuntu 22.04/amd64, Intel Core i7-13700H, 5 benchmark runs) These numbers confirm that parsing introduces negligible overhead. The primary engineering complexity lies in watching semantics: Nacos uses long-lived callbacks with full snapshots, while ZooKeeper relies on one-shot ExistsW/ChildrenW watches that must be re-registered. That is why Phase I should focus on first-ready latency, watcher re-registration, and correctness under refresh pressure. What to Reuse vs. Replace
Technical Design & ImplementationArchitecture OverviewThe implementation is split into two parts, but they share the same design goal: make Seata-Go easier to deploy in mixed production environments and make failures easier to diagnose once the system is running. On the SDK side, the main path is On the tooling side, the main path is These features inherently interconnect, serving as two ends of the same operational lifecycle: service discovery decides whether the client can locate the right TC node, and seata-ctl decides how quickly an operator can explain a failure when that process breaks. The compatibility baseline is Java Seata. Registry naming, service-group mapping, cluster identity, address format, and console API behavior should remain aligned with Java so that mixed Java/Go deployments behave predictably. Internal implementation details do not need to be ported literally. Go has different strengths around goroutines, cache ownership, lifecycle management, and error propagation, so the internal design should stay idiomatic as long as the externally visible behavior remains compatible. Figure 1. Overall architecture of the GSOC-316 delivery Multi-Registry Support in Incubator-seata-goThe registry side should expose one stable discovery boundary to the rest of the client. ServiceConfig is responsible for transaction-group mapping and cluster resolution. RegistryConfig holds backend-specific configuration such as namespace, group, root path, watch interval, key prefix, authentication, and connection options. InitRegistryWithError then normalizes those settings, validates the chosen registry type, and returns one RegistryService interface to the rest of Seata-Go. This shared boundary keeps the call site simple, but the backend implementations are intentionally different because the registries themselves work differently.
The implementation should not forward raw registry state directly to the lookup path. Every adapter should normalize backend-specific data into the same in-memory model before exposing it to the client. That allows the lookup path to stay cheap in steady state and keeps registry-specific edge cases isolated inside the adapter layer. Several failure cases need to be handled explicitly because they are common in long-running discovery code:
This is also where alignment with Java needs a careful interpretation. Achieving semantic compatibility takes precedence over literal code parity. If Java Seata expects a certain service-group mapping rule or path layout, Seata-Go must match it. If Go can implement the same behavior with a cleaner ownership model for refresh loops and cache rebuilds, that is a better outcome than forcing a line-by-line port. Figure 2. Registry refresh model and shared local cache Diagnose Pipeline in Incubator-seata-ctlTo avoid the opacity of a single-probe approach, the diagnostic examination executes as a transparent, staged pipeline. A transaction problem can come from several independent layers: wrong CLI config, basic TCP failure, authentication failure, partial console API compatibility, unreachable metadata DB, or missing transaction tables. Those cases need to be separated because the operator action is different in each case. The command therefore runs a fixed sequence of checks:
Each stage should emit a structured result with PASS, WARN, FAIL, or SKIP, plus raw details that can be reused by table, JSON, and YAML output. This matters for compatibility handling. For example, an older console API may return 404 for globalLock while still supporting the other endpoints. Specific compatibility warnings must trigger these edge cases to prevent a generic failure state from masking the underlying issue. Figure 3. Staged diagnose pipeline in seata-ctl Transaction Inspection and Interactive WorkflowThe second half of seata-ctl focuses on shortening the path from symptoms to evidence. To eliminate the need for manually composing console API calls, the tool introduces three focused command paths:
These commands should share one normalization layer between the HTTP client and the renderer. That shared model is important for two reasons.
The TUI itself should stay thin. It does not need a separate backend or special-purpose data source. It should reuse the same authenticated session, query layer, and normalized transaction or lock models as the non-interactive commands. Its additional responsibility is presentation logic: periodic refresh, manual refresh, cached-frame fallback on request failure, and small operator hints, such as suggesting the next transaction lock query from the current transaction view. Figure 4: The PoC rendering of the staged diagnostic pipeline using Bubbletea. (This interactive dashboard replaces the legacy flat CLI commands). This design makes the implementation easier to understand. Command mode and TUI mode see the same backend state, exercise the same compatibility logic, and differ mainly in how the result is rendered and refreshed. Figure 5. Transaction inspection and TUI refresh flow Compatibility, Performance, and ValidationCompatibilityInteroperability and operational correctness serve as the primary evaluation metrics, outweighing sheer feature count. The most important compatibility checks are the following:
PerformancePerformance should also be judged in the right places. The key target is not to outperform Java discovery in every microbenchmark. The more realistic target is:
ValidationThat leads naturally to the validation plan:
Correctness under failure is part of the design target from the start. That is the standard needed for this project to genuinely deliver practical production value beyond theoretical completeness. Code AffectedThe implementation of this proposal will systematically upgrade the infrastructure and diagnostic layers across two repositories. Specific modifications include:
Related WorkJava Seata establishes the operational baseline for distributed transaction coordination, supported by production-tested adapters for all mainstream registries. In contrast, while Seata-Go provides Etcd and Nacos support, its adapters for ZooKeeper, Consul, and Redis remain either incomplete or lack the unified registry watcher semantics required to handle edge cases like node flapping or hash-ring rebuilds. Modern cloud-native CLIs (e.g., istioctl, kubectl debug) have standardized interactive, multi-stage diagnostics as a core operational requirement. Currently, seata-ctl provides functional but isolated commands (e.g., basic try or k8s deployments) without an interactive diagnostic layer. The proposed TUI-driven staged pipeline (Config -> TCP -> Auth -> DB Probes) aligns seata-ctl's diagnostic capabilities with modern operational standards.
Table 2.Feature & Limitation Comparison Pre-proposal Milestone: Functional PoC & Prior ContributionsLocal Proof-of-Concept & BenchmarkingI have already developed a functional MVP featuring the Bubbletea TUI diagnostic pipeline and refactored ZK/Nacos adapters. Validated by baseline benchmarks, the core logic achieves an 82.2% unit test coverage, proving its immediate production readiness. Proof of Concept Repository: https://github.com/knyk-dev/gsoc26-seata-poc Prior ContributionsThrough patching key concurrency and networking bugs, I have familiarized myself with Seata-Go's internal architecture:
(#1053)
(#1081)
(#1091) Schedule of Deliverables (timeline)Week 1 -- Week 5 (Phase I: Registry Infrastructure Alignment)Week 1-2: Leveraging my local PoC to accelerate development, the initial phase focuses on migrating and hardening the ZK/Nacos adapters into the upstream apache/incubator-seata-go. Replace local data-race mitigations (developed during PoC phase) with standard Apache thread-safe watcher semantics. Week 3-4: Implementation of Consul and Redis adapters. Standardizing registry-specific config structures. Week 5: Integration with Seata NamingServer and bug fixing for Go-Java interoperability. Week 6 - Week 10 (Phase II: seata-ctl & Diagnostic Insight)Week 6-7: Core logic for the diagnose command (Environment self-check & DB structure validation). Week 8-9: Transaction state insight (XID queries & Resource lock inspection) via RPC. Week 10: TUI (Terminal UI) integration and user-friendly interaction polish. Week 11 - Week 12 (Hardening & Community Output)Week 11: Integration testing across MySQL/PostgreSQL and Stress testing for registry node changes. Week 12: Documentation, Technical Articles, and Final Evaluation. Deliverables (Quantifiable)
About MeZhifan Cui (github: https://github.com/knyk-dev)I am a Master's student in Computer Science at the University of Wollongong, passionate about open-source middleware and distributed transaction architectures. Current focus
Relevant Production Background
Prior Experience with Open SourceCross-language framework and infrastructure work
Selected commit history: Casbin: https://github.com/apache/casbin/commits?author=knyk-dev jCasbin: https://github.com/apache/casbin-jcasbin/commits?author=knyk-dev jCasbin DynamoDB adapter: https://github.com/apache/casbin-jcasbin-dynamodb-adapter/commits?author=knyk-dev Go ecosystem contributions
Why Incubator Apache Seata?
|
Beta Was this translation helpful? Give feedback.







Uh oh!
There was an error while loading. Please reload this page.
-
Hi Seata Community and Mentors,
My name is Zhifan Cui (GitHub: knyk-dev). I am writing to share my
GSoC 2026 proposal for GSOC-316: Enhance Seata-Go Multi-Registry
Support and seata-ctl Diagnostic Tool Capability.
To validate the architectural design, I have developed a
Proof-of-Concept (PoC) that implements the core Nacos/ZK adapters and
the TUI diagnostic pipeline with 82.2% unit test coverage. During this
exploration, I also contributed several patches to resolve underlying
data races and transaction lifecycle bugs in the main repository
(e.g., PRs #1081, #1083, #1091,#1053,#1070).
Proposal Link:
gsoc316_proposal.pdf
PoC Repository: https://github.com/knyk-dev/gsoc26-seata-poc
I would deeply appreciate any feedback, suggestions, or technical
critiques from the community to help me further refine the design.
Thank you for your time and the welcoming environment!
Best regards,
Zhifan Cui (knyk-dev)
Beta Was this translation helpful? Give feedback.
All reactions