Skip to content

feat(ceph): add crash auto-archive interval - #4349

Closed
Tanguille wants to merge 4 commits into
mainfrom
feat/ceph-crash-autoarchive-v2
Closed

feat(ceph): add crash auto-archive interval#4349
Tanguille wants to merge 4 commits into
mainfrom
feat/ceph-crash-autoarchive-v2

Conversation

@Tanguille

@Tanguille Tanguille commented Aug 5, 2026

Copy link
Copy Markdown
Owner

Fix for rook/rook#18088

Summary by CodeRabbit

  • Performance & Reliability
    • Improved resource allocation for scheduled Nextcloud maintenance tasks, helping ensure more predictable execution.
    • Configured automatic archival of Ceph crash reports after one day, keeping monitoring information current and manageable.

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a68f7818-1a88-4665-98aa-128cf00b9f25

📥 Commits

Reviewing files that changed from the base of the PR and between 3829fea and a335580.

📒 Files selected for processing (1)
  • kubernetes/apps/rook-ceph/rook-ceph/cluster/helmrelease.yaml

📝 Walkthrough

Walkthrough

The change adds resource requests and limits to the Nextcloud CronJob. It also configures the Ceph manager to archive crashes after one day.

Changes

Nextcloud resource configuration

Layer / File(s) Summary
Configure CronJob resources
kubernetes/apps/default/nextcloud/app/helmrelease.yaml
The Nextcloud CronJob now requests 100m CPU and 500Mi memory. It has limits of 1 CPU and 2Gi memory.

Ceph crash archival configuration

Layer / File(s) Summary
Configure crash warning interval
kubernetes/apps/rook-ceph/rook-ceph/cluster/helmrelease.yaml
The Ceph manager now uses a mgr/crash/warn_recent_interval value of 86400 seconds.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

🚥 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 The title clearly and concisely describes the Ceph crash auto-archive configuration, which is the primary objective of the pull request.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/ceph-crash-autoarchive-v2

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

@deepsource-io

deepsource-io Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

DeepSource Code Review

We reviewed changes in 719bda4...a335580 on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
JavaScript Aug 5, 2026 10:12p.m. Review ↗
Shell Aug 5, 2026 10:12p.m. Review ↗

Important

AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.

@tanguille-cluster

tanguille-cluster Bot commented Aug 5, 2026

Copy link
Copy Markdown
@@ spec.cephConfig.global @@
# ceph.rook.io/v1/CephCluster/rook-ceph/rook-ceph
! + one map entry added:
+ mgr/crash/warn_recent_interval: "86400"

@tanguille-cluster

tanguille-cluster Bot commented Aug 5, 2026

Copy link
Copy Markdown
@@ spec.values.cronjob @@
# helm.toolkit.fluxcd.io/v2/HelmRelease/default/nextcloud
! + one map entry added:
+ resources:
+   limits:
+     cpu: 1
+     memory: 2Gi
+   requests:
+     cpu: 100m
+     memory: 500Mi

@@ spec.values.cephClusterSpec.cephConfig.global @@
# helm.toolkit.fluxcd.io/v2/HelmRelease/rook-ceph/rook-ceph-cluster
! + one map entry added:
+ mgr/crash/warn_recent_interval: "86400"

…imit

- Increase nginx.resources.limits.memory from 128Mi to 256Mi
- Increase nginx.resources.requests.memory from 64Mi to 128Mi
- Reduce PHP memory_limit from 8G to 512M
- Add CronJob resource limits (requests: 100m/500Mi, limits: 1/2Gi)

These changes address the OOMKill of nextcloud-nginx container by providing:
1. Adequate headroom for large file uploads (client_max_body_size 10G)
2. Sensible per-process PHP memory limits aligned with container constraints
3. Bounded resources for cron jobs to prevent BestEffort QoS issues
@Tanguille
Tanguille marked this pull request as ready for review August 5, 2026 07:08

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@kubernetes/apps/default/nextcloud/app/helmrelease.yaml`:
- Around line 441-447: Remove the unused resources block under the cronjob
configuration, preserving the existing cronjob.cronjob.resources settings and
using cronjob.sidecar.resources exclusively for sidecar resource limits and
requests.

In `@kubernetes/apps/rook-ceph/rook-ceph/cluster/helmrelease.yaml`:
- Around line 54-55: Correct the comment for the mgr/crash/warn_recent_interval
setting so it describes only the RECENT_CRASH warning interval, not automatic
crash archival. Do not claim this configuration archives crashes or resolves
issue `#18088`; either implement a mechanism that invokes ceph crash archive or
limit this change to the accurate warning-window description.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e5401140-ee04-442b-854a-68f14bf416c6

