Skip to content

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

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

bitflicker64 wants to merge 2 commits into
apache:masterfrom
hugegraph:chore/helm-workaround-breadcrumbs

Conversation

@bitflicker64

@bitflicker64 bitflicker64 commented Oct 3, 2026 •

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, 14 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
docker-entrypoint.sh (encode_prop_value) a space is written as a backslash and a space, which Commons Configuration keeps, so an admin password with a space is applied with backslashes and the Secret value answers 401 schema and wrapper refuse admin passwords containing spaces none; measured on :latest 2026-10-03
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.59%. Comparing base (176fb56) to head (a12513b).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3260      +/-   ##
============================================
+ Coverage     41.57%   41.59%   +0.02%     
- Complexity     7311     7318       +7     
============================================
  Files           793      794       +1     
  Lines         69106    69127      +21     
  Branches       9258     9258              
============================================
+ Hits          28730    28753      +23     
- Misses        37098    37100       +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.

encode_prop_value escapes a space as a backslash and a space, which
Commons Configuration keeps, so an admin password containing a space is
stored with backslashes and the operator's value answers 401. The Helm
chart refuses such passwords until the encoder round-trips them.
bitflicker64 added a commit to hugegraph/hugegraph that referenced this pull request Oct 3, 2026
Admin password: the image entrypoint writes auth.admin_pa with each
space escaped as a backslash and a space, and Commons Configuration
keeps that backslash, so an accepted password containing a space was
applied with the backslashes and the Secret value answered 401. The
schema pattern and the Server wrapper now refuse any space, with a
message naming the cause. A CI step runs the rendered wrapper against
Secret values; the inner-space positive control becomes a must-fail.
The image-side TODO at encode_prop_value is in apache#3260.

NOTES: a template-only render now rolls the Pods on every sync (the
checksums hash the generated value); the warning said the opposite.

Server Service: a NodePort or LoadBalancer type publishes the plain
HTTP API, Basic credentials and JWTs included, and was accepted
silently. It now needs server.service.allowInsecureExposure=true, the
acknowledgement PD and Hubble already use.

@bitflicker64 bitflicker64 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Blocking: yes. Summary: The TODO text matches the code at each site I checked, apart from the four points already raised on ff2b1d8, which are still open at a12513b. One breadcrumb is in the wrong class: the password-cache TODO sits in StandardAuthManager, but a Server on the shared PD catalog (hstore) runs StandardAuthManagerV2, so a fix made where the TODO points leaves the chart's rotation limitation in place. Evidence: static review of the full diff at a12513b; StandardHugeGraph picks StandardAuthManagerV2 when isHstore(); the backslash-space claim in the new docker-entrypoint.sh TODO checked with commons-configuration2 2.8.0 (a value written as a\ b reads back with the backslash kept); 22/22 latest-head checks passed.

}

private void invalidatePasswordCache(Id id) {
// TODO: invalidate the password and token caches on every Server replica, not only on the

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Important: This TODO describes the shared PD catalog case, but that deployment does not run this class.

StandardHugeGraph (around line 281 at this head) builds new StandardAuthManagerV2(this.params) when isHstore() and StandardAuthManager only otherwise. The Helm chart's Server uses the hstore backend, so its password and token caches live in StandardAuthManagerV2, which has its own pwdCache, tokenCache and a separate invalidatePasswordCache(Id) (around line 254). Someone who follows this breadcrumb and fixes StandardAuthManager leaves the chart's admin password rotation limitation unchanged, and nothing at the V2 site tells them about it.

Requested change: put this TODO on StandardAuthManagerV2.invalidatePasswordCache. If you also want to keep it here, reword it for the non-PD case (several Servers sharing one backend such as HBase) so it does not claim the PD catalog path.

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