[PR #3902] [MERGED] Stamp DataVersion only after the world data is upgraded #5279

Closed
opened 2026-11-03 05:11:28 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3902
Author: @DUzzL
Created: 10/29/2026
Status: ✅ Merged
Merged: 10/30/2026
Merged by: @ludovic111

Base: main ← Head: fix/issue-3882-defer-dataversion-stamp


📝 Commits (1)

  • 4269899 Stamp the current DataVersion only after the world data is upgraded

📊 Changes

1 file changed (+54 additions, -4 deletions)

View changed files

📝 crates/horizon-world/src/datafix/files.rs (+54 -4)

📄 Description

🤖 Opened by DUzzL's AI agent, not by DUzzL personally.

Fixes #3882

upgrade_world wrote level.dat at the current DataVersion (in fix_world_files) before upgrade_world_data converted the chunks, entities and saved data. If the conversion failed, the next open saw the current version and never retried.

The file fixes still run first (the data upgrade needs the new layout), but the final level.dat write is now deferred until the data upgrade succeeded. fix_world_files keeps its behaviour for other callers.

Test: datafix::files::upgrade_tests::failed_upgrade_keeps_old_data_version (a failing upgrade keeps the old DataVersion; the retry stamps the current one). cargo test -p horizon-world --lib datafix and cargo clippy -p horizon-world --lib --tests -D warnings pass.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/3902 **Author:** [@DUzzL](https://github.com/DUzzL) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/issue-3882-defer-dataversion-stamp` --- ### 📝 Commits (1) - [`4269899`](https://github.com/horizon-rust/horizon/commit/4269899778ff49bec6d72cb70b8add0406305e28) Stamp the current DataVersion only after the world data is upgraded ### 📊 Changes **1 file changed** (+54 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-world/src/datafix/files.rs` (+54 -4) </details> ### 📄 Description > 🤖 Opened by DUzzL's AI agent, not by DUzzL personally. Fixes #3882 `upgrade_world` wrote `level.dat` at the current DataVersion (in `fix_world_files`) before `upgrade_world_data` converted the chunks, entities and saved data. If the conversion failed, the next open saw the current version and never retried. The file fixes still run first (the data upgrade needs the new layout), but the final `level.dat` write is now deferred until the data upgrade succeeded. `fix_world_files` keeps its behaviour for other callers. Test: `datafix::files::upgrade_tests::failed_upgrade_keeps_old_data_version` (a failing upgrade keeps the old DataVersion; the retry stamps the current one). `cargo test -p horizon-world --lib datafix` and `cargo clippy -p horizon-world --lib --tests -D warnings` pass. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:11:28 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#5279
No description provided.