From 654a1316207fce9e1887df34e94c75b0f6afe898 Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Sun, 12 Jan 2020 13:06:05 -0800 Subject: [PATCH] Add more chunk debug to watchdog (#2851) print chunk holder status, useful for indicating what steps the server has gone through after loading chunks from disk Also rebuild patches (cat...) --- ...95-Asynchronous-chunk-IO-and-loading.patch | 35 +++++++++++++++---- ...imise-IEntityAccess-getPlayerByUUID.patch} | 4 +-- 2 files changed, 30 insertions(+), 9 deletions(-) rename Spigot-Server-Patches/{0422-Optimise-IEntityAccess-getPlayerByUUID.patch => 0423-Optimise-IEntityAccess-getPlayerByUUID.patch} (95%) diff --git a/Spigot-Server-Patches/0395-Asynchronous-chunk-IO-and-loading.patch b/Spigot-Server-Patches/0395-Asynchronous-chunk-IO-and-loading.patch index 2cd5a72c6..cfb55b5c3 100644 --- a/Spigot-Server-Patches/0395-Asynchronous-chunk-IO-and-loading.patch +++ b/Spigot-Server-Patches/0395-Asynchronous-chunk-IO-and-loading.patch @@ -1,4 +1,4 @@ -From 4208dd633a9e5175b7eb7db8f090e21e35c9dd9d Mon Sep 17 00:00:00 2001 +From d6ca62d0cc96ae7d4d4ae5547bdc75daafe401e6 Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Sat, 13 Jul 2019 09:23:10 -0700 Subject: [PATCH] Asynchronous chunk IO and loading @@ -1901,10 +1901,10 @@ index 000000000..1dfa8abfd +} diff --git a/src/main/java/com/destroystokyo/paper/io/chunk/ChunkTaskManager.java b/src/main/java/com/destroystokyo/paper/io/chunk/ChunkTaskManager.java new file mode 100644 -index 000000000..59d73bfad +index 000000000..715a2dd8d --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/io/chunk/ChunkTaskManager.java -@@ -0,0 +1,453 @@ +@@ -0,0 +1,455 @@ +package com.destroystokyo.paper.io.chunk; + +import com.destroystokyo.paper.io.PaperFileIOThread; @@ -2006,8 +2006,10 @@ index 000000000..59d73bfad + PaperFileIOThread.LOGGER.log(Level.ERROR, "Chunk Holder - null"); + } else { + IChunkAccess chunk = chunkHolder.getAvailableChunkNow(); ++ net.minecraft.server.ChunkStatus holderStatus = chunkHolder.getChunkHolderStatus(); + PaperFileIOThread.LOGGER.log(Level.ERROR, "Chunk Holder - non-null"); + PaperFileIOThread.LOGGER.log(Level.ERROR, "Chunk Status - " + ((chunk == null) ? "null chunk" : chunk.getChunkStatus().toString())); ++ PaperFileIOThread.LOGGER.log(Level.ERROR, "Chunk Holder Status - " + ((holderStatus == null) ? "null" : holderStatus.toString())); + } + + } @@ -3008,10 +3010,29 @@ index ed8c4a87b..996c83263 100644 return this.a == null ? new NibbleArray() : new NibbleArray((byte[]) this.a.clone()); } diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java -index 7a1578afa..0fb9c1e44 100644 +index 7a1578afa..d26365eb1 100644 --- a/src/main/java/net/minecraft/server/PlayerChunk.java +++ b/src/main/java/net/minecraft/server/PlayerChunk.java -@@ -310,7 +310,7 @@ public class PlayerChunk { +@@ -83,6 +83,18 @@ public class PlayerChunk { + } + return null; + } ++ ++ public ChunkStatus getChunkHolderStatus() { ++ for (ChunkStatus curr = ChunkStatus.FULL, next = curr.getPreviousStatus(); curr != next; curr = next, next = next.getPreviousStatus()) { ++ CompletableFuture> future = this.getStatusFutureUnchecked(curr); ++ Either either = future.getNow(null); ++ if (either == null || !either.left().isPresent()) { ++ continue; ++ } ++ return curr; ++ } ++ return null; ++ } + // Paper end + + public CompletableFuture> getStatusFutureUnchecked(ChunkStatus chunkstatus) { +@@ -310,7 +322,7 @@ public class PlayerChunk { ChunkStatus chunkstatus = getChunkStatus(this.oldTicketLevel); ChunkStatus chunkstatus1 = getChunkStatus(this.ticketLevel); boolean flag = this.oldTicketLevel <= PlayerChunkMap.GOLDEN_TICKET; @@ -3020,7 +3041,7 @@ index 7a1578afa..0fb9c1e44 100644 PlayerChunk.State playerchunk_state = getChunkState(this.oldTicketLevel); PlayerChunk.State playerchunk_state1 = getChunkState(this.ticketLevel); // CraftBukkit start -@@ -340,6 +340,12 @@ public class PlayerChunk { +@@ -340,6 +352,12 @@ public class PlayerChunk { } }); @@ -4114,5 +4135,5 @@ index 07936eeba..fe68df45b 100644 log.log( Level.SEVERE, "------------------------------" ); // -- -2.24.1 +2.24.1.windows.2 diff --git a/Spigot-Server-Patches/0422-Optimise-IEntityAccess-getPlayerByUUID.patch b/Spigot-Server-Patches/0423-Optimise-IEntityAccess-getPlayerByUUID.patch similarity index 95% rename from Spigot-Server-Patches/0422-Optimise-IEntityAccess-getPlayerByUUID.patch rename to Spigot-Server-Patches/0423-Optimise-IEntityAccess-getPlayerByUUID.patch index 245a3fbfa..2ae9f5b42 100644 --- a/Spigot-Server-Patches/0422-Optimise-IEntityAccess-getPlayerByUUID.patch +++ b/Spigot-Server-Patches/0423-Optimise-IEntityAccess-getPlayerByUUID.patch @@ -1,4 +1,4 @@ -From f30c7d9a67da1929516f92711d6dd7e8b69ead6e Mon Sep 17 00:00:00 2001 +From a5463b6d5022e62cc68e44454be6da47e0f735c5 Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Sat, 11 Jan 2020 21:50:56 -0800 Subject: [PATCH] Optimise IEntityAccess#getPlayerByUUID @@ -43,5 +43,5 @@ index 70cbff313..8526a3fda 100644 public final com.destroystokyo.paper.io.PaperFileIOThread.ChunkDataController poiDataController = new com.destroystokyo.paper.io.PaperFileIOThread.ChunkDataController() { @Override -- -2.24.1 +2.24.1.windows.2