Keeps track of messages according to their sequence numbers. Allows messages to be added out of order, and with gaps between sequence numbers. Method
remove()
removes the first message with a sequence number that is 1 higher than
next_to_remove
(this variable is then incremented), or it returns null if no message is present, or if no message's sequence number is 1 higher.
When there is a gap upon adding a message, its seqno will be added to the Retransmitter, which (using a timer) requests retransmissions of missing messages and keeps on trying until the message has been received, or the member who sent the message is suspected. There are 3 variables which keep track of messages:
- low: lowest seqno, modified on stable(). On stable(), we purge msgs [low digest.highest_delivered]
- highest_delivered: the highest delivered seqno, updated on remove(). The next message to be removed is highest_delivered + 1
- highest_received: the highest received message, updated on add (if a new message is added, not updated e.g. if a missing msg was received)
Note that the first seqno expected is 1. This design is described in doc/design.NAKACK.txt
Example: 1,2,3,5,6,8: low=1, highest_delivered=2 (or 3, depending on whether remove() was called !), highest_received=8
@author Bela Ban