bitflicker64 opened a new pull request, #3119:
URL: https://github.com/apache/hugegraph/pull/3119

   ## Summary
   
   Fixes #3118
   
   `InitStore` always runs full local backend/admin init. That is correct for 
standalone installs, but HStore / PD deployments need a way to no-op so Server 
can start and register without fighting local init.
   
   This PR reuses the existing `graph.load_from_local_config` option (already 
used by `GraphManager`) with **standalone-safe** semantics:
   
   | `rest-server.properties` | `init-store` |
   |--------------------------|--------------|
   | key **unset** (shipped defaults) | full init (same as master) |
   | explicit **`false`** | WARN, return, exit 0 |
   | explicit **`true`** | full init |
   
   Skip only when the property is present and false. Missing key does not skip 
(even though the option typed default is false for GraphManager).
   
   Docker maps `HG_SERVER_LOAD_FROM_LOCAL_CONFIG` into `rest-server.properties` 
when the env is set (same file `init-store.sh` passes to Java). Distributed / 
Helm can set the env to `false`.
   
   ## Changes
   
   - `InitStore.java`: early exit via `shouldSkipLocalInit` (`containsKey` then 
typed get)
   - `docker-entrypoint.sh`: env -> property on rest-server conf
   - `InitStoreConfigTest.java` + `UnitTestSuite`: unset / false / true
   
   ## In scope
   
   - Server `InitStore` gate and Docker env mapping
   - unit tests for the gate
   
   ## Out of scope
   
   - Helm chart, init Job, `HG_SERVER_SKIP_INIT`
   - `util.sh` / `check_port` / lsof (#3105)
   - changing `ServerOptions` default or GraphManager behavior
   
   ## Compatibility
   
   No break for bare tarball `bin/init-store.sh` with default config (key unset 
still full init).
   
   To skip in HStore / K8s: set `graph.load_from_local_config=false` or 
`HG_SERVER_LOAD_FROM_LOCAL_CONFIG=false`.
   
   ## Test plan
   
   ```bash
   # Java 11
   mvn test -pl hugegraph-server/hugegraph-test -am -P unit-test 
-Dtest=InitStoreConfigTest
   mvn test -pl hugegraph-server/hugegraph-test -am -P unit-test
   ```
   
   Manual (optional):
   
   1. Default conf, no flag: `bin/init-store.sh` still runs full init
   2. Set `graph.load_from_local_config=false`: WARN and exit 0 without backend 
init
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to