Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
e4d966a
Squashed 'solution-base/images/mongodb-sharded/debian-12/' content fr…
DarkIsDude Jun 29, 2026
cd8a868
Squashed 'solution-base/images/mongodb-exporter/debian-12/' content f…
DarkIsDude Aug 21, 2026
b7d315f
Squashed 'solution-base/images/os-shell/debian-12/' content from comm…
DarkIsDude Aug 21, 2026
ae35701
Merge commit 'cd8a86878e5f08757d7dabce9f7254fdf8d6eabb' as 'solution-…
DarkIsDude Aug 21, 2026
ca209b3
Merge commit 'b7d315f24a55ab51353d565027a647c24b27bca9' as 'solution-…
DarkIsDude Aug 21, 2026
78c5b85
🐛 ensure secondary keeps votes and priority after restart
DarkIsDude Jun 26, 2026
45ff404
🐛 fix Make script to right commit, working with root git and reduce time
DarkIsDude Jun 29, 2026
0495d99
🔧 clear vendored image dirs for one-time subtree bootstrap
DarkIsDude Jun 29, 2026
4dccbb3
Merge commit 'e4d966a9e537e574eb4c3712ec81e6b2bf76b305' as 'solution-…
DarkIsDude Jun 29, 2026
9c9a549
🔧 restore Zenko changes on top of the subtree bootstrap
DarkIsDude Aug 21, 2026
28ef5f1
🐛 match voting rights on a sentinel instead of "true"
DarkIsDude Aug 13, 2026
df74ca4
🐛 match secondary state on a sentinel instead of "true"
DarkIsDude Aug 13, 2026
bee96a4
✅ cover the mongosh boolean-matching regression
DarkIsDude Aug 13, 2026
b3a2b3f
📌 pin every Bitnami vendor ref to a sha
DarkIsDude Aug 21, 2026
09768f7
🐛 publish vendor split commits so vendor-sync works on any clone
DarkIsDude Aug 21, 2026
8888006
♻️ drop the sparse-checkout dance from the vendor split
DarkIsDude Aug 21, 2026
6a005ee
♻️ restore upstream exec bits and drop the chmod workarounds
DarkIsDude Aug 21, 2026
65bbbc3
🐛 fetch published vendor baselines before the subtree merge
DarkIsDude Aug 21, 2026
80a2b7c
📝 document how to bump the pinned Bitnami refs
DarkIsDude Aug 28, 2026
9445688
📝 fix broken doc links and a typo
DarkIsDude Aug 28, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Key paths:
- `solution/zenkoversion.yaml` — `ZenkoVersion` CR template (dashboards, policies, feature flags, capabilities, location types)
- `solution/kafka/Dockerfile`, `solution/kafka-connect/Dockerfile` — Scality Kafka + Kafka Connect images
- `solution-base/mongodb/` — MongoDB Helm chart, vendored from `bitnami/charts` via `git subtree`
- `solution-base/images/` — Scality-built MongoDB images (`mongodb-sharded`, `mongodb-exporter`, `os-shell`), vendored from `bitnami/containers` via `git subtree`
- `tests/functional/ctst/` — TypeScript Cucumber end-to-end tests
- `tests/workflows/` — TypeScript Jest tests for CI tooling
- `tests/zenko_tests/` — Python + Node.js integration tests
Expand All @@ -27,6 +28,7 @@ When reviewing a PR, analyze changes against the following. Post inline comments
| **Dockerfiles** (`solution/kafka/`, `solution/kafka-connect/`...) | Base images pinned by tag or digest, no secrets baked in, no unnecessary `COPY . .`, reasonable layer count, user is non-root where possible. |
| **Helm charts & K8s manifests** (`solution-base/mongodb/charts/`, `monitoring/`) | Resource requests/limits set, label selectors match, no hard-coded namespaces, `securityContext` present, ServiceAccount scoping minimal. Any breaking chart-value renames documented in an upgrade note. |
| **Chart upgrade path** (`solution-base/mongodb/charts/`, `Makefile`, `how_to_upgrade.md`) | Changes under the vendored chart prefix arrive as a `git subtree` merge (squashed) plus discrete local-modification commits, not as ad-hoc edits to the tree. |
| **Image vendoring path** (`solution-base/images/`) | Changes under a vendored image prefix arrive as a `make -C solution-base/images vendor-sync` subtree merge plus discrete local-modification commits, not as ad-hoc edits. Every `BITNAMI_<image>_REF` in `solution-base/images/Makefile` must pin a full upstream commit SHA — never a branch, tag, or `main`. |
| **TypeScript tests** (`tests/functional/ctst/`, `tests/workflows/`) | Proper `async`/`await`, no swallowed promise rejections, Cucumber step definitions register correctly, no accidental `.only` / `.skip`, correct use of World context in ctst. |
| **Python tests** (`tests/zenko_tests/`) | No bare `except:`, specific exception types, consistency with existing style, `requirements.txt` kept in sync. |
| **CI workflows** (`.github/workflows/`) | Actions pinned (tag or SHA), secrets not echoed to logs, `permissions:` block scoped minimally, reusable-workflow inputs/secrets wired correctly, runner labels valid for Scality infra. |
Expand Down
1 change: 1 addition & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- `solution/zenkoversion.yaml` — `ZenkoVersion` CR template (dashboards, policies, feature flags, capabilities, location types)
- `solution/kafka/Dockerfile`, `solution/kafka-connect/Dockerfile` — Scality-built Kafka + Kafka Connect images
- `solution-base/mongodb/` — MongoDB Helm charts and patches
- `solution-base/images/` — Scality-built MongoDB images (`mongodb-sharded`, `mongodb-exporter`, `os-shell`) vendored from `bitnami/containers` via `git subtree`; upstream refs are SHA-pinned in its `Makefile`
- `tests/functional/ctst/` — TypeScript Cucumber end-to-end tests
- `tests/workflows/` — TypeScript Jest tests for CI tooling
- `tests/zenko_tests/` — Python + Node.js integration tests
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,4 @@ all configured to talk to each other.
- Includes high availability (HA)
- Asks for pre-existing volumes

