Commit Graph

180 Commits

Author SHA1 Message Date
Asias He
c19f5edefe messaging_service: Add wrapper for READ_MUTATION_DATA verb 2015-07-16 17:23:26 +08:00
Asias He
85c6dc0b7e messaging_service: Add wrapper for READ_DATA verb 2015-07-16 17:23:26 +08:00
Asias He
0707c15000 messaging_service: Add wrapper for MUTATION_DONE verb 2015-07-16 17:23:26 +08:00
Asias He
196c7d6f2b messaging_service: Add wrapper for MUTATION verb 2015-07-16 17:23:22 +08:00
Asias He
49b80535d9 messaging_service: Add wrapper for DEFINITIONS_UPDATE verb 2015-07-16 17:19:51 +08:00
Asias He
3e9d88e67c migration_manager: Do not use make_lw_shared in push_schema_mutation
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.
2015-07-16 17:19:51 +08:00
Gleb Natapov
ed0faffd12 storage_proxy: beginning of read implementation for ranges queries 2015-07-15 12:41:38 +03:00
Gleb Natapov
6dc5b5ad76 storage_proxy: add resolver classes facilitate query resolving
The responsibility of the classes is to collect all results and do
reconciliation if needed.
2015-07-15 12:41:38 +03:00
Gleb Natapov
c037666491 stroage_proxy: fix response_id moving in send_to_live_endpoints() 2015-07-14 12:21:12 +03:00
Avi Kivity
bfe9d21808 Merge "Adding the storage proxy metrics" from Amnon
"This series adds the storage proxy metrics API. The definition are based on the
StorageProxyMetrics definition. This series also adds stats object to the
storage_proxy a getter function for it and an implementation based on it, but
it is currently does not adds the code to manipulate the counters."
2015-07-13 11:55:50 +03:00
Tomasz Grabiec
bc0874d299 db: Move storage_proxy::query_local() to db::system_keyspace::query() 2015-07-13 10:27:02 +02:00
Amnon Heiman
0eeef904d7 Storage proxy: Adding a stats object
This adds a stat object with counters that will be used by the API. The
stat object instance will be return with a get_stats method.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-07-12 22:59:32 +03:00
Gleb Natapov
83bbd87966 storage_proxy: simplify net::messaging_verb::READ_DATA handler 2015-07-12 16:19:20 +03:00
Gleb Natapov
67d494c4ee storage_proxy: fix waiting_for to check for local dataceneter 2015-07-12 16:19:20 +03:00
Tomasz Grabiec
e35854b33c storage_proxy: Preserve partition order in range queries
In Origin, partitions in range query results are ordered using
decorated_key ordering. This allows the use of token() function for
incremental iterating over results, as mentioned here:

http://www.datastax.com/dev/blog/client-side-improvements-in-cassandra-2-0

We may also need this to implement paging.

