danielealbano / cachegrand

cachegrand - a modern data ingestion, processing and serving platform built for today's hardware
BSD 3-Clause "New" or "Revised" License
975 stars 34 forks source link

Add support for io_uring queues cancellation #351

Closed danielealbano closed 1 year ago

danielealbano commented 1 year ago

To properly implement the database snapshotting, the pending I/O operation need to be cancelled without terminating the ring itself as this is needed to carry out the I/O operations to generate the database snapshot.

This will require introducing an ad hoc flow in the events processing loop that, upon the termination request, will:

A new config flag has to be added to control this behaviour as the second and third step must be carried out only if a snapshot on shutdown is requested.

Potentially on more recent kernels it's possible to issue a cancellation request with the flag IORING_ASYNC_CANCEL_ANY

More info at https://man7.org/linux/man-pages/man3/io_uring_prep_cancel64.3.html

danielealbano commented 1 year ago

This functionality has been implemented in v0.4 using an alternative approach therefore it's not necessary anymore.