[Zenko Kubernetes Helm Chart deployment](./kubernetes)

[Deploying a HA Kubernetes cluster](https://github.com/scality/metal-k8s)
2 changes: 1 addition & 1 deletion monitoring/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* set the `version` of the model to `1`
* remove `iteration` entirely from the model
* set `annotations` to `{"list": []}`
3. Comnit in `monitoring/*/dashboard.json`
3. Commit in `monitoring/*/dashboard.json`


# Modifying existing dashboards
Expand Down
45 changes: 30 additions & 15 deletions solution-base/images/Makefile
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
BITNAMI_REMOTE := bitnami-containers
BITNAMI_REPO := https://github.com/bitnami/containers.git
BITNAMI_UPSTREAM_MAIN_REF := $(BITNAMI_REMOTE)/main

IMAGES := mongodb-sharded mongodb-exporter os-shell

BITNAMI_mongodb_sharded_PATH := 8.0/debian-12
# Latest commit on upstream main known to still contain
# bitnami/mongodb-sharded/8.0/debian-12.
BITNAMI_mongodb_sharded_REF := 48a109547d39cd8cf8a5d4058d832ecb5844829e
BITNAMI_mongodb_sharded_REF := 657585595c550d4dc107a4e6cd3a598a9d284eec

BITNAMI_mongodb_exporter_PATH := 0/debian-12
BITNAMI_mongodb_exporter_REF := $(BITNAMI_UPSTREAM_MAIN_REF)
BITNAMI_mongodb_exporter_REF := 3af1e651db624f9938f407de85387bc7fe721d49

BITNAMI_os_shell_PATH := 12/debian-12
BITNAMI_os_shell_REF := $(BITNAMI_UPSTREAM_MAIN_REF)
BITNAMI_os_shell_REF := f6aa42546a035ccefc7a2823674e622cc9ccaaba
Comment thread
DarkIsDude marked this conversation as resolved.

.PHONY: create-remote fetch-remote vendor-sync $(addprefix vendor-sync-,$(IMAGES)) $(addprefix update-vendor-branch-,$(IMAGES))
.PHONY: create-remote vendor-sync

# Lock the .git/config to avoid corruption
.NOTPARALLEL:

normalize = $(subst -,_,$1)
bitnami_path = $(BITNAMI_$(call normalize,$1)_PATH)
Expand All @@ -25,15 +25,30 @@ vendor_branch = vendor/$1/$(call bitnami_path,$1)
create-remote:
@git remote get-url $(BITNAMI_REMOTE) >/dev/null 2>&1 || git remote add $(BITNAMI_REMOTE) $(BITNAMI_REPO)

fetch-remote: create-remote
# Fetch full history from Bitnami main so subtree split can see full subtree history.
git fetch $(BITNAMI_REMOTE) main

update-vendor-branch-%: fetch-remote
update-vendor-branch-%: create-remote
# Shallow and blobless: the split only reads trees, and a full-history walk over
# the containers monorepo costs hours because `git subtree split` cannot restrict
# its rev-list to the prefix. Unrelated split roots are fine for a --squash merge.
git fetch --depth 1 --filter=blob:none $(BITNAMI_REMOTE) $(call bitnami_ref,$*)
Comment thread
DarkIsDude marked this conversation as resolved.
-git branch -D $(call vendor_branch,$*)
git subtree split --prefix=bitnami/$*/$(call bitnami_path,$*) $(call bitnami_ref,$*) -b $(call vendor_branch,$*)

vendor-sync-%: update-vendor-branch-%
sha=$(call bitnami_ref,$*) && \
wt=$$(mktemp -d) && \
trap 'git worktree remove --force "$$wt" 2>/dev/null' EXIT && \
git worktree add --no-checkout --detach "$$wt" "$$sha" && \
mkdir -p "$$wt"/bitnami/$*/$(call bitnami_path,$*) && \
git -C "$$wt" subtree split --prefix=bitnami/$*/$(call bitnami_path,$*) "$$sha" -b $(call vendor_branch,$*)
# `git subtree merge --squash` resolves the recorded `git-subtree-split` trailer as
# an object, so the split commit has to stay reachable on origin or `vendor-sync`
# only ever works on the clone that produced it. Keyed by upstream sha so earlier
# baselines are never overwritten.
git push origin $(call vendor_branch,$*):refs/heads/vendor-baseline/$*/$(call bitnami_ref,$*)

fetch-vendor-baseline-%:
-git fetch --no-tags origin \
'refs/heads/vendor-baseline/$*/*:refs/vendor-baseline/$*/*'

vendor-sync-%: fetch-vendor-baseline-% update-vendor-branch-%
cd "$$(git rev-parse --show-toplevel)" && \
git subtree merge --prefix=solution-base/images/$*/debian-12 $(call vendor_branch,$*) --squash

vendor-sync: $(addprefix vendor-sync-,$(IMAGES))
30 changes: 19 additions & 11 deletions solution-base/images/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,30 @@ Do not copy files with `cp -r`. It keeps deleted files and loses merge history.
Use Git merge semantics through `git subtree`.

1. Ensure `git subtree` is available (may require installing git contrib tools).
2. Run a single sync command:
2. Bump `BITNAMI_<image>_REF` in `solution-base/images/Makefile` to the upstream
commit you want, and commit that change.
3. From a clean working tree, run a single sync command:

```bash
make -C solution-base/images vendor-sync
```

This command:
This command, per image:
- creates the remote if needed,
- fetches upstream refs once,
- rebuilds all vendor branches at the same upstream point,
- merges upstream updates for all three images.
- fetches the pinned upstream commit,
- rebuilds the vendor branch and publishes it to `origin` as
`vendor-baseline/<image>/<upstream-sha>`, so later syncs work from any clone,
- merges upstream updates.

Notes:
- `mongodb-sharded` is pinned to a specific upstream commit in
`solution-base/images/Makefile`, because upstream `main` no longer contains
`bitnami/mongodb-sharded/8.0/debian-12`.
- `mongodb-exporter` and `os-shell` are split from upstream `main`.
- Every image is pinned to an explicit upstream commit; upstream `main` is never
used. To pick a new one, list the release commits for the image's prefix with
`gh api "repos/bitnami/containers/commits?path=bitnami/<image>/<path>"` and
check the prefix still exists at that commit.
- `mongodb-sharded` cannot be bumped: upstream deleted
`bitnami/mongodb-sharded/8.0/debian-12`, so it stays pinned to the last commit
that still contains it.
- You need push access to `origin`, and a clean working tree.

After each upstream merge, make explicit local commits for Zenko-specific
tweaks (for example base image pin updates, script adjustments, build changes).
Expand All @@ -76,15 +83,16 @@ Merge upstream commit YYYY

To bump MongoDB:
1. Update `solution-base/deps.yaml` `mongodb-sharded.tag`.
2. CI passes `MONGODB_VERSION` from `deps.yaml` during `build-mongodb-images`.
2. CI passes `MONGODB_VERSION` from `deps.yaml` during the `build-mongodb` job.
3. For local builds, pass `--build-arg MONGODB_VERSION=<version>` explicitly.
4. Also review the base image digest in each Dockerfile `FROM ...@sha256:...`.
We keep the digest in Dockerfiles so dependency tooling can detect and
propose updates.

## CI Tagging Policy

- CI builds happen in `.github/workflows/end2end.yaml` (`build-mongodb-images`).
- CI builds happen in `.github/workflows/build-mongodb.yaml`, called by
`end2end.yaml` and `cache-warmer.yaml`.
- Published and consumed tags are immutable: `${VERSION}-${TREE_HASH}`.
- Floating tags are not used by ISO build nor by tests.

Expand Down
4 changes: 2 additions & 2 deletions solution-base/images/mongodb-exporter/debian-12/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ ENV HOME="/" \
COPY prebuildfs /
SHELL ["/bin/bash", "-o", "errexit", "-o", "nounset", "-o", "pipefail", "-c"]
# Install required system packages and dependencies
RUN /bin/bash /usr/sbin/install_packages ca-certificates curl procps
RUN install_packages ca-certificates curl procps
RUN --mount=type=secret,id=downloads_url,env=SECRET_DOWNLOADS_URL \
DOWNLOADS_URL=${SECRET_DOWNLOADS_URL:-${DOWNLOADS_URL}} ; \
mkdir -p /tmp/bitnami/pkg/cache/ ; cd /tmp/bitnami/pkg/cache/ || exit 1 ; \
Expand All @@ -44,7 +44,7 @@ RUN apt-get update && apt-get upgrade -y && \
RUN chmod g+rwX /opt/bitnami
RUN find / -perm /6000 -type f -exec chmod a-s {} \; || true
RUN ln -sf /opt/bitnami/mongodb-exporter/bin/mongodb_exporter /bin/mongodb_exporter
RUN /bin/bash /usr/sbin/uninstall_packages curl
RUN uninstall_packages curl

ENV APP_VERSION="0.49.0" \
BITNAMI_APP_NAME="mongodb-exporter" \
Expand Down
Comment thread
DarkIsDude marked this conversation as resolved.
Empty file.
Empty file.
Empty file.
5 changes: 2 additions & 3 deletions solution-base/images/mongodb-sharded/debian-12/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ ENV HOME="/" \
COPY prebuildfs /
SHELL ["/bin/bash", "-o", "errexit", "-o", "nounset", "-o", "pipefail", "-c"]
# Install required system packages and dependencies
RUN /bin/bash /usr/sbin/install_packages ca-certificates curl libbrotli1 libcom-err2 libcurl4 libffi8 libgcc-s1 libgmp10 libgnutls30 libgssapi-krb5-2 libhogweed6 libidn2-0 libk5crypto3 libkeyutils1 libkrb5-3 libkrb5support0 libldap-2.5-0 libnettle8 libnghttp2-14 libp11-kit0 libpsl5 librtmp1 libsasl2-2 libssh2-1 libssl3 libtasn1-6 libunistring2 libzstd1 numactl procps zlib1g
RUN install_packages ca-certificates curl libbrotli1 libcom-err2 libcurl4 libffi8 libgcc-s1 libgmp10 libgnutls30 libgssapi-krb5-2 libhogweed6 libidn2-0 libk5crypto3 libkeyutils1 libkrb5-3 libkrb5support0 libldap-2.5-0 libnettle8 libnghttp2-14 libp11-kit0 libpsl5 librtmp1 libsasl2-2 libssh2-1 libssl3 libtasn1-6 libunistring2 libzstd1 numactl procps zlib1g
RUN --mount=type=secret,id=downloads_url,env=SECRET_DOWNLOADS_URL \
DOWNLOADS_URL=${SECRET_DOWNLOADS_URL:-${DOWNLOADS_URL}} ; \
mkdir -p /tmp/bitnami/pkg/cache/ ; cd /tmp/bitnami/pkg/cache/ || exit 1 ; \
Expand Down Expand Up @@ -77,8 +77,7 @@ RUN ln -s /opt/bitnami/scripts/liblog.sh /liblog.sh
RUN ln -s /opt/bitnami/scripts/mongodb-sharded/run.sh /run.sh

COPY rootfs /
RUN find /opt/bitnami/scripts -name "*.sh" -exec chmod a+x {} +
RUN /bin/bash /opt/bitnami/scripts/mongodb-sharded/postunpack.sh
RUN /opt/bitnami/scripts/mongodb-sharded/postunpack.sh
ENV APP_VERSION="${MONGODB_VERSION}" \
BITNAMI_APP_NAME="mongodb-sharded" \
IMAGE_REVISION="1" \
Expand Down
Empty file.
Empty file.
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -910,14 +910,17 @@ mongodb_is_secondary_node_ready() {
local -r port="${2:?port is required}"

debug "Waiting for the node to be marked as secondary"
# mongosh prints a connection banner holding 'directConnection=true', so matching
# on 'true' would always succeed. Match a dedicated sentinel instead, built at
# runtime so the positive value never appears verbatim in the submitted script.
result=$(
mongodb_execute_print_output "$MONGODB_INITIAL_PRIMARY_ROOT_USER" "$MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD" "admin" "$MONGODB_INITIAL_PRIMARY_HOST" "$MONGODB_INITIAL_PRIMARY_PORT_NUMBER" <<EOF
rs.status().members.filter(m => m.name === '$node:$port' && m.stateStr === 'SECONDARY').length === 1
print("IS_SECONDARY_" + (rs.status().members.some(m => m.name === '$node:$port' && m.stateStr === 'SECONDARY') ? "YES" : "NO"))
EOF
)
debug "$result"

grep -q "true" <<<"$result"
grep -q "IS_SECONDARY_YES" <<<"$result"
}

########################
Expand Down Expand Up @@ -951,6 +954,35 @@ EOF
grep -q "ok: 1" <<<"$result"
}

