Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
362e27e
feat(dist): make conf/logs/plugins/pid paths overridable and fix log4…
AvanishShukla20 Sep 29, 2026
526bf2e
feat(scripts): Added plugins override, fix store restart, monitor, ca…
AvanishShukla20 Oct 2, 2026
e272e27
fix(scripts): harden path overrides and quote cron monitor command
AvanishShukla20 Oct 8, 2026
6ecc85e
Merge remote-tracking branch 'upstream/master' into conf+logs+plugins…
AvanishShukla20 Oct 12, 2026
6052186
Merge remote-tracking branch 'upstream/master' into conf+logs+plugins…
AvanishShukla20 Oct 20, 2026
860ec0f
fix(scripts): quote-safe JVM launchers, relative-path guards, nocreat…
AvanishShukla20 Oct 20, 2026
4d633ec
fix: restore fixture util.sh contracts and close config override gaps
AvanishShukla20 Oct 23, 2026
3e78d09
fix(scripts): harden Store/PD/Server path overrides and JVM option ha…
AvanishShukla20 Oct 23, 2026
53cba6c
fix(scripts): cover path resolution gaps in launcher scripts and cron…
AvanishShukla20 Oct 26, 2026
1217922
Fix crontab lock sharing/silent-failure and monitor key substring col…
AvanishShukla20 Oct 27, 2026
1d42786
docs(launcher overrides): Document -c/-l/-i/-o launcher overrides
AvanishShukla20 Oct 27, 2026
fd066d0
Merge remote-tracking branch 'upstream/master' into conf+logs+plugins…
AvanishShukla20 Nov 11, 2026
7791441
fix(scripts): open crontab lock fd in current shell, not a subshell
AvanishShukla20 Nov 11, 2026
36dbdf6
fix(ci,docs): run PdConfigureListenerYamlTest in CI, fix telemetry ch…
AvanishShukla20 Nov 12, 2026
91f5ef8
fix(dist): resolve PD/Store/Server concerns and cover identified gaps
AvanishShukla20 Nov 20, 2026
f627f3e
fix(dist): scope config:/tokens: check, add stock-yaml fixture, tag d…
AvanishShukla20 Nov 20, 2026
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
4 changes: 3 additions & 1 deletion .github/workflows/pd-store-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ jobs:
set -o pipefail
RUNTIME_LOG=$(mktemp "$RUNNER_TEMP/java-runtime.XXXXXX")
mvn test -pl hugegraph-store/hg-store-node -am \
-Dtest=StoredRowIngressTest,ArthasSecurityTest,HgStoreMetricsControllerTest \
-Dtest=StoredRowIngressTest,ArthasSecurityTest,HgStoreMetricsControllerTest,PdConfigureListenerYamlTest \
-Dsurefire.failIfNoSpecifiedTests=false \
-Djacoco.sessionId=store-node-test \
-Djacoco.destFile="$PWD/hugegraph-store/hg-store-test/target/store-node-test.exec" 2>&1 | tee "$RUNTIME_LOG"
Expand Down Expand Up @@ -492,6 +492,8 @@ jobs:
"hugegraph-store/hg-store-node/target/surefire-reports/TEST-org.apache.hugegraph.store.business.StoredRowIngressTest.xml" \
--require-test-report \
"hugegraph-store/hg-store-node/target/surefire-reports/TEST-org.apache.hugegraph.store.node.controller.ArthasSecurityTest.xml" \
--require-test-report \
"hugegraph-store/hg-store-node/target/surefire-reports/TEST-org.apache.hugegraph.store.node.listener.PdConfigureListenerYamlTest.xml" \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Important: test-check-jacoco-report.sh asserts the exact set of --require-test-report files for the store job, which still lists 8, so this ninth entry fails its aggregation contract and the Run JaCoCo report validator tests step of pd_store / store exits 1 at this head. Add TEST-org.apache.hugegraph.store.node.listener.PdConfigureListenerYamlTest.xml to that expected set.

