Skip to content

Partkey Interface: Avoid mutex and DB operation in Register/Record #2878

@winder

Description

@winder

Description:

The ParticipationRegistry attempts to DB access for functions called on the consensus goroutine. It does this using a cache, and a read/write mutex. Because of the mutex, there are cases where a long-running operation on another goroutine could block consensus.

Acceptance Criteria:

  • use a buffered channel to pass Register/Record events to a separate goroutine.
  • do not write registrations to the DB right away, use the cache and write them along with the record events. This is safe because we attempt to re-register keys at the start of every round.
  • Use a different mutex for Get and Flush

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions