code: func (s *StanServer) processReplicatedSendAndAck(ssa *spb.SubSentAndAck) {
  	c, err := s.lookupOrCreateChannel(ssa.Channel)
  	if err != nil {
  		return
  	}
  	sub := c.ss.LookupByAckInbox(ssa.AckInbox)
  	if sub == nil {
  		return
  	}
  	sub.Lock()
  	defer sub.Unlock()
  
  	// This is not optimized. The leader sent all accumulated sent and ack
  	// sequences. For queue members, there is no much that can be done
  	// because by nature seq will not be contiguous, but for non queue
  	// subs, this could be optimized.
  	for _, sequence := range ssa.Sent {
  		// Update LastSent if applicable
  		if sequence > sub.LastSent {
  			sub.LastSent = sequence
  		}
  		// In case this is a queue member, update queue state's LastSent.
  		if sub.qstate != nil && sequence > sub.qstate.lastSent {
  			sub.qstate.lastSent = sequence
  		}
  		// Set 0 for expiration time. This will be computed
  		// when the follower becomes leader and attempts to
  		// redeliver messages.
  		sub.acksPending[sequence] = 0
  	}
  	// Now remove the acks pending that we potentially just added ;-)
  	for _, sequence := range ssa.Ack {
  		delete(sub.acksPending, sequence)
  	}
  	// Don't set the sub.stalled here. Let that be done if the server
  	// becomes leader and attempt the first deliveries.
  }
docs: // This is invoked from raft thread on a follower. It persists given
  // sequence number to subscription of given AckInbox. It updates the
  // sub (and queue state) LastSent value. It adds the sequence to the
  // map of acksPending.