Skip to content

chore: add TODO breadcrumbs for the Helm chart's server workarounds - #3260

Open
bitflicker64 wants to merge 1 commit into
apache:masterfrom
hugegraph:chore/helm-workaround-breadcrumbs
Open

bitflicker64 wants to merge 1 commit into
apache:masterfrom
hugegraph:chore/helm-workaround-breadcrumbs

Conversation

@bitflicker64

Copy link
Copy Markdown
Contributor

Purpose of the PR

The chart carries guards, probe derivations and runbook steps that compensate for server-side behavior rather than Kubernetes concerns. Each of those workarounds should disappear when the server behavior is fixed, and the only way a later change at the server site learns that is a comment at that site. This PR leaves one TODO per site, stating what is wrong or missing, what the proper fix does, and which chart guard is removed afterwards, linking the tracking issue where one exists.

Main Changes

Comments only, 13 sites, no behavior change:

Site Server behavior Chart workaround that goes once fixed Issue
AuthenticationFilter.java (Basic decode) credential decoded as ASCII and split on every colon: a non-ASCII password answers 401, a password with : answers 400, both accepted at account creation schema pattern and Server wrapper refuse such admin passwords none yet; measured on :latest 2026-10-03
AuthenticationFilter.java (FIXED_WHITE_API_SET) no unauthenticated /readiness until #3221 lands server.readinessPath defaults to /versions, /readiness is opt-in #3212
GraphManager.loadGraph a loaded graph is never offered to Gremlin Server after one failed static instantiation per-Pod Gremlin query in helm test, documented Pod deletion #3228
StoreAPI.checkHealthy /v1/health stays 200 in STATE_ERROR and with an unopened KV store single-PD startup and liveness derived to /v1/ready #3222, #3226
RaftStateMachine.onLeaderStop overwrites STATE_ERROR with STATE_FOLLOWER same #3222
StoreNodeService (registration) a re-registering Store is marked Up before its partition engines are restored Store rollouts on OnDelete with a manual /v1/shardGroups barrier #3229
HgStoreEngine.restoreLocalPartitionEngine restore outcome only logged same #3229
HgKVStoreImpl.init a held RocksDB LOCK leaves PD running uninitialized; nothing restarts it README limitation #3226
TaskAPI.balanceLeaders a follower answers an empty success; a run and a no-op look the same README task sequence and spacing #3231 part 2
StandardAuthManager.invalidatePasswordCache password and token caches invalidated on one replica only README limitation on admin password rotation none
ServerOptions.ADMIN_PA the initial admin password passes through a properties file (trimmed, backslash-unescaped, ISO-8859-1) schema and wrapper refuse padded, backslash and non-ASCII values none
docker-entrypoint.sh (env mapping) server.urls_to_pd, server.deploy_in_k8s, auth.admin_pa have no environment mapping the chart rewrites rest-server.properties in a wrapper and refuses readOnlyRootFilesystem for Server none
application-pd.yml (rocksdb.total_memory_size) 32 GB pinned, not overridable cluster preset sized around it, README note none

Two Hubble-side workarounds (the Hubble properties parser and the missing environment mapping for operations.pd.password) belong to hugegraph-toolchain and are not in this PR.

Verifying these changes

  • Trivial rework / code cleanup without any test coverage. (No Need)

Comments only. Lines stay within 100 characters.

Does this PR potentially affect the following parts?

  • Dependencies
  • Modify configurations
  • The public API
  • Other affects
  • Nope

Documentation Status

  • Doc - TODO
  • Doc - Done
  • Doc - No Need

The Helm chart under review in apache#3218 carries guards and runbook steps that
compensate for server-side behavior rather than Kubernetes concerns: ASCII
Basic-auth decoding and the colon split, a startup graph load that never
offers the graph to Gremlin Server, PD health that cannot see a raft error
or an unopened KV store, a Store marked Up before its partition engines are
restored, task routes that answer the same for a run and a no-op, a password
cache invalidated on one replica only, a pinned RocksDB memory ceiling, and
properties keys with no environment mapping.

Each site gets a TODO stating what is wrong or missing, what the fix does,
and which chart guard is removed afterwards, linking the tracking issue
where one exists. Comments only; no behavior change.
@codecov

codecov Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 41.58%. Comparing base (176fb56) to head (ff2b1d8).

Additional details and impacted files
@@            Coverage Diff            @@
##             master    #3260   +/-   ##
=========================================
  Coverage     41.57%   41.58%           
  Complexity     7311     7311           
