Skip to content

Use an RWMutex to deserialize vote collection

Patrick Steinhardt requested to merge pks-transactions-rwmutex into master

We're currently using a simple mutex to protect votes of a transaction. This was fine before moving to a scheme that's allowed to commit with a subset of nodes failing as we knew that nobody would modify votes after the last vote was cast and thus we didn't require any locking when collecting votes. But now, each node needs to establish whether its own vote has succeeded, which may happen even if some votes are still missing when a majority was established already. As a result, vote collection is now essentially serialized.

Fix the issue by using an rwmutex instead of a simple one. This allows us to count voting results concurrently with all the other voters.

Edited by Patrick Steinhardt

Merge request reports

Loading