Problem
bin/init-store.sh always runs full local setup (scan ./conf/graphs, init non-hstore backends, create admin user). That is right for standalone / tarball installs.
For HStore / PD mode the storage side already owns metadata. Server should start and register with PD. Forcing a full local init on every path makes Kubernetes and Helm harder than they need to be (one-shot Jobs, skip-init workarounds on Server pods).
There is already a Server option for local graph config:
- key:
graph.load_from_local_config
ServerOptions.GRAPH_LOAD_FROM_LOCAL_CONFIG
- used by
GraphManager when deciding whether to load graphs from ./conf/graphs
InitStore does not look at that flag today.
Proposal
Teach InitStore to honor the same property, with standalone-safe defaults:
rest-server.properties |
init-store |
| key unset (current shipped defaults) |
full init (same as master) |
explicit false |
no-op, WARN, exit 0 |
explicit true |
full init |
Details:
- Skip only when the key is present and false. Missing key must not skip.
ServerOptions typed default is false for GraphManager; treating "missing" as skip would break bare tarball init-store.sh.
- Map Docker env
HG_SERVER_LOAD_FROM_LOCAL_CONFIG into rest-server.properties (the file init-store.sh already passes to Java).
- Helm / distributed can set the env (or property) to
false so Server does not re-init local storage.
- No change to the
ServerOptions default itself.
Scope
In scope:
InitStore.java early exit
- Docker entrypoint env mapping
- unit tests for unset / false / true
Out of scope:
Why this shape
Community still supports standalone and multi-backend installs, so default behavior of init-store should stay as it is today. Distributed / HStore needs an explicit opt-out so cluster installs do not fight local init.
Related
I can open a PR that implements the above once this issue is filed.
Update: dedicated option instead of reusing graph.load_from_local_config
The proposal above reuses graph.load_from_local_config. #3119 implements a
dedicated init_store.enabled instead.
graph.load_from_local_config governs whether GraphManager loads graphs from
./conf/graphs. Whether init-store should run is a different decision, and a
deployment can reasonably want one without the other. Overloading one key for
both would have made the two impossible to set independently later.
The behavior table is otherwise unchanged: key unset means full init, explicit
false is a no-op, explicit true is full init. The Docker env variable is
HG_SERVER_INIT_STORE_ENABLED.
The entrypoint auth-bootstrap work that shared the #3119 branch has moved to
#3133.
Problem
bin/init-store.shalways runs full local setup (scan./conf/graphs, init non-hstore backends, create admin user). That is right for standalone / tarball installs.For HStore / PD mode the storage side already owns metadata. Server should start and register with PD. Forcing a full local init on every path makes Kubernetes and Helm harder than they need to be (one-shot Jobs, skip-init workarounds on Server pods).
There is already a Server option for local graph config:
graph.load_from_local_configServerOptions.GRAPH_LOAD_FROM_LOCAL_CONFIGGraphManagerwhen deciding whether to load graphs from./conf/graphsInitStoredoes not look at that flag today.Proposal
Teach
InitStoreto honor the same property, with standalone-safe defaults:rest-server.propertiesinit-storefalsetrueDetails:
ServerOptionstyped default is false for GraphManager; treating "missing" as skip would break bare tarballinit-store.sh.HG_SERVER_LOAD_FROM_LOCAL_CONFIGintorest-server.properties(the fileinit-store.shalready passes to Java).falseso Server does not re-init local storage.ServerOptionsdefault itself.Scope
In scope:
InitStore.javaearly exitOut of scope:
HG_SERVER_SKIP_INITchangesutil.sh/check_port/ lsof (tracked separately, e.g. fix(bin): replace lsof port preflight with ss/netstat #3105)Why this shape
Community still supports standalone and multi-backend installs, so default behavior of
init-storeshould stay as it is today. Distributed / HStore needs an explicit opt-out so cluster installs do not fight local init.Related
I can open a PR that implements the above once this issue is filed.
Update: dedicated option instead of reusing
graph.load_from_local_configThe proposal above reuses
graph.load_from_local_config. #3119 implements adedicated
init_store.enabledinstead.graph.load_from_local_configgoverns whetherGraphManagerloads graphs from./conf/graphs. Whether init-store should run is a different decision, and adeployment can reasonably want one without the other. Overloading one key for
both would have made the two impossible to set independently later.
The behavior table is otherwise unchanged: key unset means full init, explicit
falseis a no-op, explicittrueis full init. The Docker env variable isHG_SERVER_INIT_STORE_ENABLED.The entrypoint auth-bootstrap work that shared the #3119 branch has moved to
#3133.