########################
# Get if secondary node already has voting rights
Comment thread
DarkIsDude marked this conversation as resolved.
# Globals:
# MONGODB_*
# Arguments:
# $1 - node
# $2 - port
# Returns:
# Boolean
#########################
mongodb_secondary_node_has_voting_rights() {
local -r node="${1:?node is required}"
local -r port="${2:?port is required}"
local result

debug "Checking voting rights of the node"
# mongosh prints a connection banner holding 'directConnection=true', so matching
# on 'true' would always succeed. Match a dedicated sentinel instead, built at
# runtime so the positive value never appears verbatim in the submitted script.
result=$(
mongodb_execute_print_output "$MONGODB_INITIAL_PRIMARY_ROOT_USER" "$MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD" "admin" "$MONGODB_INITIAL_PRIMARY_HOST" "$MONGODB_INITIAL_PRIMARY_PORT_NUMBER" <<EOF
print("HAS_VOTES_" + (rs.conf().members.some(m => m.host === '$node:$port' && m.votes > 0 && m.priority > 0) ? "YES" : "NO"))
EOF
)
debug "$result"

grep -q "HAS_VOTES_YES" <<<"$result"
}

########################
# Get if hidden node is pending
# Globals:
Expand Down Expand Up @@ -1187,7 +1219,15 @@ mongodb_configure_secondary() {
exit 1
fi
mongodb_wait_confirmation "$node" "$port"
fi

# Grant voting rights to the node if it does not have them yet. This must be
# done even when the node is already in the cluster: a previous attempt may
# have added it with votes/priority 0 and failed (or been restarted) before
# granting voting rights, leaving the node stuck without them.
if mongodb_secondary_node_has_voting_rights "$node" "$port"; then
info "Node already has voting rights"
else

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will not behave properly when we have 9-replicas, where 2 nodes are always "non voting". This is expected, and we must not try to change that (in particular, the voting nodes must be in precisely the expected DC for proper redundancy)

→ the change will make the startup slower on these extra secondaries -(re-)trying to make them voting-, possibly with the extra risk of changing the set of voters...

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DarkIsDude did you try that case?

Looking at the code below, it seems that the script would exit if it fails to configure secondary node voting: does that function already silently handle the case where we reached the max number of voters already?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes — tested on a real 9-replica shard, both with the current development/2.15 image and with this branch. Short answer to your question: no, it is not silently handled — it exits. But that is pre-existing behaviour, not something this PR introduces.

First: your review caught a real bug, just not the one we were discussing. mongodb_secondary_node_has_voting_rights() grepped mongosh's output for true, and mongosh always prints a connection banner containing directConnection=true. So the check always returned true, the grant branch became dead code, and no secondary ever got voting rights. Observed directly: a fresh secondary joined with a free voter slot available and stayed at votes=0 forever (9 members / 6 voters). By extension a fresh install would leave only pod-0 — which self-initiates — with a vote. Fixed using an explicit HAS_VOTES_YES/HAS_VOTES_NO sentinel. Re-tested after the fix: same scenario now yields votes=1 priority=1 → 7 voters.

Secondly: "the extra risk of changing the set of voters": The only path where this branch differs from development/2.15 is data dir empty and node already in rs.conf() — i.e. PVC loss on an existing member.

Last one: "does that function silently handle reaching the max number of voters?" No. Reproduced, scaling 3 → 9:

mongod:  Replica set configuration contains 8 voting members, but must be at least 1 and no more than 7
pod-7:   ERROR ==> Secondary node did not get marked as secondary     (after 24 × 5s of retries)
         → exit 1 → container restart

It does recover: on restart the data dir is no longer empty, config is skipped, and the member settles as a working non-voting secondary. Net cost is one crash + ~3 min per extra member, and the final topology is the expected 9 members / 7 voters.
This branch behaves identically (9 members / 7 voters, one crash each on pods 7 and 8), with a more accurate message: Secondary node did not get granted voting rights rather than the old, misleading "did not get marked as secondary".
Happy to add a members.filter(m => m.votes > 0).length < 7 guard to skip the doomed promotion entirely if you'd like that in this PR. Put the behaviour is unchanged.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy to add a members.filter(m => m.votes > 0).length < 7 guard to skip the doomed promotion entirely if you'd like that in this PR. Put the behaviour is unchanged.

Ack for the unchanged behavior, but I guess it's best to fix it, right?
(should probably be upstreamed as well)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure we should fix it.

  • It's pure cosmetic.
  • We'll add in the logic (on our side and maybe upstream) a logic that is specific to Mongo. If Mongo change this limits or change the behaviour, no one will notice that here.
  • It's at boot time, so race condition can occur (don't know if they can occur) : two extra pods bootstrapping at the same time both read 6 voters, both proceed, and one still fails;

