If we identify an invalid offset (negative, or the header sectors), then back up the region file and erase that specific chunks offset data. This will avoid crashing the server with AIOBB errors and also avoids server owners having to consider the entire region file 'lost'. I'm not sure what leads to this state, I can only assume write cut off mid bits. In this scenario, there is absolutely no way to know where the chunk actually is in the data file without loading every single chunk in the file. And even to do that, would be quite extreme due to the fact the file isn't in some orderly fashion. Since the file is backed up, the user can use a region fixer tool externally to try to restore that single chunk. We could even add a command to restore a chunk from a backup file in a different commit later on. But this at least prevents the server from crashing. The server will just generate a new chunk and move on, after printing an error to the console about it. Also fixed the case reported in this issue about the server hanging when a corrupt chunk is encountered, so this issue is now fully closed. Resolves #1541
96 KiB
96 KiB