code: func (worker *copIteratorWorker) calculateRemain(ranges *copRanges, split *coprocessor.KeyRange, desc bool) *copRanges {
  	if desc {
  		left, _ := ranges.split(split.End)
  		return left
  	}
  	_, right := ranges.split(split.Start)
  	return right
  }
docs: // calculateRemain splits the input ranges into two, and take one of them according to desc flag.
  // It's used in streaming API, to calculate which range is consumed and what needs to be retry.
  // For example:
  // ranges: [r1 --> r2) [r3 --> r4)
  // split:      [s1   -->   s2)
  // In normal scan order, all data before s1 is consumed, so the remain ranges should be [s1 --> r2) [r3 --> r4)
  // In reverse scan order, all data after s2 is consumed, so the remain ranges should be [r1 --> r2) [r3 --> s2)