This class is used to record the used workers(region servers) for a replication peer. For
balancing the replaying remote wal job, we will only schedule one remote replay procedure each
time. So when acquiring a worker, we will first get all the region servers for this cluster,
and then filter out the used ones.
The
ProcedureEvent
is used for notifying procedures that there are available workers
now. We used to use sleeping and retrying before, but if the interval is too large, for
example, exponential backoff, then it is not effective, but if the interval is too small, then
we will flood the procedure wal.
The states are only kept in memory, so when restarting, we need to reconstruct these
information, using the information stored in related procedures. See the
afterReplay
method in
RecoverStandbyProcedure
and
SyncReplicationReplayWALProcedure
for
more details.