There's nothing legacy about it so rename legacy_schema_tables to
schema_tables. The naming comes from a Cassandra 3.x development branch
which is not relevant for us in the near future.
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Remove commented out isReadyForBoostrap. We don't have a StageManager
nor we will so drop the function.
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Rename "MIGRATION_DELAY_IN_MSEC" to "migration_delay" as the unit of
time is already clear from the type.
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Use get_storage_proxy() and get_local_storage_proxy() helpers under the
hood to simplify migration manager API users.
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
In preparation for adding listener state to migration manager, use
sharded<> for migration manager.
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
The migration_manager and migration_task logging is currently not
visible in the logs. Fix that by de-thread-localizing both loggers.
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Return a std::chrono::steady_clock::duration and switch the caller in
migration manager to also use proper C++ durations.
Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
The code does:
auto fm = make_lw_shared<std::vector<frozen_mutation>>(schema.begin(), schema.end());
return net::get_local_messaging_service().send_message_oneway(net::messaging_verb::DEFINITIONS_UPDATE,
std::move(id), std::move(fm));
ms.register_handler(net::messaging_verb::DEFINITIONS_UPDATE, [this] (std::vector<frozen_mutation> m) {
...
}
We should not send a lw_shared_ptr, but std::vector<frozen_mutation>.
However, from Gleb:
Well, this is not a bug, this is really cool (and to be honest
unintended) feature of RPC. It is smart enough to detect that it is a
smart pointer to an object and dereference it. But in this particular
case there is not justification to use shared_ptr in the first place.
So, drop the lw_shared_ptr anyway.
Announce schema mutations in a cluster via the DEFINITIONS_UPDATE verb
and pass them to merge_schema() at endpoints.
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
We always operate on the local storage proxy so pass it by reference.
This simplifies DEFINITIONS_UPDATE message handler where all we have is
a "this" pointer to the local storage proxy.
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
If keyspace already exists, throw a already_exists_exception like Origin
does. Spotted while reading the code.
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>