Skip to content

fix(dav): move orphan cleaning logic to a chunked background job - #52589

Merged
st3iny merged 1 commit into
masterfrom
fix/dav/orphan-cleanup-job
May 5, 2025
Merged

fix(dav): move orphan cleaning logic to a chunked background job#52589
st3iny merged 1 commit into
masterfrom
fix/dav/orphan-cleanup-job

Conversation

@st3iny

@st3inyst3iny commented May 2, 2025

Copy link
Copy Markdown
Member

Summary

It is not required to run the orphan cleanup synchronously during upgrades. I moved it to an async background job to be run some time after the repair jobs ran.

  1. Move cleaning up orphaned CalDAV and CardDAV children to an async background job.
  2. Chunk it to batches of 1000 to mitigate excessive RAM usage on large instances.

Checklist

@st3inyst3iny added bug 3. to review Waiting for reviews feature: dav performance 🚀 feature: caldav Related to CalDAV internals feature: carddav Related to CardDAV internals labels May 2, 2025
@st3inyst3iny added this to the Nextcloud 32 milestone May 2, 2025
@st3iny
st3iny requested a review from a team as a code ownerMay 2, 2025 12:29
@st3iny
st3iny requested review from ArtificialOwl, come-nc and icewind1991 and removed request for a teamMay 2, 2025 12:29
Comment threadapps/dav/lib/BackgroundJob/CleanupOrphanedChildrenJob.php Outdated
@st3iny

Copy link
Copy Markdown
MemberAuthor

/backport to stable30

@st3iny

Copy link
Copy Markdown
MemberAuthor

/backport to stable31

Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
@st3iny
st3inyforce-pushed the fix/dav/orphan-cleanup-job branch from e9b96c9 to d0fcb7eCompareMay 5, 2025 10:13
@st3iny

Copy link
Copy Markdown
MemberAuthor

I rebased and squashed. Nothing else changed.

@st3iny
st3iny enabled auto-merge May 5, 2025 10:13
@st3inyst3iny added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels May 5, 2025
@st3iny
st3iny merged commit 4783459 into masterMay 5, 2025
@st3iny
st3iny deleted the fix/dav/orphan-cleanup-job branch May 5, 2025 10:32
@backportbot

Copy link
Copy Markdown

The backport to stable31 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable31
git pull origin stable31
# Create the new backport branch
git checkout -b backport/52589/stable31
# Cherry pick the change from the commit sha1 of the change against the default branch# This might cause conflicts, resolve them
git cherry-pick d0fcb7e6
# Push the cherry pick commit to the remote repository and open a pull request
git push origin backport/52589/stable31

Error: Failed to clone repository: Failed to clone and cache repo: Error: spawn ENOTCONN


Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

@backportbot

Copy link
Copy Markdown

The backport to stable30 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable30
git pull origin stable30
# Create the new backport branch
git checkout -b backport/52589/stable30
# Cherry pick the change from the commit sha1 of the change against the default branch# This might cause conflicts, resolve them
git cherry-pick d0fcb7e6
# Push the cherry pick commit to the remote repository and open a pull request
git push origin backport/52589/stable30

Error: Failed to clone repository: Failed to clone and cache repo: Error: spawn ENOTCONN


Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

@st3iny

Copy link
Copy Markdown
MemberAuthor

/backport to stable30

@backportbot

Copy link
Copy Markdown

The backport to stable30 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable30
git pull origin stable30
# Create the new backport branch
git checkout -b backport/52589/stable30
# Cherry pick the change from the commit sha1 of the change against the default branch# This might cause conflicts, resolve them
git cherry-pick d0fcb7e6
# Push the cherry pick commit to the remote repository and open a pull request
git push origin backport/52589/stable30

Error: Failed to clone repository: Failed to clone and cache repo: Error: spawn ENOTCONN


Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

@st3iny

Copy link
Copy Markdown
MemberAuthor

/backport to stable31

@st3iny

Copy link
Copy Markdown
MemberAuthor

/backport to stable30

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4. to releaseReady to be released and/or waiting for tests to finishbugfeature: caldavRelated to CalDAV internalsfeature: carddavRelated to CardDAV internalsfeature: davperformance 🚀

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Upgrade 30.0.10 to 31.04 (dav) requires 6GB of RAM on single-user instance

4 participants

@st3iny@come-nc@SebastianKrupinski@skjnldsv