Skip to content

fix(harbor): guarantee CPU for redis sentinels - #3446

Merged
Aleksei Sviridkin (lexfrei) merged 3 commits into
mainfrom
fix/harbor-sentinel-convergence
Jul 28, 2026
Merged

Aleksei Sviridkin (lexfrei) merged 3 commits into
mainfrom
fix/harbor-sentinel-convergence

Conversation

@lexfrei

@lexfrei Aleksei Sviridkin (lexfrei) commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

What this PR does

The harbor e2e suite intermittently times out on the harbor-test HelmRelease because the bundled Redis Sentinel set does not converge in time. Sentinels are NotReady by design until the redis-operator elects a master and rewrites their monitored-master config. Normal convergence is 2-3 minutes; on a CPU-contended e2e runner the tail stretches past the old 6m assert.

Three changes:

  • packages/system/harbor: the inline RedisFailover ran its three sentinels at 50m CPU request / 100m limit. Now they run at Guaranteed QoS (requests == limits, 250m CPU / 128Mi), so master election gets scheduling shares and is not throttled under node contention. A helm unit test pins the sizing. This reserves 750m CPU / 384Mi per Harbor instance for the sentinel trio, up from 150m / 192Mi requested, paid by every install. It also diverges from the standalone redis app on purpose: its preset-based sentinels are Burstable with a 25m CPU request, and matching that would lower the request and make contention worse.
  • harbor e2e suite: on failure the catch now collects the redis-operator log, a describe of the RedisFailover, and the rfr-/rfs- pod states and logs. None of these were collected before, so a non-converging sentinel set was undiagnosable from the artifacts. The harbor-test HelmRelease wait grows from 6m to 10m, same as the harbor-test-system budget in the same suite and the documented longer-wait allowance for harbor.
  • docs and hack: three copies of a wrong claim that the pinned Chainsaw podLogs collector "exposes only container/tail/selector" are corrected. It accepts name/namespace/selector/container/tail/timeout plus the cluster fields; only previous is missing. The wrong list steered catch authors toward imperative scripts for captures podLogs handles declaratively.

Caveat: the failing run carried no CPU metrics, so the resource fix is mechanism-backed (CFS shares cycles proportionally to requests), not metric-proven. If the flake recurs, the new diagnostics show which reconcile gate stalled.

Closes #3445

Screenshots

Not a UI change.

Downstream repositories

Trigger-map walk against the diff: packages/system/harbor/ (template and tests) is not in the website app lists (those cover packages/apps/ and packages/extra/) and touches no values.schema.json, no values keys, no ApplicationDefinition. hack/e2e-chainsaw/ and hack/e2e-capture-previous-logs.sh appear in no trigger. docs/agents/e2e-testing.md is repo-internal agent documentation. Node prerequisites, hack/package.mk, and namespaces are untouched.

Release note

fix(harbor): the bundled Redis Sentinel pods now run with guaranteed resources (250m CPU / 128Mi, requests == limits) so the HA set converges reliably on CPU-contended nodes

Summary by CodeRabbit

  • Bug Fixes
    • Increased Redis Sentinel CPU and memory requests/limits to improve reliability during node contention.
    • Extended Harbor readiness timing for RedisFailover to reduce false failures during initialization.
  • Diagnostics
    • Improved Harbor e2e failure output by adding RedisFailover-specific details and collecting relevant Redis operator/pod logs, plus best-effort runtime log capture during readiness stalls.
  • Tests
    • Added a Redis Sentinel sizing test suite to verify the updated request/limit values.
  • Documentation
    • Clarified guidance on capturing logs for previous container instances in e2e runs, including what gets captured and when.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@github-actions github-actions Bot added size/M This PR changes 30-99 lines, ignoring generated files area/storage Issues or PRs related to storage (linstor, seaweedfs, bucket, velero, harbor) kind/bug Categorizes issue or PR as related to a bug labels Jul 23, 2026
@dosubot dosubot Bot added the area/testing Issues or PRs related to testing (e2e, bats, unit tests) label Jul 23, 2026
@coderabbitai

coderabbitai Bot commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 9e7f5ba4-b2d2-4660-9da9-d08be2fb1c25

📥 Commits

Reviewing files that changed from the base of the PR and between e4d015e and a7ce437.

📒 Files selected for processing (6)
  • docs/agents/e2e-testing.md
  • hack/e2e-capture-previous-logs.sh
  • hack/e2e-chainsaw/.chainsaw.yaml
  • hack/e2e-chainsaw/harbor/chainsaw-test.yaml
  • packages/system/harbor/templates/redis.yaml
  • packages/system/harbor/tests/redis_test.yaml
🚧 Files skipped from review as they are similar to previous changes (4)
  • packages/system/harbor/tests/redis_test.yaml
  • packages/system/harbor/templates/redis.yaml
  • hack/e2e-chainsaw/harbor/chainsaw-test.yaml
  • hack/e2e-capture-previous-logs.sh

📝 Walkthrough

Walkthrough

Harbor Redis Sentinel resources are increased and covered by a new test. Harbor failure handling now collects RedisFailover diagnostics and allows a longer readiness wait. Previous-container log collection behavior is clarified in documentation and comments.

Changes

Harbor Redis reliability

