storage_proxy::make_local_reader: simplify lifetime of range parameter
storage_proxy::make_local_reader: simplify lifetime of range parameter

make_local_reader takes a partition-range parameter, passed by *reference*.
The meaning of this passing-by-reference is not documented: when
make_local_reader returns, which of the following two statements holds?

  1. make_local_reader still holds this reference, so the caller is
     forced to keep the range object alive. For how long?
or
  2. make_local_reader reads the range before returning, and when it
     returns, the caller continues to "own" the range object, and is
     allowed to do anything, including delete it.

The principle of least surprise suggests that #2 is better, unless
there is a very good reason to choose #1, and unless this requirement to
keep the argument alive (and for how long) was clearly documented.
But neither is the case here - the overhead of copying the argument is
negligable compared to the other overheads of make_local_reader, and
nothing was documented.

But it turns out the current code did #1 - the address of the range was
passed around *after* make_local_reader returns - the different readers
on different cpus continue to use it to eventually find the right sstable
byte range to iterate over. It very easy to forget this and call
make_local_reader on a on-stack range variable, and the result is a
hard-to-debug use-after-free mess.

This patch switches us to situation #2: Before make_local_reader returns,
the range is copied to whoever needs to hold it after the return, namely
each individual shard_reader. The patch to do this is trivial (one
character removed).

Signed-off-by: Nadav Har'El <625169824b719df98706d88646d0aae6f368ae4d@cloudius-systems.com>

linearregression/scylla,phonkee/scylla,wildinto/scylla,tempbottle/scylla,aruanruan/scylla,aruanruan/scylla,eklitzke/scylla,guiquanz/scylla,respu/scylla,acbellini/scylla,dwdm/scylla,wildinto/scylla,glommer/scylla,rentongzhang/scylla,rentongzhang/scylla,kangkot/scylla,eklitzke/scylla,kangkot/scylla,shaunstanislaus/scylla,senseb/scylla,linearregression/scylla,glommer/scylla,rluta/scylla,justintung/scylla,guiquanz/scylla,duarten/scylla,respu/scylla,justintung/scylla,avikivity/scylla,phonkee/scylla,phonkee/scylla,victorbriz/scylla,aruanruan/scylla,raphaelsc/scylla,rluta/scylla,linearregression/scylla,justintung/scylla,stamhe/scylla,capturePointer/scylla,scylladb/scylla,gwicke/scylla,dwdm/scylla,senseb/scylla,bowlofstew/scylla,tempbottle/scylla,kjniemi/scylla,guiquanz/scylla,scylladb/scylla,gwicke/scylla,bowlofstew/scylla,asias/scylla,acbellini/scylla,duarten/scylla,shaunstanislaus/scylla,capturePointer/scylla,capturePointer/scylla,kangkot/scylla,rluta/scylla,kjniemi/scylla,wildinto/scylla,shaunstanislaus/scylla,senseb/scylla,bowlofstew/scylla,stamhe/scylla,respu/scylla,rentongzhang/scylla,avikivity/scylla,kjniemi/scylla,asias/scylla,glommer/scylla,avikivity/scylla,raphaelsc/scylla,scylladb/scylla,asias/scylla,dwdm/scylla,duarten/scylla,raphaelsc/scylla,gwicke/scylla,victorbriz/scylla,acbellini/scylla,victorbriz/scylla,stamhe/scylla,tempbottle/scylla,scylladb/scylla,eklitzke/scylla