Module riak_ensemble_peer_worker

Long-lived worker process used by riak_ensemble_peer to handle asynchronous work such as K/V gets and puts.

Description

Long-lived worker process used by riak_ensemble_peer to handle asynchronous work such as K/V gets and puts. The peer maintains a pool of workers and routes requests to workers based on object key, ensuring that operations that affect the same key are serialized on the same worker. Thus, workers also enable partitioned queuing. These workers can also be paused and resumed. This is used by the peer when necessary to enforce necessary barriers. For example, a leader will pause all workers before attempting to change ensemble membership, then resume workers after. This prevents workers from issuing requests during a changing ownership set, since those requests will likely be rejected.

Note: pausing/resuming is best-effort. A worker currently involved in a request will not pause until after completing/failing the request. Thus, pause/resume is not designed to provide guarantees for correctness, but rather as a tool for optimization (eg. to prevent issues requests that will likely fail because some other correctness mechanism rejects them).

Function Index

loop/1
maybe_pause/1
pause_workers/2
start/1
unpause_workers/2

Function Details

loop/1

loop(ETS) -> any()

maybe_pause/1

maybe_pause(ETS) -> any()

pause_workers/2

pause_workers(Workers::[pid()], ETS::ets:tid()) -> ok

start/1

start(ETS::ets:tid()) -> {ok, pid()}

unpause_workers/2

unpause_workers(Workers::[pid()], ETS::ets:tid()) -> ok


Generated by EDoc