Skip to content

Check BanyanDB server compatibility against the API versions the OAP supports in code - #14267

Merged
wu-sheng merged 1 commit into
masterfrom
feat/banyandb-api-version-compatibility
Nov 25, 2026
Merged

wu-sheng merged 1 commit into
masterfrom
feat/banyandb-api-version-compatibility

Conversation

@wu-sheng

Copy link
Copy Markdown
Member

Check BanyanDB server compatibility against the API versions the OAP supports in code

  • If this is non-trivial feature, paste the links/URLs to the design doc. The design is below.
  • Update the documentation to include this new feature.
  • Tests(including UT, IT, E2E) are added to verify the new feature. Two unit-test classes are added; the existing ITs and e2e cases boot against a server reporting 0.11.
  • If it's UI related, attach the screenshots below.

A BanyanDB server reports its API version, and several BanyanDB releases share one: 0.11.0, 0.11.1 and 0.11.2 report 0.11, and the coming 0.12 release keeps API 0.11, so it works with the OAP as V0_11. Until now the OAP accepted whatever versions compatibleServerApiVersions listed, with no code that knew what a version means. A new API version usually adds a field or a type, so the OAP has to know, in code, which API version a request needs and whether the connected server works with it.

Design

  • BanyanDBAPIVersion (client library) lists the API versions the OAP's code is written for, oldest first: V0_11 and V0_13. Each version lists the server API versions its code works with: V0_11 works with servers reporting 0.11 or 0.13, V0_13 with 0.13. isCompatibleWith(serverAPIVersion) is the one check.
  • Boot: code without a version check is written for the oldest version, so the OAP boots only against a server the oldest version works with. Anything else fails as before: Incompatible BanyanDB server API version: 0.x. Supported versions: 0.11, 0.13.
  • BanyanDBClient#verifyServerAPIVersion reads the server's version, checks the version the OAP works as (the server's, or a forced one), and records it as getServerAPIVersion(). Code that uses something a newer API adds branches on V0_13.isCompatibleWith(client.getServerAPIVersion()) and keeps a path for older servers.
  • @APISince(V0_13) marks such code: a request field, an enum value, a message type or an RPC a version introduced.
  • A new BanyanDB API version is reviewed against every existing version: each one that still works with it lists it. A new constant is added only when the OAP starts to use what the new API adds.

No code uses API 0.13 yet: this PR adds the mechanism and the V0_13 entry, so the first 0.13 feature only needs its branch and annotation. Because V0_11 lists 0.13, the OAP already boots against a server reporting 0.13.