If we really wants to fix it, we should read the output from Mongo, parse it and stop retrying. Again, not sure is useful right now.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • It's not just purely cosmetic : it means a pod restarts, which delays "deployment" and increases the install duration (since installer waits).
  • logic that is specific to Mongo : deploying mongo is specific to mongo. But this limit has not changed in many years, I don't expect it to change, and anyway the correct way requires to handle the error instead of just pre-filtering

Please create a followup BUGFIX ticket (in Zenko) to document the problem, and we may pick it up (or not) later.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see this is resolved. What's the followup ticket?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bump

# 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_INIT_RETRY_ATTEMPTS" "$MONGODB_INIT_RETRY_DELAY"; then
Expand All @@ -1198,17 +1238,16 @@ mongodb_configure_secondary() {
# 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_INIT_RETRY_ATTEMPTS" "$MONGODB_INIT_RETRY_DELAY"; then
error "Secondary node did not get marked as secondary"
error "Secondary node did not get granted voting rights"
exit 1
fi
fi

# Mark node as readable. This is necessary in cases where the PVC is lost
if is_boolean_yes "$MONGODB_SET_SECONDARY_OK"; then
mongodb_execute_print_output "$MONGODB_INITIAL_PRIMARY_ROOT_USER" "$MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD" "admin" <<EOF
# Mark node as readable. This is necessary in cases where the PVC is lost
if is_boolean_yes "$MONGODB_SET_SECONDARY_OK"; then
mongodb_execute_print_output "$MONGODB_INITIAL_PRIMARY_ROOT_USER" "$MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD" "admin" <<EOF
rs.secondaryOk()
EOF
fi

fi
}

