druid icon indicating copy to clipboard operation
druid copied to clipboard

Forked Peon properties not applied for containerized Druid deployments

Open rmorris708 opened this issue 5 years ago • 2 comments

Affected Version

Observed in Docker image 0.20.2, but likely affecting other versions as well.

Description

The final layer of the image launches this script, which executes the following steps relevant to this issue:

  1. Copies the example configuration files from /opt/druid/conf/druid to /tmp/conf/druid (line 50)
  2. Determines the path to the server's configuration file (line 66)
  3. Reads the environment variables matching the pattern ^druid_ and overwrites or appends them to the server's configuration file (lines 104-110)

I believe that the problem with the third step is that lines 75 and 76 of the setKey function do not include an anchor character before /$key, so regular properties and forked properties match each other with this regex comparison. Since the environment variables are read in a random order, the result of this is that, depending on which is read last, either the regular property value will overwrite the forked property value, or vice versa.

Repro Steps

  1. Create env.list file with contents:
druid_processing_numMergeBuffers=4
druid_processing_buffer_sizeBytes=500000000
druid_processing_numThreads=16
druid_indexer_fork_property_druid_processing_numMergeBuffers=2
druid_indexer_fork_property_druid_processing_buffer_sizeBytes=200000000
druid_indexer_fork_property_druid_processing_numThreads=4
  1. Launch a MiddleManager container docker run -d --env-file ./env.list apache/druid:0.20.2 middleManager
  2. Get a shell into the MiddleManager docker exec -it <container_id> sh
  3. Read the MiddleManager's runtime.properties file generated by the installation cat /tmp/conf/druid/cluster/data/middleManager/runtime.properties
  4. Observe that either the regular processing properties or the forked processing properties are missing
$> docker exec -it d0a5d42461f438c2c2af5e86c6fd5725fd9e5b3c4da1210d82bbd236d91bc9b4 sh
/opt/apache-druid-0.20.2 $ cat /tmp/conf/druid/cluster/data/middleManager/runtime.properties
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.
#

druid.service=druid/middleManager
druid.plaintextPort=8091

# Number of tasks per middleManager
druid.worker.capacity=4

# Task launch parameters
druid.indexer.runner.javaOpts=-server -Xms1g -Xmx1g -XX:MaxDirectMemorySize=1g -Duser.timezone=UTC -Dfile.encoding=UTF-8 -XX:+ExitOnOutOfMemoryError -Djava.util.logging.manager=org.apache.logging.log4j.jul.LogManager
druid.indexer.task.baseTaskDir=var/druid/task

# HTTP server threads
druid.server.http.numThreads=60

# Processing threads and buffers on Peons

# Hadoop indexing
druid.indexer.task.hadoopWorkingPath=var/druid/hadoop-tmp
druid.host=172.17.0.2
druid.processing.numMergeBuffers=4
druid.processing.numThreads=16
druid.processing.buffer.sizeBytes=500000000

Note that this can also be done using Docker Compose, Kubernetes, Helm, etc to bring up an operational cluster -- I am just providing the simplest possible steps to prove the issue.

rmorris708 avatar Sep 21 '21 17:09 rmorris708

This issue has been marked as stale due to 280 days of inactivity. It will be closed in 4 weeks if no further activity occurs. If this issue is still relevant, please simply write any comment. Even if closed, you can still revive the issue at any time or discuss it on the [email protected] list. Thank you for your contributions.

github-actions[bot] avatar Nov 18 '23 00:11 github-actions[bot]

This issue has been closed due to lack of activity. If you think that is incorrect, or the issue requires additional review, you can revive the issue at any time.

github-actions[bot] avatar Dec 17 '23 00:12 github-actions[bot]