--require-covered-group hg-store-common \
--require-covered-group hg-store-client \
--require-covered-group hg-store-rocksdb \
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/server-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,17 @@ jobs:
fi
echo "can_run=true" >> "$GITHUB_OUTPUT"

- name: Run path-override guard and quoting unit tests
if: ${{ env.BACKEND == 'rocksdb' }}
run: |
# Pure bash harnesses: no JVM/cluster/real crontab needed (crontab is
# stubbed).
SHELL_TEST_DIR=hugegraph-server/hugegraph-dist/src/test/shell
bash "$SHELL_TEST_DIR/test-canonicalize.sh"
bash "$SHELL_TEST_DIR/test-cron-quote.sh"
bash "$SHELL_TEST_DIR/test-override-guards.sh"
bash "$SHELL_TEST_DIR/test-launcher-argv.sh"

- name: Run start-hugegraph.sh foreground mode tests
if: ${{ env.BACKEND == 'rocksdb' && steps.server-preflight.outputs.can_run == 'true' }}
run: |
Expand Down
50 changes: 50 additions & 0 deletions docs/server-runtime.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,56 @@ bootstrap before Server accepts Gremlin requests. This does not initialize the p
for every future Store target. Unit checks that obtain a stub verify lazy pool
construction; a successful RPC and its readback are separate runtime checks.

### Launcher path overrides

`bin/start-hugegraph.sh` accepts four path overrides. The override flags also work in
`bin/init-store.sh` (`-c`/`-o`), `bin/stop-hugegraph.sh` (`-i`) and the monitor
cron job installed by `-m true`, so stop/restart/monitor stay consistent with
the paths `bin/start-hugegraph.sh` used.

| Flag | Meaning | Default (when omitted) |
|---|---|---|
| `-c <dir>` | Conf directory | `$TOP/conf` |
| `-l <dir>` | Logs directory | `$TOP/logs` |
| `-i <file>` | PID file | `$BIN/pid` |
| `-o <dir>` | Plugins directory | `$TOP/plugins` |

`$TOP` is the distribution's install root (the parent of `bin/`); `$BIN` is
`$TOP/bin`.

Relative values are resolved to absolute paths before use: `-l` and `-o` name
directories the launcher writes into, so a relative or missing directory is
created; `-c` is only ever read, so a relative value is resolved without
creating anything, and a missing `-c` directory is a startup error. `-i`'s
parent directory is created by `start-hugegraph.sh`,
matching `-l`/`-o`; `stop-hugegraph.sh` and the monitor cron job resolve the
same `-i` path read-only, without creating it, so a missing PID file or
parent at stop time is a lookup error rather than being created.
A value for `-c` must still be an existing path once resolved — the launcher
does not create the external conf dir for you unless it already exists.

Avoid `:`, `;`, `%`, and embedded CR/LF characters in any of these four paths:
`-o` is joined into a `:`-separated CLASSPATH (and `;`-separated on Cygwin), so
a `:`/`;` in that path corrupts the classpath; `%` is reserved by cron and is
rejected whenever `-m true` persists these paths into a crontab line; CR/LF is
always rejected. The launcher validates each path both before and after
resolving a relative value to an absolute one, since resolution against the
working directory can itself introduce a problem character that was not in
the original value.

When `-c` points at an external conf directory, keep `graphs` in

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Important: CypherAPI loads the fixed relative path conf/remote-objects.yaml from $TOP, so under -c the Cypher client keeps the packaged Gremlin host and port, and a second instance with its own Gremlin port sends Cypher queries to the first instance. Load remote-objects.yaml from the -c conf dir, as PdConfigureListener does for Store's application-pd.yml.

`rest-server.properties`, `ssl.keystore_file` (when `restserver.url` is
`https`), and `tokens` under `gremlin-server.yaml`'s `config:` block (written
by `enable-auth.sh`) as absolute paths, or under that `-c` directory. All
three are otherwise resolved by the JVM against the working directory
(`$TOP`).

