private ReplicationSourceInterface createRefreshedSource(ReplicationQueueId queueId,
    ReplicationPeer peer) throws IOException, ReplicationException {
    Map<String, ReplicationGroupOffset> offsets = queueStorage.getOffsets(queueId);
    return createSource(new ReplicationQueueData(queueId, ImmutableMap.copyOf(offsets)), peer);
  }
<p>
This is used when we transit a sync replication peer to {@link SyncReplicationState#STANDBY}.
</p>
<p>
When transiting to {@link SyncReplicationState#STANDBY}, we can remove all the pending wal
files for a replication peer as we do not need to replicate them any more. And this is
necessary, otherwise when we transit back to {@link SyncReplicationState#DOWNGRADE_ACTIVE}
later, the stale data will be replicated again and cause inconsistency.
</p>
<p>
See HBASE-20426 for more details.
</p>
@param peerId the id of the sync replication peer
hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java