[client][rpc][server] Add getClusterVersion API to expose the server version - #4037
Open
morazow wants to merge 1 commit into
Open
[client][rpc][server] Add getClusterVersion API to expose the server version#4037morazow wants to merge 1 commit into
morazow wants to merge 1 commit into
Conversation
morazow
force-pushed
the
oss-3966-human-readable-version
branch
from
August 18, 2026 14:05
04d8bbf to
98af26a
Compare
morazow
marked this pull request as ready for review
August 18, 2026 14:07
morazow
force-pushed
the
oss-3966-human-readable-version
branch
2 times, most recently
from
August 18, 2026 18:40
fc17e0e to
f80d468
Compare
… server version Fluss clients today learn the protocol api_key/min/max numbers from apiVersions() but have no way to ask a cluster for its human-readable version (e.g. "0.10.0"). Adds: - VersionInfo (fluss-common): reads the version from a build-filtered fluss-version.properties resource (the Kafka AppInfoParser / Flink EnvironmentInformation pattern), falling back to "unknown" when the resource is missing or unreadable. A manifest-based lookup was rejected: it breaks under re-shading and NPEs under classloaders that skip definePackage. - GET_CLUSTER_VERSION RPC (api key 1065), implemented once in RpcServiceBase behind a DESCRIBE-on-cluster check, so both server types answer without a forwarding hop. - Admin#getClusterVersion(): CompletableFuture<String>. FlussAdmin routes it to the Coordinator, so the answer does not depend on which server a rolling upgrade happens to route the client to; servers that predate this API surface UnsupportedVersionException. - Closes the version half of the ServerConnection TODO that hardcoded the client's own reported software version as "0.1.0" (client_software_name remains hardcoded, still marked TODO). Fixes apache#3966.
morazow
force-pushed
the
oss-3966-human-readable-version
branch
from
August 18, 2026 18:43
f80d468 to
2ddf9dd
Compare
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.
PR description generated-by: Claude Code (Opus 5), following the guidelines
Purpose
Linked issue: close #3966
Clients can learn a cluster's protocol surface from
apiVersions()(api_key / min / max versionnumbers), but there is no way to ask a cluster for its human-readable release version, e.g.
0.10.0. Anything that needs to branch on the deployed version - upgrade checks, supportdiagnostics, compatibility gates in downstream connectors - has nothing to read.
This adds a
GET_CLUSTER_VERSIONRPC and surfaces it asAdmin#getClusterVersion().It also closes the version half of the
ServerConnectionTODO that hardcoded the client's ownreported software version as
"0.1.0".client_software_nameremains hardcoded and is stillmarked TODO.
Brief change log
VersionInfo(fluss-common) reads the version from a build-time-filteredfluss-version.propertiesresource, falling back to"unknown"when the resource is missingor unreadable. This is the pattern Kafka's
AppInfoParserand Flink'sEnvironmentInformationuse, including reading it once into a static rather than per call.The resource lives at
org/apache/fluss/utils/and is read with a package-relative name, sotwo Fluss jars of different versions on one classpath cannot resolve each other's copy, and
the lookup follows the class if a downstream shade relocates
org.apache.fluss.A manifest-based lookup was rejected: it breaks under re-shading and NPEs under classloaders
that skip
definePackage.GET_CLUSTER_VERSIONRPC (api key 1065), implemented once inRpcServiceBasebehind aDESCRIBE-on-cluster authorization check, so both server types answer it without a forwarding
hop.
Admin#getClusterVersion()returningCompletableFuture<String>.FlussAdminroutes itto the Coordinator, so the answer does not depend on which server a rolling upgrade happens
to route the client to.
ServerConnectionnow reports the real client version inApiVersionsRequest.Tests
VersionInfoTest#testGetVersionReadsTheFilteredProjectVersion- asserts the resolved projectversion rather than the
"unknown"fallback. This also guards the resource path and theMaven filtering config: a wrong path yields
"unknown", and unfiltered resources yield theliteral
${project.version}.VersionInfoTest#testGetVersionIsReadOnceAndCached- guards the caching.Properties.loadreturns a fresh
Stringper read, so this fails if the resource is re-read per call.FlussAdminITCase#testGetClusterVersion- end-to-end round trip through the RPC.FlussAuthorizationITCase#testGetClusterVersion- the unauthorized call fails with theDESCRIBE-on-cluster message, then succeeds once the ACL is granted.
Both ITCases additionally assert the version is not
"unknown"and matches^\d+\.\d+.*, sothey cannot pass vacuously when the server and client share a classpath where resource
filtering never ran.
API and Format
Yes, this adds public API:
PUBLICapi keyGET_CLUSTER_VERSION(1065), withGetClusterVersionRequest/GetClusterVersionResponsemessagesAdmin#getClusterVersion()Wire-compatible: the api key is new, so servers that predate it complete the client's future
exceptionally with
UnsupportedVersionException. No existing message changed, and there is nostorage format change.
Documentation
website/docs/security/authorization.mdgains theGET_CLUSTER_VERSION | DESCRIBE | Clusterrow alongside the other cluster-scoped DESCRIBE protocols.