The old code didn't preserve ordering, because it didn't merge-sort
data coming from different shards. The fix relies on
query_mutations_locally(), which already preserves the ordering. We're
going to use mutation queries for range queries anyway.
2015-07-12 12:54:38 +02:00
Tomasz Grabiec
ad99e84505 storage_proxy: Take schema_ptr in query()
It will be needed for reconciliation.
2015-07-12 12:54:38 +02:00
Tomasz Grabiec
5b332c6f7c messaging_service: Add RPC call for mutation queries. 2015-07-12 12:54:38 +02:00
Tomasz Grabiec
4931d3fdcd storage_proxy: Implement query_mutations_locally() 2015-07-12 12:54:38 +02:00
Tomasz Grabiec
176fa9d049 storage_proxy: Simplify query_local() 2015-07-09 18:53:03 +02:00
Pekka Enberg
a64eab772c migration_manager: Convert announceColumnFamilyDrop to C++ as stub
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-07-09 09:22:02 +03:00
Pekka Enberg
386792e63f migration_manager: Convert announceKeyspaceDrop to C++ as stub
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-07-08 18:40:30 +02:00
Gleb Natapov
b0c087b2a5 storage_proxy: fix check for singular range on read
A singular range which a ring_position that does not contains a key may
operate on more than one key and thus is not really singular.
2015-07-08 18:38:39 +03:00
Avi Kivity
a2e270f3d4 Merge "wire update tokens" from Glauber
"As previously said, there were some unidentified bugs that prevented update_tokens from
working properly. The first one was sent alongside the series, the second one took me more
time, but it is fixed here."
2015-07-08 16:01:37 +03:00
Pekka Enberg
3ca9a8c2fb migration_manager: Fix announce_new_column_family() validation
Throw an exception if a column family already exists.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-07-08 13:03:28 +02:00
Glauber Costa
12dc7ebd26 system.local: convert update tokens
At this point, users of the interface are futurized already, so we
just need to make sure they call the right function.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-07 20:24:43 -04:00
Avi Kivity
dd29ac9593 Merge "cqlsh" from Glauber
System table Work to make cqlsh connect.
2015-07-07 19:33:23 +03:00
Glauber Costa
d5302ac796 futurize set_tokens
Soon that will involve a query. The idiom make_ready_future<>().then()
is a bit unusual to say the least, but it will soon be replace by an
actual future.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-07 11:38:23 -04:00
Glauber Costa
0f68010152 futurize get_local_host_id and set_local_host_id
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-07 11:38:23 -04:00
Glauber Costa
39e4e98c35 client_state: default to system for internal queries
Most of the time we're querying internal, we are going for the system.
Defaulting to it just makes it easier, and callers can still change it
with set_keyspace if needed.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-07 11:38:22 -04:00
Pekka Enberg
9cc9cf1e76 service/migration_manager: Announce schema mutations in cluster
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>
2015-07-07 16:48:41 +03:00
Pekka Enberg
a358990855 db/legacy_schema_tables: Pass storage_proxy by reference
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>
2015-07-07 16:27:58 +03:00
Tomasz Grabiec
93bf8fa3ba Merge branch 'calle/execute_internal' from seastar-dev.git 2015-07-06 15:26:18 +03:00
Gleb Natapov
cfcca4315c do not copy query::result while sending it back to a coordinator
RPC can send directly from a smart pointer now.
2015-07-06 10:17:39 +02:00
Calle Wilund
5919e824c7 storage_proxy: add query_local 2015-07-06 08:21:15 +02:00
Avi Kivity
b0fd850463 Merge "Code missing for a NetworkTopologyStrategy integration" from Vlad
"This series add a code missing for an integration of a NetworkTopologyStrategy
with a current clustering WRITE path."
2015-07-02 17:31:49 +03:00
Avi Kivity
4ef3eaef4d Merge "Add tests for query interface on mutation level" from Tomasz 2015-07-02 16:35:27 +03:00
Vlad Zolotarov
89a7e84483 service: storage_proxy: implement datacenter_sync_write_response_handler
Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2015-07-02 16:00:47 +03:00
Vlad Zolotarov
4a78d173f6 service: storage_proxy::send_to_live_endpoints(): properly query a datacenter name
Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2015-07-02 16:00:47 +03:00
Vlad Zolotarov
acb8b9fcda service: storage_proxy::mutate(): properly query local_dc
Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2015-07-02 16:00:47 +03:00
Gleb Natapov
c81cf80d8a fix mutation forwarding for muti-DC setup
Forwarding lambda is reused, so we cannot move captures out of it
and we cannot pass references to them either since lambda can be
destroyed before send completes.
2015-07-02 15:30:21 +03:00
Tomasz Grabiec
a1f6dec067 result_set: Introduce from_raw_result() factory method 2015-07-02 13:25:46 +02:00
Tomasz Grabiec
c9e5508e3c result_set_builder: Make build() return unwrapped object
It's better to let the user decide which kind (if any) of smart
pointer to wrap it into.
2015-07-02 13:25:46 +02:00
Gleb Natapov
4b9661c608 initial read clustering code
Works only if all replicas (participating in CL) has the same live
data. Does not detects mismatch in tombstones (no infrastructure yet).
Does not report timeout yet.
2015-07-01 13:36:30 +03:00
Gleb Natapov
97a4b0ee40 Store frozen_mutation in shared pointer while processing it
If local mutation write takes longer then write timeout mutation will
be deleted while it is processed by database engine. Fix this by storing
mutation in shared pointer and hold to the pointer until mutation is
locally processed.
2015-06-24 12:51:34 +03:00
Gleb Natapov
7d846e842c use write_request_timeout_in_ms for write request timeout
Fixes another fixme. Also change default value to 2000 which seams to
be what origin uses.
2015-06-24 12:51:33 +03:00
Gleb Natapov
12f3d53372 storage_proxy: cleanup leftovers from timer consolidation 2015-06-23 15:43:59 +03:00
Gleb Natapov
2be9dfc242 storage_proxy: use fb_utilities::get_broadcast_address()
fixes some fixmes
2015-06-23 15:43:59 +03:00
Gleb Natapov
67ea1b0ec8 Revert "db: hold onto write response handler until timeout handler is executed"
This reverts commit 52aa0a3f91.

After c9909dd183 this is no longer needed since reference to a
handler is not used in abstract_write_response_handler::wait() continuation.

Conflicts:
	service/storage_proxy.cc
2015-06-23 15:43:59 +03:00
Gleb Natapov
c9909dd183 cluster: consolidate mutation clustering timers
Currently mutation clustering uses two timers, one expires when wait for
cl timeouts and is canceled when cl is achieved, another expires if some
endpoints do not answer for a long time (cl may be already achieved at
this point and first timer will be canceled). This is too complicated
especially since both timers can expire simultaneously. Simplify it by
having only one timer and checking in a callback whether cl was achieved.
2015-06-23 14:42:56 +03:00
Asias He
5e1348e741 storage_service: Use get_local_snitch_ptr in gossip_snitch_info 2015-06-23 12:12:33 +03:00