Settings

  • compatibleServerApiVersions (SW_STORAGE_BANYANDB_COMPATIBLE_SERVER_API_VERSIONS) is removed: it could list versions the OAP has no code for. A server reporting another API version, such as 0.10, no longer boots even if the setting listed it. A bydb.yml that still sets it boots, with the loader's setting is not supported warning; the environment variable alone is ignored.
  • For debugging only, the environment variable SW_STORAGE_BANYANDB_FORCE_SERVER_API_VERSION makes the OAP work as a supported version, whatever version the server reports (e.g. 0.13 against a BanyanDB development build that has API 0.13's additions but still reports 0.11). It is not in bydb.yml; the OAP logs a warning at boot while it is set, and an unsupported value fails the boot.

Follow-up

  • @wankai123 the showcase still sets SW_STORAGE_BANYANDB_COMPATIBLE_SERVER_API_VERSIONS: "0.10,0.11" in deploy/platform/kubernetes/values.yaml. This PR removes that setting, so the line can go when the showcase moves to an OAP with this change.

Verified

  • Unit tests: the version lists' rules (each version works with its own servers, none lists a server older than itself, every listed server is one the oldest version works with, declared oldest first), and verifyServerAPIVersion against a fake server (supported, unsupported, forced, forced unsupported).

  • Against real servers (ghcr.io/apache/skywalking-banyandb:8efdf0ca…, the e2e commit, and apache/skywalking-banyandb:0.11.1): both report 0.11 and are accepted; forcing 0.13 works as 0.13; forcing 0.14 fails with Incompatible BanyanDB API version: 0.14, forced in place of the server's 0.11. Supported versions: 0.11, 0.13.

  • If this pull request closes/resolves/fixes an existing issue, replace the issue number. Closes #.

  • Update the CHANGES log.

  • GraalVM distro impact:

    • None.
    • Impacted, by: a module, provider or config class. BanyanDBStorageConfig.Global loses its compatibleServerApiVersions field, so the distro's generated YamlConfigLoaderUtils, which calls setCompatibleServerApiVersions, is regenerated at its next sync. The force variable is read with System.getenv at connect time, not in a static initializer, so the native image reads it at run time.

…supports in code

The OAP now knows the BanyanDB API versions it supports, 0.11 and 0.13, in the
client library's BanyanDBAPIVersion enum. Each version lists the server API
versions its code works with; the OAP boots only against a server the oldest
version works with, and records the version it works as (the server's, or a
forced one) on the client (BanyanDBClient#getServerAPIVersion), so code can branch on
V0_13.isCompatibleWith(serverAPIVersion) once it uses something a newer API adds.
The @APISince annotation marks such code.

The compatibleServerApiVersions setting (SW_STORAGE_BANYANDB_COMPATIBLE_SERVER_API_VERSIONS)
is removed: it could list versions the OAP has no code for. For debugging only,
the environment variable SW_STORAGE_BANYANDB_FORCE_SERVER_API_VERSION makes the
OAP work as one of the supported versions, whatever version the server reports.
@wu-sheng
wu-sheng requested a review from wankai123 November 25, 2026 13:59
@wu-sheng wu-sheng added this to the 11.2.0 milestone Nov 25, 2026
@wu-sheng wu-sheng added backend OAP backend related. enhancement Enhancement on performance or codes labels Nov 25, 2026
@wu-sheng
wu-sheng merged commit cb63210 into master Nov 25, 2026
546 of 550 checks passed
@wu-sheng
wu-sheng deleted the feat/banyandb-api-version-compatibility branch November 26, 2026 00:07
wu-sheng added a commit to apache/skywalking-graalvm-distro that referenced this pull request Nov 26, 2026
…-debugging module (#53)

* Sync upstream to cb632100a5: TAL live debugging and the trace-pairing-debugging module

The skywalking submodule moves 8 commits past 4bb9a61839 to cb632100a5.

- TAL rules are live-debuggable (apache/skywalking#14265). Upstream's TAL compiler emits the debug probes when the
  codegen switch is on, which the precompiler turns on before every pass, so every pre-compiled TAL class carries
  its debug holder and probes; dsl-debugging runs TAL sessions and the /runtime/tal/* listing as it is.
- Accept and wire the new trace-pairing-debugging admin module (poms, AcceptedModules, provider inventory,
  application.yml, regenerated config loader).
- /runtime/rule/bundled refuses oal and tal with 400 invalid_catalog, as upstream now does for a catalog no
  runtime-rule engine claims; the parity test takes the served catalogs from upstream's MAL and LAL engines.
- BanyanDBStorageConfig.Global loses compatibleServerApiVersions (apache/skywalking#14267); regenerate the loader.
- otel-rules/oap.yaml and redis-instance.yaml change upstream (apache/skywalking#14264, #14258); OapTest feeds the
  new OTLP protocols and drop reasons, and the rule and source pins are refreshed.
- Adopt upstream's dsl-debugging/tal-native and tal-otlp e2e cases; the dsl-debugging status fixture gains
  upstream's catalogs list; the e2e runner follows upstream's pin 8bb8499.
- Docs and changelog describe TAL debugging and the new module.

* Run upstream's cluster-paging e2e on two native replicas in a kind cluster

Upstream runs dsl-debugging/cluster-paging on two ZooKeeper-coordinated containers. The distro runs it as
dsl-debugging-cluster-paging on two native replicas on the Kubernetes coordinator, as otlp-traces-cluster does:
upstream's span emitter sends to the first pod, and upstream's flow script reads through the second, with its two
node names (oap1 / oap2) replaced by the pods' IPs, as the Kubernetes coordinator names the nodes; the wrapper fails
when upstream renames them. It is the distro's only e2e of the admin-internal gRPC bus between nodes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend OAP backend related. enhancement Enhancement on performance or codes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants