Starting from 23w44a, the world freezes every time it saving, this didn't happen before 23w43b
(Using fabric + spark mod to analyze on old snapshots as there are no TPS debug chart)
Steps to reproduce:
Method 1:
1. Start a server and join.
2. Wait until autosave.
Method 2:
1. Start a server and join.
2. Use save-all command.
Linked issues
relates to 1
Attachments
Comments 9
Can confirm this. Additionally, if you have a scoreboard.dat file with more than 500K entries in PlayerScores, the server will freeze for several seconds trying to save the file
So we've just updated our server to 1.21 (from 1.20.2) and started getting lag spikes, once I figured out it was every 5 minutes I ran a spark trace to figure out it was the save that was causing issues. I've replicated the issue in vanilla and used the perf command to generate the logs - 2024-06-26_08_59_36-LTSWorld-1_21.zip
Something's taking too long! 'root.nextTickWait./save-all.execute save-all' took aprox 835.76711 ms
Something's taking too long! 'root.nextTickWait./save-all' took aprox 836.669464 ms
Something's taking too long! 'root.nextTickWait' took aprox 851.313009 ms
Something's taking too long! 'root' took aprox 857.481981 ms
I can share the world also but a) it's over 8gb zipped up, it's a long term save I don't want other's being able to download so I would need to find a way to share privately with the mojang team.
For now I've turned off auto save by doing /save-off and I've created a routine on the server to do a /save-all once every 15 minutes, we still get the lag spike but at least it's less regular.
Yes, with substantial command storage usage from datapacks (using /data modify storage), the server also freezes for several seconds.
They added which shows in multiple logs as "newAi" and it causes a variety of tick issues. Also a little bit of this is caused by lighting I just found out.
I create a fabric mod to analyze: https://github.com/AquatomicMC/MC270159
It seems because Files.newOutputStream with StandardOpenOption.SYNC takes a lot of time to close
and It has a workaround to revert it back to FileOutputStream
Confirmed!