=========================================
  Files           793      793           
  Lines         69106    69106           
  Branches       9258     9258           
=========================================
+ Hits          28730    28736    +6     
+ Misses        37098    37096    -2     
+ Partials       3278     3274    -4     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

bitflicker64 added a commit to hugegraph/hugegraph that referenced this pull request Oct 3, 2026
Answers the live validation and review on the chart PR.

helm test: keep the succeeded hook Pod so `helm test --logs` can read it;
require one complete clean sweep per attempt instead of carrying earlier
successes across retries; count one address family per Pod so a dual-stack
headless Service does not count each Pod twice. The CI fixture gains the
alternating-health and dual-stack counterexamples.

Credentials: the admin password contract is printable ASCII with no
backslash, colon or padding, enforced by the schema pattern and by the
Server wrapper on an existingSecret, because the Server decodes Basic auth
as ASCII and splits it on every colon. The Hubble PD-secret check and the
Server check are byte-wise under the C locale, so the image locale cannot
widen them.

Rollout checksums: a chart-generated Secret contributes the digest of its
value, generated once per render and memoised, so the install hashes the
value it writes and the first no-change upgrade renders the same checksum
and rolls nothing; that upgrade used to roll PD and Server together and
start Servers against a PD member mid-restart. Inline values keep their
digest, an operator-supplied existingSecret keeps its resourceVersion.

Identity: validateValues reads the live StatefulSets and refuses a changed
pd.ports.raft or store.ports.raft, a rename through nameOverride or
fullnameOverride, and a selector-label change, on an initialized release.
A NodePort or LoadBalancer Hubble Service needs
hubble.service.allowInsecureExposure=true, like PD.

README: settings-by-lifecycle table, rollback boundary with a post-rollback
check, template-only GitOps section; NOTES.txt warns when generated
credentials are in use and says to rerun helm test after an upgrade that
rolls PD and Server. Server-side root causes carry a TODO at their site in
apache#3260.

@imbajin imbajin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking: no. Summary: The TODOs identify real operational gaps, but several statements point to work already present or imply behavior the nearby code cannot provide. Evidence: exact-head source review, the companion chart source in PR #3218 and 22/22 latest-head checks passed.

fi

# ── Map env → properties file ─────────────────────────────────────────
# TODO: map server.urls_to_pd, server.deploy_in_k8s and auth.admin_pa from the environment here.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Blocking: no. Summary: This TODO says auth.admin_pa still needs an environment mapping, but this script already maps PASSWORD to auth.admin_pa at lines 175–176. The chart wrapper is also not the only read-only filesystem blocker because this entrypoint continues editing configuration through set_prop. Please remove auth.admin_pa from the missing list and clarify the remaining writable-configuration requirement. Evidence: the existing PASSWORD branch and set_prop calls in this file.

// offline or up, or in the initial activation list, go live automatically
// TODO: do not mark a re-registering Store Up before it has restored its partition engines
// (HgStoreEngine.restoreLocalPartitionEngine); report a restoring state, or expose
// restore-complete per shard group, so a rolling restart can wait on it. The Helm chart

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Blocking: no. Summary: The relative helm/hugegraph path is absent from this PR's tree, so readers cannot follow the rollout procedure from this revision. Please link the companion chart source or apache/hugegraph#3218, and update the other new helm/hugegraph references too. Evidence: helm/hugegraph is added only in the separate, still-open chart PR.

rocksdb:
# rocksdb total memory usage, force flush to disk when reaching this value
# TODO: make this overridable from the environment, or default it to 0 so AppConfig falls back
# to the JVM max heap: pinned at 32 GB, a Store in a container with a smaller memory limit is

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Blocking: no. Summary: The configured 32 GB is an LRUCache capacity, not memory allocated up front, so a smaller container limit does not by itself guarantee an OOM kill. Please say cache growth can exceed the container limit and cause OOM under load. Evidence: RaftRocksdbOptions passes total_memory_size as the capacities of two LRUCache instances.

public void onLeaderStop(final Status status) {
this.leaderTerm.set(-1);
// TODO: keep STATE_ERROR set by onError instead of overwriting it with STATE_FOLLOWER, so
// the probe view (and /v1/health, see StoreAPI.checkHealthy) can report a PD that stepped

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Blocking: no. Summary: Preserving STATE_ERROR here affects the probe view used by readiness, but StoreAPI.checkHealthy still returns 200 without consulting Raft state. Please scope this TODO to /v1/ready and point to the separate StoreAPI health TODO. Evidence: checkHealthy returns an empty string and its Javadoc says it does not read the Raft state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants