Skip to content

Reduce server stalls during backup preparation - #345

Merged
boubou19 merged 6 commits into
masterfrom
algent/fix-backup-stall
Sep 20, 2026
Merged

boubou19 merged 6 commits into
masterfrom
algent/fix-backup-stall

Conversation

@Algent

@Algent Algent commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The file snapshot introduced in #343 ended up causing a bit of extra stalls on server thread during backups.

This PR reduce snapshot overhead while retaining the extra safeties we added.

Instead of copying thousands of files individually, backup preparation collects mutable data into one temporary file and avoids unnecessary filesystem calls.
Some known stable files are also read by the backup worker instead.

Local measurements

Measurement done on a local save. duration of backup task in milliseconds.

Version First backup Subsequent backups
Before #343 1,280 661-783; median 723
Post-#343 baseline 5,593 5,164
This SU branch 1,499 1,116 / 1,009
This SU branch + Hodge PR 1,194 1,094 / 775

Checklist

  • I have tested this PR in Fullpack
  • This PR is in compliance with the GTNH AI Policy

Read BQ migration backups and AE2 spawn data on the archive worker while world saving is suspended. Join the worker before mod shutdown saves; keep live data and filesystem links captured.
Use the JDK file-tree walker for unfiltered scans to avoid redundant file attribute queries on Windows. Preserve glob traversal, link handling, and backup-storage exclusion.
Keep immediate retries for backup and shutdown saves.

Consolidate backup timings into one server-thread summary and remove temporary snapshot diagnostics.
@Algent Algent added the Bug Fix Fixes a bug. Please link it in the PR if an issue exists for it. label Sep 20, 2026
NTFS enumeration can report stale sizes while writers remain open.
Read the size from the input channel and retain exact-length, CRC,
and cancellation checks.
@boubou19
boubou19 merged commit 7c510f3 into master Sep 20, 2026
1 check passed
@boubou19
boubou19 deleted the algent/fix-backup-stall branch September 20, 2026 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Fix Fixes a bug. Please link it in the PR if an issue exists for it.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants