Skip to content

Commit 893ea74

Browse files
committed
Make stage 2 chunk unload utilise I/O future write
When the I/O scheduler was rewritten, it was designed to take writes as futures (i.e. CallbackCompletable, Completable). We can utilise this functionality in entity and chunk unloading. Provided that the write is scheduled during stage 3, we can remove the unload tasks - even if the write value is not yet ready. For entity chunk unloading, when the entity chunk is transient it needs to load the current data on-disk to save. We can create a write future which depends on the result from loading the current data from disk. The previous behavior was to perform a blocking read on the chunk data, as the previous behavior was designed with an I/O scheduler which could not perform future writes. For chunk unloading, the logic already issues a future value write. The only changes made are to forward exceptions to the I/O thread and to move the unload task completion to the stage 2 function itself (which additionally avoids a double write schedule). With these changes, all of chunk, entity, and poi tasks issue an I/O write during unload (unless there is nothing to write). This allows for all of the unload tasks to be removed during stage 3. Additionally, make the I/O scheduler properly handle exceptions from future writes - print the exception and avoid the write. Previously, the behavior was to not print an exception and to delete the data from disk. The main benefit from these changes is that transient entity chunk unloads no longer issue a blocking read from disk. Tuinity/Moonrise#144 Tuinity/Moonrise#146
1 parent e8c6ba5 commit 893ea74

File tree

4 files changed

+177
-176
lines changed

4 files changed

+177
-176
lines changed

0 commit comments

Comments
 (0)