[doc] Add a tutorial for the Helix Gateway Service - #3164
Open
MarkGaox wants to merge 1 commit into
Open
Conversation
MarkGaox
marked this pull request as draft
August 10, 2026 22:02
The Gateway service is the main architectural addition in 2.0.0, but the 2.0.1 docs mentioned it only in passing: six word-mentions across two pages, no tutorial page, and no entry in the tutorial outline. Add tutorial_gateway.md, written from the helix-gateway source, link it from the tutorial outline, and add a short Gateway section with a topology figure to the README. The page describes the Gateway as an additional participation mode rather than a replacement. The 2.0.0 release notes call it "replacing the legacy state transition message approach", but helix-core carries no reference to the Gateway and no dependency on helix-gateway, so the controller cannot tell a Gateway-backed participant from any other and emits the same state transition messages either way. The Gateway joins through the ordinary participant API and registers a catch-all @transition handler, and the embedded participant API is not deprecated. What actually changes is where the Helix client and its ZooKeeper connection live. For the same reason the page avoids claiming the Gateway collapses ZooKeeper usage to a single connection. A HelixGatewayParticipant is created per connecting instance, and each one constructs its own ZKHelixManager and calls connect(), so N app nodes mean N connections consolidated into the Gateway process rather than eliminated, and the Gateway becomes a component whose availability affects every instance behind it. The page also covers the state transition translation rules, the gRPC contract, a client-side quick start, a 1.x-versus-2.0 comparison, channel configuration with its defaults, and the current limitations: OnlineOffline is the only supported state model and hybrid channel modes are unsupported. Three figures are included. They are referenced the way every other Helix page references images, which resolves against the generated site rather than the repository layout. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
MarkGaox
force-pushed
the
docs-v2-gateway-tutorial
branch
from
August 10, 2026 22:07
969e30f to
b7b8823
Compare
MarkGaox
marked this pull request as ready for review
August 10, 2026 22:09
Contributor
Author
|
@junkaixue @xyuanlu Could you please take a look? Thanks. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issues
No tracking issue — documentation-only change. Happy to file one if the project would prefer.
Description
What
Adds
website/2.0.1/src/site/markdown/tutorial_gateway.md, a tutorial page for the Helix Gateway Service, links it from the tutorial outline, and adds a short Gateway section with a topology figure to the README.Why
The Gateway service is the main architectural addition in 2.0.0, but the 2.0.1 docs mention it only in passing — six word-mentions across
tutorial_admin.mdandtutorial_rest_service.md, no tutorial page, and no entry in the tutorial outline.Contents
ADD_SHARD/DELETE_SHARD/CHANGE_ROLE), fromStateTransitionMessageTranslateUtil.HelixGatewayService.proto, and a client-side quick start mirroring the flow inTestGatewayServiceConnection.GatewayServiceChannelConfigoptions with their defaults.OnlineOfflineis the only supported state model (GatewayServiceManager.SUPPORTED_MULTI_STATE_MODEL_TYPES), and hybrid channel modes are unsupported.Two places where the page departs from the 2.0.0 release notes
Both were checked against the source and are stated below as findings, with the evidence, so a maintainer can see the reasoning rather than take my word for it. Flagging them because the release notes read differently — if either reflects intended future direction rather than current behaviour, tell me and I will reword.
1. The Gateway is an additional participation mode; it does not replace the message flow.
The release notes say the Gateway replaces "the legacy state transition message approach". The code shows the coordination model is unchanged:
helix-corecontains no reference to the Gateway at all —grep -ril gateway helix-core/src/main/java/returns nothing, andhelix-core/pom.xmlhas no dependency onhelix-gateway(the dependency runs the other way). The controller therefore cannot distinguish a Gateway-backed participant from any other; it emits the same state transition messages either way.HelixGatewayParticipant.Builder.build()callsparticipantManager.getStateMachineEngine().registerStateModelFactory(...)and thenparticipantManager.connect()(HelixGatewayParticipant.java:246-250) — the same callstutorial_participant.mddocuments.HelixGatewayMultiTopStateStateModelextendsStateModeland registers a catch-all@Transition(to = "*", from = "*")handler, which forwards toprocessStateTransitionMessage(Message)— a standard HelixMessage.HelixManagerFactory,InstanceType,StateModelFactoryandStateModelcarry no@Deprecatedannotation in 2.x.The page therefore presents the Gateway as an additional way to participate. Describing it as a replacement would imply 1.x participants are on a deprecation path, which the code does not support.
2. The Gateway holds one ZooKeeper connection per connected app node, so connections are consolidated rather than reduced.
GatewayServiceManager.ParticipantConnectionProcessor.run()callscreateHelixGatewayParticipant(clusterName, instanceName, …)on eachCONNECTevent (GatewayServiceManager.java:203-206), i.e. once per connecting application instance.Map<String, Map<String, HelixGatewayParticipant>>keyed by cluster then instance (GatewayServiceManager.java:58,:241).build()constructsnew ZKHelixManager(_clusterName, _instanceName, InstanceType.PARTICIPANT, _zkAddress)and callsconnect()(HelixGatewayParticipant.java:242,:250).So N connected app nodes produce N ZooKeeper connections, all held inside the Gateway process. The page and the figure are worded that way, and the page notes the sizing and availability consequences. The benefit still holds — application nodes carry no Helix dependency and open no ZooKeeper connection of their own — but it is a consolidation rather than a reduction.
A related detail: the release notes describe the service as using a poll-mode channel, whereas
GatewayServiceProcessorConfigBuilderdefaultsChannelModetoPUSH_MODE(GatewayServiceChannelConfig.java:159). The page documents both modes and states the default as push.Note on reviewing this page
Parts of this page look wrong in GitHub's file preview but are correct in the generated site. Three conventions used throughout
src/site/markdown/resolve against the generated site rather than the repository layout, and this page follows all three as the existing pages do:./images/…<head><title>…</title></head><title>./Tutorial.htmlTo view the three figures, open the PNGs under
website/2.0.1/src/site/resources/images/gateway/, or build the site. I chose not to duplicate the images intosrc/site/markdown/images/purely to satisfy the preview, but I am happy to change the approach if you would prefer.Tests
None — documentation only; no source under the
helix-*modules is touched.Not run; this change touches only
README.mdandwebsite/2.0.1/, which no test module covers.mvn sitehas also not been run, as Maven was unavailable in my authoring environment, so the rendered HTML is unverified. I did validate statically: balanced code fences, ASF licence header present for RAT,<head>/<title>and breadcrumb conventions matching sibling pages, well-formed tables, and every internal link and image reference resolving to a file that exists. A site build before merge would be worthwhile, and I am glad to fix anything it turns up.Changes that Break Backward Compatibility (Optional)
None. Documentation only.
Documentation (Optional)
This PR is the documentation change.
Commits
Code Quality
Not applicable — no Java source is modified.