When a connection is created, the size of the history that is about to be replayed is known. Storing this and decrementing it each time a session command is completed tells us when the Backend has finished replaying the session command history. This can then be used to distinguish whether a session command executed on a master should be retried or whether to simply discard the connection.