📥 Commits

Reviewing files that changed from the base of the PR and between faea67e and 3829fea.

📒 Files selected for processing (2)
  • kubernetes/apps/default/nextcloud/app/helmrelease.yaml
  • kubernetes/apps/rook-ceph/rook-ceph/cluster/helmrelease.yaml
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • Tanguille/LLMKube (auto-detected)
  • Tanguille/pr-reviewer-action (auto-detected)
  • Tanguille/toolhive (auto-detected)
  • Tanguille/renovate-presets (auto-detected)
  • Tanguille/litellm-operator (auto-detected)
  • Tanguille/2x-R9700-RDNA4-GFX1201-sglang-inference (auto-detected)

Comment on lines +441 to +447
resources:
requests:
cpu: 100m
memory: 500Mi
limits:
cpu: 1
memory: 2Gi

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -eu

printf '%s\n' '--- target lines ---'
sed -n '425,485p' kubernetes/apps/default/nextcloud/app/helmrelease.yaml

printf '%s\n' '--- chart/version references ---'
rg -n -C 3 'nextcloud|9\.2\.5|cronjob:' kubernetes/apps/default/nextcloud/app/helmrelease.yaml kubernetes/apps/default/nextcloud -g '*.yaml' -g '*.yml' || true

printf '%s\n' '--- cronjob resource keys in repository ---'
rg -n -C 2 'cronjob(\.cronjob)?\.resources|resources:' kubernetes/apps/default/nextcloud/app/helmrelease.yaml

Repository: Tanguille/cluster

Length of output: 40475


🏁 Script executed (no clone):

#!/bin/bash
set -eu

base='https://raw.githubusercontent.com/nextcloud/helm/nextcloud-9.2.5/charts/nextcloud'

printf '%s\n' '--- chart values ---'
curl -fsSL "$base/values.yaml" | sed -n '/^cronjob:/,/^[^ ]/p'

printf '%s\n' '--- chart templates containing cronjob resources ---'
for file in templates/cronjob.yaml templates/_helpers.tpl templates/deployment.yaml; do
  content="$(curl -fsSL "$base/$file" || true)"
  if [ -n "$content" ]; then
    printf '%s\n' "--- $file ---"
    printf '%s\n' "$content" | rg -n -C 4 'cronjob|resources' || true
  fi
done

printf '%s\n' '--- repository chart source metadata ---'
curl -fsSL 'https://api.github.com/repos/nextcloud/helm/contents/charts/nextcloud?ref=nextcloud-9.2.5' |
  jq -r '.[].name'

Length of output: 10902


🏁 Script executed:

#!/bin/bash
set -eu

python3 - <<'PY'
from pathlib import Path
from urllib.request import urlopen

release = Path("kubernetes/apps/default/nextcloud/app/helmrelease.yaml").read_text()
oci = Path("kubernetes/apps/default/nextcloud/app/ocirepository.yaml").read_text()
assert "tag: 9.2.5" in oci

base = "https://raw.githubusercontent.com/nextcloud/helm/nextcloud-9.2.5/charts/nextcloud/"
values = urlopen(base + "values.yaml").read().decode()
cronjob_template = urlopen(base + "templates/cronjob.yaml").read().decode()
deployment_template = urlopen(base + "templates/deployment.yaml").read().decode()

assert "cronjob:\n      resources:" in release
assert "cronjob:\n        failedJobsHistoryLimit:" in release
assert "resources:\n          requests:" in release

# The CronJob template enters .Values.cronjob.cronjob before resolving .resources.
assert "{{- with .Values.cronjob.cronjob }}" in cronjob_template
assert "{{- toYaml .resources | nindent 16 }}" in cronjob_template
assert ".Values.cronjob.resources" not in cronjob_template

# The sidecar uses a different, explicit path.
assert "{{- with .Values.cronjob.sidecar }}" in deployment_template
assert "{{- toYaml .resources | nindent 12 }}" in deployment_template

print("chart=9.2.5")
print("cronjob_resources_path=cronjob.cronjob.resources")
print("sidecar_resources_path=cronjob.sidecar.resources")
print("top_level_cronjob_resources_consumed=false")
PY

Repository: Tanguille/cluster

Length of output: 2441


Remove the unused cronjob.resources block.

