From a2e64226eea4e10546cbf690f753ec5e1f4befaf Mon Sep 17 00:00:00 2001 From: Bitnami Bot Date: Thu, 11 Jan 2024 17:23:53 +0100 Subject: [PATCH] [bitnami/mongodb] Release 5.0.23-debian-11-r6 (#54697) Signed-off-by: Bitnami Containers --- bitnami/mongodb/5.0/debian-11/Dockerfile | 10 +++---- .../opt/bitnami/.bitnami_components.json | 6 ++--- .../debian-11/prebuildfs/usr/sbin/run-script | 2 +- .../rootfs/opt/bitnami/scripts/libmongodb.sh | 26 +++++++++---------- .../rootfs/opt/bitnami/scripts/mongodb-env.sh | 6 +++-- 5 files changed, 26 insertions(+), 24 deletions(-) diff --git a/bitnami/mongodb/5.0/debian-11/Dockerfile b/bitnami/mongodb/5.0/debian-11/Dockerfile index d3d78e1b2b4c..67f482f2913a 100644 --- a/bitnami/mongodb/5.0/debian-11/Dockerfile +++ b/bitnami/mongodb/5.0/debian-11/Dockerfile @@ -7,10 +7,10 @@ ARG TARGETARCH LABEL com.vmware.cp.artifact.flavor="sha256:1e1b4657a77f0d47e9220f0c37b9bf7802581b93214fff7d1bd2364c8bf22e8e" \ org.opencontainers.image.base.name="docker.io/bitnami/minideb:bullseye" \ - org.opencontainers.image.created="2023-12-27T14:34:06Z" \ + org.opencontainers.image.created="2024-01-11T15:48:38Z" \ org.opencontainers.image.description="Application packaged by VMware, Inc" \ org.opencontainers.image.licenses="Apache-2.0" \ - org.opencontainers.image.ref.name="5.0.23-debian-11-r5" \ + org.opencontainers.image.ref.name="5.0.23-debian-11-r6" \ org.opencontainers.image.title="mongodb" \ org.opencontainers.image.vendor="VMware, Inc." \ org.opencontainers.image.version="5.0.23" @@ -27,9 +27,9 @@ RUN install_packages ca-certificates curl libbrotli1 libcom-err2 libcurl4 libffi RUN mkdir -p /tmp/bitnami/pkg/cache/ ; cd /tmp/bitnami/pkg/cache/ ; \ COMPONENTS=( \ "mongodb-shell-2.1.1-0-linux-${OS_ARCH}-debian-11" \ - "yq-4.40.5-0-linux-${OS_ARCH}-debian-11" \ - "wait-for-port-1.0.7-4-linux-${OS_ARCH}-debian-11" \ - "render-template-1.0.6-4-linux-${OS_ARCH}-debian-11" \ + "yq-4.40.5-1-linux-${OS_ARCH}-debian-11" \ + "wait-for-port-1.0.7-5-linux-${OS_ARCH}-debian-11" \ + "render-template-1.0.6-5-linux-${OS_ARCH}-debian-11" \ "mongodb-5.0.23-2-linux-${OS_ARCH}-debian-11" \ ) ; \ for COMPONENT in "${COMPONENTS[@]}"; do \ diff --git a/bitnami/mongodb/5.0/debian-11/prebuildfs/opt/bitnami/.bitnami_components.json b/bitnami/mongodb/5.0/debian-11/prebuildfs/opt/bitnami/.bitnami_components.json index 45bb8e105543..08f3dc8d60c9 100644 --- a/bitnami/mongodb/5.0/debian-11/prebuildfs/opt/bitnami/.bitnami_components.json +++ b/bitnami/mongodb/5.0/debian-11/prebuildfs/opt/bitnami/.bitnami_components.json @@ -15,18 +15,18 @@ "arch": "amd64", "distro": "debian-11", "type": "NAMI", - "version": "1.0.6-4" + "version": "1.0.6-5" }, "wait-for-port": { "arch": "amd64", "distro": "debian-11", "type": "NAMI", - "version": "1.0.7-4" + "version": "1.0.7-5" }, "yq": { "arch": "amd64", "distro": "debian-11", "type": "NAMI", - "version": "4.40.5-0" + "version": "4.40.5-1" } } \ No newline at end of file diff --git a/bitnami/mongodb/5.0/debian-11/prebuildfs/usr/sbin/run-script b/bitnami/mongodb/5.0/debian-11/prebuildfs/usr/sbin/run-script index b7a5bf1e50bf..4ca0f897277e 100755 --- a/bitnami/mongodb/5.0/debian-11/prebuildfs/usr/sbin/run-script +++ b/bitnami/mongodb/5.0/debian-11/prebuildfs/usr/sbin/run-script @@ -10,7 +10,7 @@ fi script=$1 exit_code="${2:-96}" -fail_if_not_present="${3:-y}" +fail_if_not_present="${3:-n}" if test -f "$script"; then sh $script diff --git a/bitnami/mongodb/5.0/debian-11/rootfs/opt/bitnami/scripts/libmongodb.sh b/bitnami/mongodb/5.0/debian-11/rootfs/opt/bitnami/scripts/libmongodb.sh index 3c6f40101f1d..9f18d67751cb 100644 --- a/bitnami/mongodb/5.0/debian-11/rootfs/opt/bitnami/scripts/libmongodb.sh +++ b/bitnami/mongodb/5.0/debian-11/rootfs/opt/bitnami/scripts/libmongodb.sh @@ -383,7 +383,7 @@ mongodb_start_bg() { fi # wait until the server is up and answering queries - if ! retry_while "mongodb_is_mongodb_started" "$MONGODB_MAX_TIMEOUT"; then + if ! retry_while "mongodb_is_mongodb_started" "$MONGODB_INIT_RETRY_ATTEMPTS" "$MONGODB_INIT_RETRY_DELAY"; then error "MongoDB did not start" exit 1 fi @@ -423,7 +423,7 @@ mongodb_stop() { info "Stopping MongoDB..." stop_service_using_pid "$MONGODB_PID_FILE" - if ! retry_while "is_mongodb_not_running" "$MONGODB_MAX_TIMEOUT"; then + if ! retry_while "is_mongodb_not_running" "$MONGODB_INIT_RETRY_ATTEMPTS" "$MONGODB_INIT_RETRY_DELAY"; then error "MongoDB failed to stop" exit 1 fi @@ -1003,7 +1003,7 @@ mongodb_configure_primary() { info "Configuring MongoDB primary node" wait-for-port --timeout 360 "$MONGODB_PORT_NUMBER" - if ! retry_while "mongodb_is_primary_node_initiated $node $port" "$MONGODB_MAX_TIMEOUT"; then + if ! retry_while "mongodb_is_primary_node_initiated $node $port" "$MONGODB_INIT_RETRY_ATTEMPTS" "$MONGODB_INIT_RETRY_DELAY"; then error "MongoDB primary node failed to get configured" exit 1 fi @@ -1024,7 +1024,7 @@ mongodb_wait_confirmation() { local -r port="${2:?port is required}" debug "Waiting until ${node}:${port} is added to the replica set..." - if ! retry_while "mongodb_node_currently_in_cluster ${node} ${port}" "$MONGODB_MAX_TIMEOUT"; then + if ! retry_while "mongodb_node_currently_in_cluster ${node} ${port}" "$MONGODB_INIT_RETRY_ATTEMPTS" "$MONGODB_INIT_RETRY_DELAY"; then error "Unable to confirm that ${node}:${port} has been added to the replica set!" exit 1 else @@ -1098,14 +1098,14 @@ mongodb_wait_for_node() { debug "Waiting for primary node..." info "Trying to connect to MongoDB server $host..." - if ! retry_while "wait-for-port --host $host --timeout 10 $port" "$MONGODB_MAX_TIMEOUT"; then + if ! retry_while "wait-for-port --host $host --timeout 10 $port" "$MONGODB_INIT_RETRY_ATTEMPTS" "$MONGODB_INIT_RETRY_DELAY"; then error "Unable to connect to host $host" exit 1 else info "Found MongoDB server listening at $host:$port !" fi - if ! retry_while "mongodb_is_node_available $host $port $user $password" "$MONGODB_MAX_TIMEOUT"; then + if ! retry_while "mongodb_is_node_available $host $port $user $password" "$MONGODB_INIT_RETRY_ATTEMPTS" "$MONGODB_INIT_RETRY_DELAY"; then error "Node $host did not become available" exit 1 else @@ -1130,7 +1130,7 @@ mongodb_wait_for_primary_node() { mongodb_wait_for_node "$host" "$port" "$user" "$password" debug "Waiting for primary host $host to be ready..." - if ! retry_while "mongodb_is_primary_node_up $host $port $user $password" "$MONGODB_MAX_TIMEOUT"; then + if ! retry_while "mongodb_is_primary_node_up $host $port $user $password" "$MONGODB_INIT_RETRY_ATTEMPTS" "$MONGODB_INIT_RETRY_DELAY"; then error "Unable to validate $host as primary node in the replica set scenario!" exit 1 else @@ -1158,7 +1158,7 @@ mongodb_configure_secondary() { info "Node currently in the cluster" else info "Adding node to the cluster" - if ! retry_while "mongodb_is_secondary_node_pending $node $port" "$MONGODB_MAX_TIMEOUT"; then + if ! retry_while "mongodb_is_secondary_node_pending $node $port" "$MONGODB_INIT_RETRY_ATTEMPTS" "$MONGODB_INIT_RETRY_DELAY"; then error "Secondary node did not get ready" exit 1 fi @@ -1166,14 +1166,14 @@ mongodb_configure_secondary() { # Ensure that secondary nodes do not count as voting members until they are fully initialized # https://docs.mongodb.com/manual/reference/method/rs.add/#behavior - if ! retry_while "mongodb_is_secondary_node_ready $node $port" "$MONGODB_MAX_TIMEOUT"; then + if ! retry_while "mongodb_is_secondary_node_ready $node $port" "$MONGODB_INIT_RETRY_ATTEMPTS" "$MONGODB_INIT_RETRY_DELAY"; then error "Secondary node did not get marked as secondary" exit 1 fi # Grant voting rights to node # https://docs.mongodb.com/manual/tutorial/modify-psa-replica-set-safely/ - if ! retry_while "mongodb_configure_secondary_node_voting $node $port" "$MONGODB_MAX_TIMEOUT"; then + if ! retry_while "mongodb_configure_secondary_node_voting $node $port" "$MONGODB_INIT_RETRY_ATTEMPTS" "$MONGODB_INIT_RETRY_DELAY"; then error "Secondary node did not get marked as secondary" exit 1 fi @@ -1208,7 +1208,7 @@ mongodb_configure_hidden() { info "Node currently in the cluster" else info "Adding hidden node to the cluster" - if ! retry_while "mongodb_is_hidden_node_pending $node $port" "$MONGODB_MAX_TIMEOUT"; then + if ! retry_while "mongodb_is_hidden_node_pending $node $port" "$MONGODB_INIT_RETRY_ATTEMPTS" "$MONGODB_INIT_RETRY_DELAY"; then error "Hidden node did not get ready" exit 1 fi @@ -1236,7 +1236,7 @@ mongodb_configure_arbiter() { info "Node currently in the cluster" else info "Configuring MongoDB arbiter node" - if ! retry_while "mongodb_is_arbiter_node_pending $node $port" "$MONGODB_MAX_TIMEOUT"; then + if ! retry_while "mongodb_is_arbiter_node_pending $node $port" "$MONGODB_INIT_RETRY_ATTEMPTS" "$MONGODB_INIT_RETRY_DELAY"; then error "Arbiter node did not get ready" exit 1 fi @@ -1277,7 +1277,7 @@ EOF mongodb_wait_until_sync_complete() { info "Waiting until initial data sync is complete..." - if ! retry_while "mongodb_is_not_in_sync" "$MONGODB_MAX_TIMEOUT" 1; then + if ! retry_while "mongodb_is_not_in_sync" "$MONGODB_INIT_RETRY_ATTEMPTS" "$MONGODB_INIT_RETRY_DELAY" 1; then error "Initial data sync did not finish after $MONGODB_MAX_TIMEOUT seconds" exit 1 else diff --git a/bitnami/mongodb/5.0/debian-11/rootfs/opt/bitnami/scripts/mongodb-env.sh b/bitnami/mongodb/5.0/debian-11/rootfs/opt/bitnami/scripts/mongodb-env.sh index de9a36d80bde..82494e9b9f47 100644 --- a/bitnami/mongodb/5.0/debian-11/rootfs/opt/bitnami/scripts/mongodb-env.sh +++ b/bitnami/mongodb/5.0/debian-11/rootfs/opt/bitnami/scripts/mongodb-env.sh @@ -25,7 +25,8 @@ export BITNAMI_DEBUG="${BITNAMI_DEBUG:-false}" # variable will be overridden with the value specified in that file mongodb_env_vars=( MONGODB_MOUNTED_CONF_DIR - MONGODB_MAX_TIMEOUT + MONGODB_INIT_RETRY_ATTEMPTS + MONGODB_INIT_RETRY_DELAY MONGODB_PORT_NUMBER MONGODB_ENABLE_MAJORITY_READ MONGODB_DEFAULT_ENABLE_MAJORITY_READ @@ -106,7 +107,8 @@ export MONGODB_DAEMON_GROUP="mongo" # MongoDB configuration export MONGODB_MOUNTED_CONF_DIR="${MONGODB_MOUNTED_CONF_DIR:-${MONGODB_VOLUME_DIR}/conf}" -export MONGODB_MAX_TIMEOUT="${MONGODB_MAX_TIMEOUT:-35}" +export MONGODB_INIT_RETRY_ATTEMPTS="${MONGODB_INIT_RETRY_ATTEMPTS:-7}" +export MONGODB_INIT_RETRY_DELAY="${MONGODB_INIT_RETRY_DELAY:-5}" export MONGODB_DEFAULT_PORT_NUMBER="27017" export MONGODB_PORT_NUMBER="${MONGODB_PORT_NUMBER:-$MONGODB_DEFAULT_PORT_NUMBER}" export MONGODB_ENABLE_MAJORITY_READ="${MONGODB_ENABLE_MAJORITY_READ:-true}"