Layer / File(s) Summary
Redis Sentinel resource sizing
packages/system/harbor/templates/redis.yaml, packages/system/harbor/tests/redis_test.yaml
Sentinel CPU requests and limits are set to 250m, memory requests and limits to 128Mi, with assertions covering the rendered values.
Harbor readiness diagnostics
hack/e2e-chainsaw/harbor/chainsaw-test.yaml, docs/agents/e2e-testing.md, hack/e2e-capture-previous-logs.sh, hack/e2e-chainsaw/.chainsaw.yaml
The failure catch collects RedisFailover and Redis operator pod diagnostics, the Harbor readiness timeout increases from 6 to 10 minutes, and comments document podLogs and crust-gather previous-log behavior.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related issues

Possibly related PRs

Suggested reviewers: androndo, ivanhunters, kvaps, lllamnyp, sircthulhu

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed It accurately summarizes the main change: Redis sentinels get guaranteed CPU, which matches the primary fix.
Linked Issues check ✅ Passed The PR addresses #3445 by giving Harbor Redis sentinels Guaranteed QoS and adding diagnostics and a longer wait for convergence.
Out of Scope Changes check ✅ Passed All changes support the Harbor Redis Sentinel readiness issue; no unrelated features or code paths were introduced.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/harbor-sentinel-convergence

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@myasnikovdaniil myasnikovdaniil left a comment

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.

LGTM — every claim checks out.

Business context: Harbor's bundled Redis Sentinels stay NotReady until the operator elects a master; on CPU-contended runners that convergence tail exceeded the 6m assert and timed out the harbor-test HelmRelease.

  • The sentinel resource bump to requests == limits (250m CPU / 128Mi) produces Guaranteed QoS, which is what buys the scheduling shares and eviction priority the master election needs under contention.
  • The new tests/redis_test.yaml actually runs in CI — packages/system/harbor/Makefile has a test: helm unittest . target — and passes (8 tests). documentIndex: 1 is correct: redis.yaml renders the Secret as document 0 and the RedisFailover as document 1.
  • The podLogs capability correction (three copies) is accurate, and the 6m→10m wait matches the sibling harbor-test-system budget and the documented longer-wait allowance.

No blockers. As the PR body notes, the sizing is mechanism-backed (CFS shares scale with requests) rather than metric-proven, and it costs an extra 600m CPU / 192Mi requested per Harbor instance; the new failure-path diagnostics (RedisFailover describe, operator and rfr-/rfs- pod logs) are the right hedge if the flake recurs.

The inline RedisFailover ran its three sentinels at 50m CPU request and
a 100m limit. Sentinels only become Ready after the redis-operator
elects a master and rewrites their monitored-master config, and on a
CPU-contended node CFS shares cycles proportionally to the request, so
underprovisioned sentinels converge slowly and delay harbor readiness
behind them. Raise the sentinels to Guaranteed QoS (requests equal
limits, 250m CPU / 128Mi) so election is never starved or throttled
under load. The redis data container is unchanged.

Assisted-By: Claude <[email protected]>
Signed-off-by: Aleksei Sviridkin <[email protected]>
When harbor's redis sentinels never converge, the suite times out on
the HelmRelease assert with no evidence of why: the catch pod-log
selector matches neither the redis-operator (it runs in another
namespace) nor the rfr-/rfs- pods, and the RedisFailover CRD ships no
status subresource to describe-assert on. Add a RedisFailover describe
plus a best-effort script that dumps the operator log and the
rfr-/rfs- pod states and logs, so the stalled reconcile gate is
visible in the failure output.

Also widen the harbor-test HR wait from 6m to 10m: readiness is gated
on the operator electing a redis master, which normally takes 2-3m but
runs long on a CPU-committed runner. This matches the
harbor-test-system budget in the same suite and the justified longer
waits allowed by the e2e conventions.

Assisted-By: Claude <[email protected]>
Signed-off-by: Aleksei Sviridkin <[email protected]>
The e2e conventions, the previous-logs capture script, and the global
chainsaw catch all claimed the v0.2.15 podLogs collector exposes only
container/tail/selector. It also accepts name, namespace, timeout and
the cluster fields; only the previous option is genuinely missing. The
wrong list steers catch authors toward imperative scripts for
cross-namespace log capture that podLogs handles declaratively.

Assisted-By: Claude <[email protected]>
Signed-off-by: Aleksei Sviridkin <[email protected]>
@lexfrei
Aleksei Sviridkin (lexfrei) force-pushed the fix/harbor-sentinel-convergence branch from e4d015e to a7ce437 Compare July 27, 2026 19:48
@lexfrei
Aleksei Sviridkin (lexfrei) merged commit bea9a2b into main Jul 28, 2026
21 of 22 checks passed
@lexfrei
Aleksei Sviridkin (lexfrei) deleted the fix/harbor-sentinel-convergence branch July 28, 2026 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/storage Issues or PRs related to storage (linstor, seaweedfs, bucket, velero, harbor) area/testing Issues or PRs related to testing (e2e, bats, unit tests) kind/bug Categorizes issue or PR as related to a bug size/M This PR changes 30-99 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

e2e: harbor suite flakes when rfs-harbor-test-redis Sentinel HA never reaches readiness

2 participants