Chart 9.2.5 reads CronJob resources from cronjob.cronjob.resources. The existing block already configures them. Use cronjob.sidecar.resources only for sidecar resources.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@kubernetes/apps/default/nextcloud/app/helmrelease.yaml` around lines 441 -
447, Remove the unused resources block under the cronjob configuration,
preserving the existing cronjob.cronjob.resources settings and using
cronjob.sidecar.resources exclusively for sidecar resource limits and requests.

Source: MCP tools

Comment on lines +54 to +55
# Auto-archive Ceph crashes after 1 day (86400 seconds)
mgr/crash/warn_recent_interval: "86400"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -eu
printf '%s\n' '--- target file ---'
nl -ba kubernetes/apps/rook-ceph/rook-ceph/cluster/helmrelease.yaml | sed -n '35,70p'
printf '%s\n' '--- related crash settings and issue references ---'
rg -n -C 3 'warn_recent_interval|crash archive|crash.*archive|18088|archive.*crash' kubernetes .github README.md 2>/dev/null || true
printf '%s\n' '--- recent file history summary ---'
git log -5 --oneline -- kubernetes/apps/rook-ceph/rook-ceph/cluster/helmrelease.yaml

Repository: Tanguille/cluster

Length of output: 1540


🌐 Web query:

Ceph mgr/crash/warn_recent_interval RECENT_CRASH archive semantics official documentation

💡 Result:

The Ceph configuration option mgr/crash/warn_recent_interval defines the time threshold used to determine whether a crash is considered "recent" [1][2]. By default, this interval is set to 2 weeks [1][3]. When a Ceph daemon crashes, the cluster reports a RECENT_CRASH health warning if there are unacknowledged crash reports that occurred within this interval [4][5]. To clear this warning and acknowledge a crash, an administrator can use the command ceph crash archive <crash-id> [5][3]. The semantics of archiving a crash report are as follows: - The crash report is no longer considered for the RECENT_CRASH health check [5][3]. - The crash report is removed from the list of new crashes (viewable via ceph crash ls-new) [5][3]. - The crash report remains in the system and is still accessible via the ceph crash ls command [5][3]. Crash reports are automatically purged from the cluster after the duration specified by the mgr/crash/retain_interval option, which defaults to 1 year [1][3].

Citations:


🌐 Web query:

Rook issue 18088 automatic archive Ceph crashes

💡 Result:

The issue referred to as Rook PR #18011, titled "osd: archive crash on OSD removal," addresses a bug in the Rook-Ceph crash management logic where the automatic archiving of crash reports for removed OSDs was failing [1]. In Ceph, the RECENT_CRASH health warning persists until crash reports are acknowledged (archived), even if the daemon causing the crash has been removed [2]. Rook is designed to automatically archive these crashes when an OSD is removed to prevent stale health warnings [1][3]. The bug in issue #18011 involved an inverted guard condition in the code responsible for this process [1]: 1. The code incorrectly attempted to archive crashes only if the crash list was nil, which is the opposite of the intended logic [1]. 2. Because ceph crash ls typically returns a non-nil slice, the archiving loop was effectively unreachable, causing the RECENT_CRASH warning to persist indefinitely after OSD removals [1]. 3. The PR also addressed latent issues where attempts to archive an empty crash ID (or crashes that did not match the removed OSD) could lead to spurious errors from the Ceph manager [1]. To resolve this, the fix implemented a corrected guard (len(crash) == 0) and improved the robustness of the archive loop to ensure that all matching crash entries are correctly processed and acknowledged [1]. This ensures that once an OSD is removed, the associated RECENT_CRASH warning is cleared as expected [1].

Citations:


🏁 Script executed:

#!/bin/bash
set -eu
printf '%s\n' '--- target file ---'
awk '{printf "%5d %s\n", NR, $0}' kubernetes/apps/rook-ceph/rook-ceph/cluster/helmrelease.yaml | sed -n '35,75p'
printf '%s\n' '--- commit introducing the setting ---'
git show --format=fuller --stat --no-renames b7913a4
git show --format= --no-ext-diff b7913a4 -- kubernetes/apps/rook-ceph/rook-ceph/cluster/helmrelease.yaml
printf '%s\n' '--- Rook version and CephCluster references ---'
rg -n -C 3 'rook-ceph|v1\.20\.3|CephCluster|config:|mgr/crash' kubernetes/apps/rook-ceph

Repository: Tanguille/cluster

Length of output: 18961


🏁 Script executed (no clone):

#!/bin/bash
set -eu
for endpoint in \
  'https://api.github.com/repos/rook/rook/issues/18088' \
  'https://api.github.com/repos/rook/rook/pulls/18088' \
  'https://api.github.com/repos/rook/rook/issues/18011' \
  'https://api.github.com/repos/rook/rook/pulls/18011'
do
  printf '\n--- %s ---\n' "$endpoint"
  curl -fsSL "$endpoint" | jq '{number,title,state,html_url,body}'
done

Length of output: 7983


🏁 Script executed (no clone):

#!/bin/bash
set -eu
curl -fsSL 'https://docs.ceph.com/en/latest/mgr/crash/' |
  sed -n '/warn_recent_interval/,+8p;/retain_interval/,+5p' |
  head -80

Length of output: 1027


Do not describe this setting as automatic crash archival.

mgr/crash/warn_recent_interval only controls the RECENT_CRASH warning window. It does not invoke ceph crash archive or move crash reports to the archived set. This change does not implement issue #18088. Use a mechanism that invokes ceph crash archive, or update the comment and objective to describe the warning interval only.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@kubernetes/apps/rook-ceph/rook-ceph/cluster/helmrelease.yaml` around lines 54
- 55, Correct the comment for the mgr/crash/warn_recent_interval setting so it
describes only the RECENT_CRASH warning interval, not automatic crash archival.
Do not claim this configuration archives crashes or resolves issue `#18088`;
either implement a mechanism that invokes ceph crash archive or limit this
change to the accurate warning-window description.

