Many mutation_reader implementations capture 'this', which, if copied,
becomes invalid. Protect against this error my making mutation_reader
a non-copyable object.
Fix inadvertant copied around the code base.
Compaction moves output_writer and done out of variables which are then
reused, causing use-after-free. In addition it fails to protect the variables
for the end of the loop.
Fix by avoiding the moves and adding an additional capture.
This adds the column family mean row size in the per column family and
the total version. I uses the ratio_helper class to calculate the mean
over all the shrades.
This distinguish between the async repair that starts the repair, that
will now be a POST request and the method that check on the command
progress that will now be a GET command.
After the change each operation would get the parameters that it needs.
The GET will return an enum based on the repair_status.
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Pointer to messageing_service object is stored in each request
continuation, so the object destruction should not happen while any of
these continuations is scheduled. Use gate object to ensure that.
This patch uses the now existing infrastructure to expose statistics about the bloom
filters hit/miss rates.
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
The current filter tracker uses a distributed mechanism, even though the values
for all CPUs but one are usually at zero. This is because - I wrongly assumed -
that when using legacy sstables, the same sstable would be serving keys for
multiple shards, leading to the map reduce being a necessary operation in this
case.
However, Avi currently point out that:
"It is and it isn't [the case]. Yes the sstable will be loaded on multiple cores, but
each core will have its own independent sstable object (only the files on disk
are shared).
So to aggregate statistics on such a shared sstables, you have to match them by
name (and the sharded<filter_tracker> is useless)."
Avi is correct in his remarks. The code will hereby be simplified by keeping
local counters only, and the map reduce operation will happen at a higher
level.
Also, because the users of the get methods will go through the sstable, we can
actually just move them there. With that we can leave the counters private to
the external world in the filter itself.
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
We are currently initializing some of the filter statistics. That can lead to
bogus values.
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
Now that boot_strapper::bootstrap is available, use it. It will set
_is_bootstrap_mode set to false, so now we can enable the
assert(!_is_bootstrap_mode) follows the call to bootstrap.
We set status to COMPLETED in join_token_ring
set_bootstrap_state(db::system_keyspace::bootstrap_state::COMPLETED)
but
cqlsh 127.0.0.$i -e "SELECT * from system.local;"
shows
bootstrapped -> IN_PROGRESS
The static sstring state_name is the bad boy.
unordered_set is used everywhere for tokens. This makes it is easier to
construct a boot_strapper object in storage_service::bootstrap where
unordered_set is used for tokens.
join_token_ring is called in two places, one is
storage_service::init_server and the other is
storage_service::join_ring.
The former is already inside a seastar thread. The latter is not but it
is rarely called. We can make join_ring runs inside a seastar thread, so
that join_token_ring always runs inside a seastar thread and we can get
rid of creating a thread inside join_token_ring.
"This series optimizes CQL query parameter handling by avoiding memory
allocation and copies where possible. I have only tested with the POSIX
stack and have not seen performance difference in cassandra-stress
because Linux networking dominates the profiles. The optimizations
should improve things with DPDK, though, because the
cql_server::read_query_options() hotspot is effectively eliminated."