Skip to content

Consensus WAL should not block upon asynchronous writes #1435

Description

@cason

Appending inputs to the WAL is handled by the following code snippet, which is blocking:

Effect::WalAppend(height, entry, r) => {
self.wal_append(height, entry, state.phase).await?;
Ok(r.resume_with(()))
}

which ends up in the following call to the actor/thread operating the WAL, which is also synchronous:

        let result = ractor::call!(self.wal, WalMsg::Append, height, entry);

The write action performed by the WalMsg::Append message, however, is asynchronous by definition, as synchronous writes, which are less frequent use the WalMsg::Flush message.

The main reason to make the consensus routine to wait for the reply of the WAL routine is error handling. But this possibly can be implemented in a more efficient way.

Metadata

Metadata

Assignees

Labels

coreRelated to the core consensus implementationperformancePerformance tracking and optimizationswal

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions