PaperMC / PaperMC/Paper

Invalid cross-device link when world migration starts (ZFS with a dataset for the dimension targeted)

Open
#14,078 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

status: needs triage
Dominant language
Java
Stars
12.7k
Forks
3.5k
Avg merge
3d 13h
Merged PRs (30d)
11

Description

Expected behavior

Migrate world to new format

Observed/Actual behavior

Instantly hits a cross-device link error due to trying to link a file outside the filesystem boundaries.

Steps/models to reproduce
  1. Make a dataset or filesystem mountpoint for mcserver/world (or any depth down to: world/dimensions/minecraft/overworld for example)
  2. Install into mcserver/ using a papermc version from earlier this year (Say, a release for 1.21.11)
  3. Run it
  4. Stop it once some world generates
  5. Upgrade
  6. Run it
  7. Migration fails due to a hardlink attempt across different filesystems
Plugin and Datapack List

None

Paper version

26.2-38-dev/26.2@58e1f84

Previous version: 26.1.2-61-8dea6f1 (MC: 26.1.2)

(It was also 1.21.11 earlier)

Other

I think this niche problem could be solved by Paper retrying this preparation step with a traditional copy of the world data rather than making a link. Though this would not be very efficient on a CoW filesystem, it would avoid the crash. Or just checking first whether or not the copy operation would cross filesystem boundaries and choosing to not do a link. Or doing the entire conversion operation in the same directory as the world data instead of a few directories up? Not sure of the best approach.

Other 2

The dataset layout is show below and is why this problem happens in my case. I did this layout for granular control, rollback options and testing various compression options. (I'd recommend anyone else to just install CoreProtect and be done with it but I wanted to run my storage tests.)

minecraft@WanA ~ $ zfs list -r tank/minecraft/survival
NAME                                                                     USED  AVAIL  REFER  MOUNTPOINT
tank/minecraft/survival                                                 20.9G  45.6G  6.29G  /minecraft/survival
tank/minecraft/survival/logs                                            22.1M  45.6G  4.92M  /minecraft/survival/logs
tank/minecraft/survival/world                                           12.8G  45.6G  2.52M  /minecraft/survival/world
tank/minecraft/survival/world/dimensions                                7.33G  45.6G   200K  /minecraft/survival/world/dimensions
tank/minecraft/survival/world/dimensions/minecraft                      7.33G  45.6G   312K  /minecraft/survival/world/dimensions/minecraft
tank/minecraft/survival/world/dimensions/minecraft/overworld            6.18G  45.6G   924M  /minecraft/survival/world/dimensions/minecraft/overworld
tank/minecraft/survival/world/dimensions/minecraft/the_end               257M  45.6G  71.9M  /minecraft/survival/world/dimensions/minecraft/the_end
tank/minecraft/survival/world/dimensions/minecraft/the_nether            925M  45.6G   283M  /minecraft/survival/world/dimensions/minecraft/the_nether
tank/minecraft/survival/world/playerdata                                4.05M  45.6G   208K  /minecraft/survival/world/playerdata

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the world-migration preparation path and the hardlink operation involved when the world contains separately mounted ZFS datasets. Reproduce the upgrade with the dataset layout and world-generation steps described above. Done means migration completes without a cross-device-link failure while preserving the migrated world data.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.