The Cypher endpoint's `conf/remote-objects.yaml` (the Gremlin host/port it
connects to) is resolved from the `-c` conf dir when set, instead of always
reading the packaged copy relative to `$TOP`; otherwise a second instance
started with its own `-c`/Gremlin port would still have its Cypher queries
routed to the first instance's Gremlin server.

### Launcher GC options

Use `bin/start-hugegraph.sh -g g1` (or `-g G1`) to select G1 explicitly.
Expand Down
6 changes: 6 additions & 0 deletions hugegraph-pd/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ mvn test -pl hugegraph-pd/hg-pd-test -am
- Test profiles in the [parent POM](pom.xml) activate matching Surefire executions;
suite selection is configured in the [test POM](hg-pd-test/pom.xml).
- Service setup: [PD/Store CI](../.github/workflows/pd-store-ci.yml).
- `start-hugegraph-pd.sh`/`stop-hugegraph-pd.sh` share the `-c/-l/-o/-i` launcher
guards and crontab helpers with Server; run Server's
`bash hugegraph-server/hugegraph-dist/src/test/shell/test-cron-quote.sh` and
`test-override-guards.sh` locally after changing this module's
`hg-pd-dist/.../bin/util.sh`, since they also validate PD's copy. Server's CI
already runs both for every PR (see [server-tests.yml](../.github/workflows/server-tests.yml)).

## Cross-module traps

Expand Down
17 changes: 16 additions & 1 deletion hugegraph-pd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,21 @@ bin/stop-hugegraph-pd.sh
#### Startup Options

```bash
bin/start-hugegraph-pd.sh [-g GC_TYPE] [-j "JVM_OPTIONS"] [-y ENABLE_OTEL] [-d DAEMON]
bin/start-hugegraph-pd.sh [-c CONF_DIR] [-l LOGS_DIR] [-i PID_FILE] [-o PLUGINS_DIR] \
[-g GC_TYPE] [-j "JVM_OPTIONS"] [-y ENABLE_OTEL] [-d DAEMON]
```

- `-c`: Conf directory (default: `conf` under the install root). Resolved to an
absolute path if relative; must already exist (it is read, never created).
- `-l`: Logs directory (default: `logs` under the install root). Resolved to an
absolute path if relative; created if missing.
- `-i`: PID file (default: `bin/pid` under the install root). Resolved to an
absolute path if relative; its parent directory is created if missing by
`start-hugegraph-pd.sh`. `stop-hugegraph-pd.sh` resolves the same `-i` path
read-only, without creating it.
- `-o`: Plugins directory (default: `plugins` under the install root). Resolved
to an absolute path if relative; created if missing. Its contents are joined
into a `:`-separated CLASSPATH, so avoid `:`/`;` in this path.
- `-g`: Explicit GC selection (`g1`/`G1` or `zgc`/`ZGC`). Without `-g`, JVM defaults or the collector
set in `JAVA_OPTIONS` apply. Explicit `-g g1` selects G1 even when JVM ergonomics would choose Serial GC;
unknown values are rejected. When using explicit `-g`, do not select another collector in `JAVA_OPTIONS`
Expand All @@ -91,6 +103,9 @@ bin/start-hugegraph-pd.sh [-g GC_TYPE] [-j "JVM_OPTIONS"] [-y ENABLE_OTEL] [-d D
- `-y`: Enable OpenTelemetry tracing (`true` or `false`, default: `false`)
- `-d`: Daemon mode (`true` = daemon, `false` = foreground; default: `true`). Set to `false` when running under Docker or a process supervisor so the container exits if Java dies.

`-c`/`-l`/`-i`/`-o` must avoid embedded CR/LF characters; `stop-hugegraph-pd.sh`
accepts the same `-i` so it can locate the PID file a non-default `start` wrote.

The launcher always loads `bin/jvm-module.options`, including with custom `JAVA_OPTIONS` or `-j`.
Keep this file in the distribution: it grants the Java 17 access required by Hessian Raft serialization;
startup fails if the file is missing or unreadable. Direct Java launches must include `@bin/jvm-module.options`.
Expand Down
Loading
Loading