Source: MCP tools

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

AI Automated Review

Analysis engine: omniroute@http://litellm.ai.svc.cluster.local/v1 (openai)

Recommendation: request_changes — the Ceph change itself is correct and correct, but the PR mixes an unrelated Nextcloud change into a feat(ceph) PR and adds a duplicate resources block.

Change-by-change findings

kubernetes/apps/rook-ceph/rook-ceph/cluster/helmrelease.yaml

  • mgr/crash/warn_recent_interval: "86400" is a valid Ceph config key placed under cephConfig.global, matching the linked rook/rook PR 18088 intent to auto-archive crashes after one day. The comment and value are correct. No issue with this change.

kubernetes/apps/default/nextcloud/app/helmrelease.yaml

  • The PR adds a cronjob.resources block (cpu 100m/500Mi requests, 1/2Gi limits) that duplicates the existing cronjob.cronjob.resources block with identical values. One of the two is dead depending on the chart schema; the duplicate should be reconciled.
  • The PR title and body are exclusively about Ceph, but this Nextcloud change is unrelated. Per the repo convention to keep changes small and focused, it should be split into its own PR.

Standards Compliance

  • AGENTS.md requires keeping changes small and focused; the Nextcloud change violates that by riding along in a Ceph PR.
  • Learned preferences say to only adjust workloads that already have an explicit resources block; the cronjob already had one (the nested block), so the new block is a duplicate rather than a new allocation.
  • No secrets, no shell scripts, no version bumps — no other conventions implicated.

Tool Harness Findings

  • The tool loop issued no tool calls; the corpus was reviewed directly. No evidence gathered.

Unknowns / Needs Verification

  • The rook/rook PR 18088 issue content was not verified (GitHub issue fetch skipped). The change is consistent with the PR body's description.
  • The Nextcloud chart schema for cronjob.resources vs cronjob.cronjob.resources was not verified from the corpus; the duplicate block is flagged as a minor finding.

Release notes

  • No dependency or version bumps in this PR; no release notes apply.

github-actions[bot]

This comment was marked as outdated.

@Tanguille Tanguille closed this Aug 5, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Inline findings from the automated review (summary in the sticky comment).

cronjob:
enabled: true
type: cronjob
resources:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Major (question): This PR is titled feat(ceph) and its body only discusses the Ceph crash auto-archive change, yet it also adds a Nextcloud cronjob resources block — an unrelated change that should be split into its own PR per the repo convention to keep changes small and focused.

Automated finding from AI PR review.

cronjob:
enabled: true
type: cronjob
resources:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Minor (style): The new cronjob.resources block duplicates the existing cronjob.cronjob.resources block with identical values; one of the two is dead config depending on the chart schema — reconcile to a single block and remove the dead one.

Automated finding from AI PR review.

Tanguille added a commit that referenced this pull request Aug 6, 2026
PR #4349 emitted "Release notes: no release notes apply" and "Tool Harness
Findings: the tool loop issued no tool calls" on a two-file Ceph change. The
release-notes instruction fired on every PR regardless of whether anything was
bumped; gate it on a version change and tell the reviewer to drop empty sections.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant