Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,12 @@ public Metapb.Store register(Metapb.Store store) throws PDException {
}

// 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.

// (helm/hugegraph) keeps Store rollouts on OnDelete with a manual /v1/shardGroups barrier
// between Pod deletions; retire that procedure once PD reports restoration.
// https://github.com/apache/hugegraph/issues/3229
Metapb.StoreState storeState = lastStore.getState();
if (storeState == Metapb.StoreState.Offline || storeState == Metapb.StoreState.Up
|| inInitialStoreList(store)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,11 @@ public void onLeaderStart(final long term) {
@Override
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.

// down for good after a snapshot failure. The Helm chart (helm/hugegraph) works around the
// missing signal with pd.livenessPath on /v1/ready for a single PD.
// https://github.com/apache/hugegraph/issues/3222
this.probeView = new ProbeView(State.STATE_FOLLOWER, false);
super.onLeaderStop(status);
log.info("Raft lost leader ");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ public void init(PDConfig config) {
}
openRocksDB(dbPath);
} catch (PDException e) {
// TODO: retry the open and then fail PD startup instead of logging: a held RocksDB LOCK
// leaves this PD running uninitialized (/v1/ready answers 503 STATE_UNINITIALIZED
// while /v1/health answers 200), and with several PDs nothing restarts it. The Helm
// chart (helm/hugegraph) documents this as a limitation; drop that entry once fixed.
// https://github.com/apache/hugegraph/issues/3226
log.error("Failed to open data file,{}", e);
} finally {
writeLock.unlock();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,12 @@ class StoreStatistics {
* @return Returns a string indicating the service's health status. Typically, an empty
* string indicates the service is healthy.
*/
// TODO: answer non-200 when the raft state machine is in STATE_ERROR (a failed snapshot) or
// the KV store never opened (a held RocksDB LOCK): both leave this PD unable to recover while
// /health stays 200 forever. The Helm chart (helm/hugegraph) derives a single PD's startup
// and liveness probes to /v1/ready for this reason; drop that derivation once this reports it.
// https://github.com/apache/hugegraph/issues/3222
// https://github.com/apache/hugegraph/issues/3226
@GetMapping(value = "/health", produces = MediaType.TEXT_PLAIN_VALUE)
public Serializable checkHealthy() {
return "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ public String splitPartitions() {
}
}

// TODO: make the task routes tell a real run from a no-op and a follower answer (a follower
// returns an empty success without doing anything), and return a body that names what was
// scheduled. Part 1 (#3233) replaced the bare 500 with a refusal body; this is part 2. The
// Helm chart (helm/hugegraph) documents the leader-first sequence and the 180 s spacing in its
// README until then.
// https://github.com/apache/hugegraph/issues/3231
@GetMapping(value = "/balanceLeaders", produces = MediaType.APPLICATION_JSON_VALUE)
@ResponseBody
public String balanceLeaders() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ public class AuthenticationFilter implements ContainerRequestFilter, ContainerRe
private static final Logger LOG = Log.logger(AuthenticationFilter.class);

private static final AntPathMatcher MATCHER = new AntPathMatcher();
// TODO: add the unauthenticated /readiness probe (#3221) here once it lands. The Helm chart
// (helm/hugegraph) defaults server.readinessPath to /versions, which stays 200 with zero
// Stores, and offers /readiness as an opt-in; flip that default when this set grows.
// https://github.com/apache/hugegraph/issues/3212
private static final Set<String> FIXED_WHITE_API_SET = ImmutableSet.of(
"versions",
"openapi.json"
Expand Down Expand Up @@ -180,6 +184,11 @@ protected User authenticate(ContainerRequestContext context) {

if (auth.startsWith(BASIC_AUTH_PREFIX)) {
auth = auth.substring(BASIC_AUTH_PREFIX.length());
// TODO: decode the Basic credential as UTF-8 and split it on the first colon only.
// Decoding as ASCII and splitting on every colon makes a non-ASCII password answer
// 401 and a password containing ':' answer 400, although both were accepted at
// account creation. The Helm chart (helm/hugegraph) refuses such admin passwords in
// its schema and Server wrapper; drop that guard once this is fixed.
auth = new String(DatatypeConverter.parseBase64Binary(auth), Charsets.ASCII_CHARSET);
String[] values = auth.split(":");
if (values.length != 2) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,11 @@ public class ServerOptions extends OptionHolder {
""
);

// TODO: accept the initial admin password from the environment (or document the properties
// contract): read through PropertiesConfiguration, the value is trimmed, backslash-unescaped
// and decoded as ISO-8859-1, so the stored password can differ from what the operator set.
// The Helm chart (helm/hugegraph) refuses padded, backslash or non-ASCII admin passwords in
// its schema and Server wrapper; relax that guard once the credential bypasses the file.
public static final ConfigOption<String> ADMIN_PA =
new ConfigOption<>(
"auth.admin_pa",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1820,6 +1820,13 @@ private String defaultSpaceGraphName(String graphName) {
}

private void loadGraph(String name, String graphConfPath) {
// TODO: offer a loaded graph to Gremlin Server (notify GRAPH_CREATE, as the create paths
// do) or fail startup when its static Gremlin instantiation failed. Today a Server whose
// first open failed against a PD member mid-restart serves REST and passes readiness
// while every Gremlin call on it fails for the life of the process. The Helm chart
// (helm/hugegraph) detects this with a per-Pod Gremlin query in `helm test` and documents
// the manual Pod deletion; retire both once this is fixed.
// https://github.com/apache/hugegraph/issues/3228
HugeConfig config = new HugeConfig(graphConfPath);

// Transfer `raft.group_peers` from server config to graph config
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@ private void invalidateUserCache() {
}

private void invalidatePasswordCache(Id id) {
// TODO: invalidate the password and token caches on every Server replica, not only on the
// one that handled updateUser; with a shared PD catalog the other replicas accept the old
// password until auth.cache_expire elapses. The Helm chart (helm/hugegraph) documents the
// per-replica expiry as a limitation of admin password rotation; drop it once fixed.
this.pwdCache.invalidate(id);
// Clear all tokenCache because can't get userId in it
this.tokenCache.clear();
Expand Down
4 changes: 4 additions & 0 deletions hugegraph-server/hugegraph-dist/docker/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@ if [[ -n "${PASSWORD:-}" && -z "${HG_SERVER_AUTH_TOKEN_SECRET:-}" ]]; then
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.

# Without them the Helm chart (helm/hugegraph) rewrites rest-server.properties in a wrapper before
# exec'ing this script, which is why it refuses readOnlyRootFilesystem for Server; drop that
# wrapper once these keys have an env mapping.
[[ -n "${HG_SERVER_BACKEND:-}" ]] && set_prop "backend" "${HG_SERVER_BACKEND}" "${GRAPH_CONF}"
[[ -n "${HG_SERVER_PD_PEERS:-}" ]] && set_prop "pd.peers" "${HG_SERVER_PD_PEERS}" "${GRAPH_CONF}"
[[ -n "${HG_SERVER_USE_PD:-}" ]] && \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,11 @@ public void stateChanged(Store store, Metapb.StoreState oldState, Metapb.StoreSt
* 1. Need to check the partition saved this time, delete the invalid partitions.
*/
public void restoreLocalPartitionEngine() {
// TODO: surface the outcome of this restore (a per-group ready signal, or a failed state
// reported to PD) instead of logging only; a Store is marked Up before this runs and a
// failed restore leaves it Up with missing shard groups. Paired with the TODO in
// StoreNodeService; the Helm chart's manual Store roll barrier depends on it.
// https://github.com/apache/hugegraph/issues/3229
try {
if (!options.isFakePD()) { // FakePD mode does not require synchronization
partitionManager.syncPartitionsFromPD(partition -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ management:

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.

# OOM-killed by native caches outside the heap. The Helm chart (helm/hugegraph) can only
# document the ceiling and size its cluster preset around it until then.
total_memory_size: 32000000000
# memtable size used by rocksdb
write_buffer_size: 32000000
Expand Down
Loading