pub enum IOTask {
ReplaceRange {
truncate_from: u64,
new_entries: Vec<Entry>,
done: Sender<Result<()>>,
},
Purge {
cutoff: LogId,
done: Sender<()>,
},
Reset {
done: Sender<Result<()>>,
},
Flush(Sender<Result<()>>),
Shutdown,
}Expand description
IO tasks for the dedicated raft-io thread.
All blocking storage operations route through this channel so they never run on tokio worker threads or the Raft event loop.
Variants§
ReplaceRange
Atomically truncate from truncate_from then persist new_entries.
Conflict-resolution path: truncate + write are a single atomic IO unit.
done is signalled after the IO thread finishes the replace so callers
can flush() knowing the truncation is durable.
Purge
Purge log entries up to cutoff from storage.
Reset
Reset log storage (snapshot install). Routes through IO thread so reset never runs on the Raft event loop.
Flush(Sender<Result<()>>)
Persist any pending entries then fsync. The IO thread sends the fsync
result (Ok or Err) back to the caller via the oneshot channel.
Replaces the former FlushNow + WaitDurable two-message dance.
Shutdown
Shutdown the IO thread
Trait Implementations§
Auto Trait Implementations§
impl Freeze for IOTask
impl !RefUnwindSafe for IOTask
impl Send for IOTask
impl Sync for IOTask
impl Unpin for IOTask
impl UnsafeUnpin for IOTask
impl !UnwindSafe for IOTask
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request