imbajin commented on code in PR #3401:
URL: https://github.com/apache/hugegraph/pull/3401#discussion_r4374126265


##########
hugegraph-server/hugegraph-dist/docker/docker-entrypoint.sh:
##########
@@ -206,28 +255,36 @@ 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

Review Comment:
   ⚠️ Important: Normalize the backend value before comparing it. With a 
writable Windows-authored graph file containing `backend=rocksdb
   rocksdb.provider=rocksdb
   `, `get_prop_encoded` retains the carriage return, so this comparison skips 
the file. Running the actual entrypoint with 
`TOPLINGDB_ROCKSDB_PROVIDER=topling` leaves `rocksdb.provider=rocksdb` 
unchanged, while Commons Configuration 2.10.1 reads both values normally. 
`RocksDBStoreProvider.applyImageProvider()` preserves that explicit provider, 
and `RocksDBRuntime.verify()` then rejects it against the Topling JNI. This 
breaks the documented image switch for a valid existing configuration. Trim the 
backend value's trailing whitespace/CR, as done for `current_provider` below, 
and add a CRLF regression with an explicit previous 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]

Reply via email to