bitflicker64 commented on code in PR #3401:
URL: https://github.com/apache/hugegraph/pull/3401#discussion_r4371228293
##########
hugegraph-server/hugegraph-dist/docker/docker-entrypoint.sh:
##########
@@ -206,28 +255,23 @@ if [[ -n "${PASSWORD:-}" ]]; then
AUTH_ADMIN_PASSWORD_ENCODED=$(encode_auth_prop_value "${PASSWORD}")
fi
-# Same accepted spellings as HG_SERVER_INIT_STORE_ENABLED below, checked
-# before the mapping so an invalid value leaves both conf files untouched.
-# URLs hold no whitespace, and the Server splits the list on bare commas, so
-# "a, b" would otherwise register an escaped space in front of the second URL.
-URLS_TO_PD=$(printf '%s' "${HG_SERVER_URLS_TO_PD:-}" | tr -d '[:space:]')
-# Only surrounding whitespace is trimmed, so a value such as "t rue" stays
invalid.
-DEPLOY_IN_K8S="${HG_SERVER_DEPLOY_IN_K8S:-}"
-DEPLOY_IN_K8S="${DEPLOY_IN_K8S#"${DEPLOY_IN_K8S%%[![:space:]]*}"}"
-DEPLOY_IN_K8S="${DEPLOY_IN_K8S%"${DEPLOY_IN_K8S##*[![:space:]]}"}"
-DEPLOY_IN_K8S=$(printf '%s' "${DEPLOY_IN_K8S}" | tr '[:upper:]' '[:lower:]')
-case "${DEPLOY_IN_K8S}" in
- "" | y | t | yes | on | true | n | f | no | off | false) ;;
- *) log "ERROR: invalid HG_SERVER_DEPLOY_IN_K8S
'${HG_SERVER_DEPLOY_IN_K8S}'"
- exit 1 ;;
-esac
-
# ── Map env → properties file ─────────────────────────────────────────
# TODO: drop the Helm chart's (helm/hugegraph) rest-server.properties wrapper
once its minimum
# Server image has the server.urls_to_pd and server.deploy_in_k8s mappings
below. A read-only root
# filesystem also needs the conf files on a writable path, since set_prop in
this script edits them
# in place; the chart refuses readOnlyRootFilesystem until then.
[[ -n "${HG_SERVER_BACKEND:-}" ]] && set_prop "backend"
"${HG_SERVER_BACKEND}" "${GRAPH_CONF}"
+# Apply the image's selected JNI provider to every embedded graph in the normal
+# container graphs directory, including mounted additional graph definitions.
+# Distributed graphs keep backend=hstore and do not select a local provider.
+if [[ -n "${TOPLINGDB_ROCKSDB_PROVIDER:-}" ]]; then
+ for graph_conf in ./conf/graphs/*.properties; do
+ [[ -f "${graph_conf}" ]] || continue
+ if [[ "$(get_prop_encoded backend "${graph_conf}")" == rocksdb ]]; then
+ set_prop "rocksdb.provider" "${ROCKSDB_PROVIDER}" "${graph_conf}"
Review Comment:
Important: The standard image sets `TOPLINGDB_ROCKSDB_PROVIDER=rocksdb`, so
this loop writes every `backend=rocksdb` graph file on each start, and under
`set -e` a read-only `conf/graphs` mount (for example a Kubernetes ConfigMap)
stops a container that starts on the base image. Call `set_prop` only when the
file's effective provider (absent means `rocksdb`) differs from
`${ROCKSDB_PROVIDER}`.
--
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]