"This series adds the missing code from origin to support this functionality.
While doing so, some method where changed to be const when it was more
appropriate and a few const version of methods where added when the two
variation was required."
This adds the ownwership method implementation to the storage_service
API. After the patch the following url will be supported:
GET /storage_service/ownership/{keyspace}
GET /storage_service/ownership/
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
This adds the API for get_effective_ownership and
get_ownership in storage_service.
It is based on the StorageServiceMBean definition.
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
effective_ownership
This patch adds the implementation for get_ranges_for_endpoint,
get_ownership and effective_ownership based on origin implementation.
The methods are used by the API.
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
This patch adds the get_non_system_keyspaces that found in origin and
expose the replication strategy. With the get_replication_strategy
method.
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
This patch adds a const version for get_datacenter_endpoints and
get_topology.
It modified the token iterator to use a const version of token_metadata
and it make first_token, first_token_index, tokens_end and ring_range to
be a const method.
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
This patch adds const for some of the methods that are not actually
changing the object content.
This is useful when using a const reference to the object.
calculate_natural_endpoints and has_sufficient_replicas where set as
const. The override was added where it was missing.
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
The code was taken from origin, where instead of BigInteger, uint64_t was used.
The function returns the part that each token is responsible for, the sum of
all is raughly 1.
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Make the exceptions created inside database::find_column_family() return
a readable message from their what() method.
Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
Catch and log the exceptions thrown in the mutation receiver flow for better
debugability.
Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
New in v2:
- Don't dowithicate the ready future - call make_ready_future<>().then(...)
directly.
- Fix and unify the messages printed when the exception is caught.
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.