Expand Down
Empty file.
Empty file.
Empty file.
Empty file.
2 changes: 1 addition & 1 deletion solution-base/images/os-shell/debian-12/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ ENV HOME="/" \
COPY prebuildfs /
SHELL ["/bin/bash", "-o", "errexit", "-o", "nounset", "-o", "pipefail", "-c"]
# Install required system packages and dependencies
RUN /bin/bash /usr/sbin/install_packages ca-certificates curl jq procps
RUN install_packages ca-certificates curl jq procps
RUN --mount=type=secret,id=downloads_url,env=SECRET_DOWNLOADS_URL \
DOWNLOADS_URL=${SECRET_DOWNLOADS_URL:-${DOWNLOADS_URL}} ; \
mkdir -p /tmp/bitnami/pkg/cache/ ; cd /tmp/bitnami/pkg/cache/ || exit 1 ; \
Expand Down
Empty file.
Empty file.
Empty file.
9 changes: 5 additions & 4 deletions solution-base/mongodb/how_to_upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ See `solution-base/images/README.md` for details.

### Re-vendoring upstream Bitnami scripts

When upstream Bitnami script changes need to be pulled in,
compare `bitnami/containers` and merge upstream changes to `prebuildfs/` /
`rootfs/` directories into the corresponding image directories. See
`solution-base/images/README.md` for the detailed steps to upgrade the images.
When upstream Bitnami script changes need to be pulled in, bump the
`BITNAMI_<image>_REF` pin in `solution-base/images/Makefile` and run
`make -C solution-base/images vendor-sync`, which merges upstream through
`git subtree`. Do not copy files by hand. See
`solution-base/images/README.md` for the detailed steps.

## Helm Chart Upgrade Steps

Expand Down
2 changes: 1 addition & 1 deletion tests/functional/ctst/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Note : Multiple Cucumber vscode extensions are available to help with developmen

## Quick Start (Github Codespaces)

> **Prerequisites:** This assumes you're running in a GitHub Codespace with the devcontainer fully set up. See [.devcontainer/README.md](../../.devcontainer/README.md) for setup details.
> **Prerequisites:** This assumes you're running in a GitHub Codespace with the devcontainer fully set up. See [.devcontainer/README.md](../../../.devcontainer/README.md) for setup details.

Run tests with a tag:

Expand Down
Loading
Loading