storage_proxy: fix result ordering for parallel partition range scans
storage_proxy: fix result ordering for parallel partition range scans

During a range scan, we try to avoid sorting according to partition range
when we can do so.  This is when we scan fewer than smp::count shards --
each shard's range is strictly ordered with respect to the others.

However, we use the wrong key for the sort -- we use the shard number.  But
if we started at shard s > 0 and wrapped around to shard 0, then shard 0's
range will be after the range belonging to shard s, but will sort before it.

Fix by storing the iteration order as the sort key.  We use that when we
know that shards do not overlap (shards < smp::count) and the index within
the source partition range vector when they do.

Fixes #1998.
Message-Id: <a4f79baf78dc2d64652ced956ff48d198da399b0@scylladb.com>

duarten/scylla,raphaelsc/scylla,duarten/scylla,avikivity/scylla,avikivity/scylla,raphaelsc/scylla,avikivity/scylla,raphaelsc/scylla,scylladb/scylla,scylladb/scylla,scylladb/scylla,duarten/scylla,scylladb/scylla