bitflicker64 commented on code in PR #3119:
URL: https://github.com/apache/hugegraph/pull/3119#discussion_r3699329372
##########
hugegraph-server/hugegraph-dist/docker/docker-entrypoint.sh:
##########
@@ -68,15 +86,27 @@ if [[ ! -f "${DOCKER_FOLDER}/${INIT_FLAG_FILE}" ]]; then
./bin/wait-storage.sh
fi
+ # init-store writes the marker itself, and only if it initialized. Deciding
+ # here would mean guessing from the environment variable, which says
+ # nothing about a config mounted with the property already set.
+ export HG_SERVER_INIT_COMPLETE_MARKER="${DOCKER_FOLDER}/${INIT_FLAG_FILE}"
Review Comment:
Fixed in edf07d0. The entrypoint now runs `init-store` on every startup and
only hands it the marker path (absolute now); the marker check moved into
`InitStore`, after the disabled gate, so an existing marker can only skip
re-initialization — never `checkAdminBootstrapReachable`. An enabled run
returns at the marker before backend registration and stdin, so the restart
branch needs neither `wait-storage` nor `PASSWORD`. Upgrade regressions:
`testExistingMarkerDoesNotBypassDisabledPathCheck` and
`testExistingMarkerSkipsReinitializationWhenEnabled`.
##########
hugegraph-server/hugegraph-dist/src/main/java/org/apache/hugegraph/cmd/InitStore.java:
##########
@@ -51,11 +65,31 @@ public static void main(String[] args) throws Exception {
String restConf = args[0];
- RegisterUtil.registerBackends();
- RegisterUtil.registerPlugins();
+ // Server options alone can answer the gate below. Backend and plugin
+ // registration waits for the enabled path, because registerPlugins()
+ // runs every plugin's register() and propagates its failures.
RegisterUtil.registerServer();
HugeConfig restServerConfig = new HugeConfig(restConf);
+
+ /*
+ * PD/HStore deployments let the storage side own the metadata, so
+ * init-store has nothing to do; on Kubernetes it re-ran on every
Server
+ * pod restart, since the entrypoint's flag file does not survive one.
+ * Skipping also skips creating the built-in admin, which only the PD
+ * startup path can replace, and only for a PD-backed HStore auth
graph.
+ */
+ if (!restServerConfig.get(ServerOptions.INIT_STORE_ENABLED)) {
+ LOG.warn("Skipping init-store: '{}' is false in '{}'. Local " +
+ "backend and admin initialization are not performed.",
+ ServerOptions.INIT_STORE_ENABLED.name(), restConf);
+ checkAdminBootstrapReachable(restServerConfig, restConf);
Review Comment:
Fixed in edf07d0. Only the already-exists case is ignored now, judged by
re-reading the user rather than matching the message; every other failure —
`initDefaultGraphSpace()` included — wraps in `HugeException` and aborts
startup through the constructor's existing rethrow. If the re-read itself
fails, the original error propagates with the probe attached as suppressed.
Regressions in `GraphManagerAdminInitTest`: created when absent, kept without
failing when present, non-duplicate failure propagates with its cause.
--
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]