code: func (mvcc *MVCCLevelDB) Scan(startKey, endKey []byte, limit int, startTS uint64, isoLevel kvrpcpb.IsolationLevel) []Pair {
  	mvcc.mu.RLock()
  	defer mvcc.mu.RUnlock()
  
  	iter, currKey, err := newScanIterator(mvcc.db, startKey, endKey)
  	defer iter.Release()
  	if err != nil {
  		logutil.Logger(context.Background()).Error("scan new iterator fail", zap.Error(err))
  		return nil
  	}
  
  	ok := true
  	var pairs []Pair
  	for len(pairs) < limit && ok {
  		value, err := getValue(iter, currKey, startTS, isoLevel)
  		if err != nil {
  			pairs = append(pairs, Pair{
  				Key: currKey,
  				Err: errors.Trace(err),
  			})
  		}
  		if value != nil {
  			pairs = append(pairs, Pair{
  				Key:   currKey,
  				Value: value,
  			})
  		}
  
  		skip := skipDecoder{currKey}
  		ok, err = skip.Decode(iter)
  		if err != nil {
  			logutil.Logger(context.Background()).Error("seek to next key error", zap.Error(err))
  			break
  		}
  		currKey = skip.currKey
  	}
  	return pairs
  }
docs: // Scan implements the MVCCStore interface.