Commit Graph

53948 Commits

Author SHA1 Message Date
Glauber Costa
6a682d0e49 storage_service: futurize get_tokens
Because all its users are already futurized, this is actually an easy one.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-08-17 11:03:37 -07:00
Glauber Costa
bebb2abe4b system keyspace: factor out local_cache start code
It will now be used for other values as well.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-08-17 11:03:36 -07:00
Glauber Costa
229ce6cd85 dht: provide a from_sstring method
Only the partitioner knows how to convert a token to a sstring. Conversely,
only the partitioner can know how to convert it back.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-08-17 11:03:35 -07:00
Glauber Costa
5f807784bf dht: fix to_sstring methods to account for min tokens
Right now, we are converting the _data part of the token to a sstring, which
may be latter stored somewhere - in a system sstable, for instance. Later on,
we will have to get it back, but the way the code currently stands, we will get
undefined results for min and max tokens, since they have the _data field
empty.

For murmur3, strictly speaking, the correct solution would be to change
long_token to account for that. However, when we compare values, we already do
kind comparations explicitly. Inserting them there would only make that
operation branchier == costlier, which being a very common one, we don't want
to.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-08-17 10:23:19 -07:00
Glauber Costa
6fcbb3570e murmur3 partitioner: explicitly use int64_t instead of long
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-08-17 10:19:52 -07:00
Amnon Heiman
a43b3badaf API: Add row related method to cache_service API
This adds the implementation for get_row_hits, get_row_requests,
get_row_hit_rate, row_enries, row_size and row_capacity

The implementation is based on the column-family map reduce

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-08-17 20:09:07 +03:00
Amnon Heiman
98a05c3bb9 API: Add the ratio_holder helper struct to ratio calculation
Some of the APIs need to return a ratio.

The ratio_holder struct is a helper class that counts the total and the
sub totat, it implements the json::jsonable virtual class with a
to_json method that return the ratio.

The main usage of the sturct is with a map-reduce method.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-08-17 19:42:23 +03:00
Amnon Heiman
be0f0e0f04 API: Expose the map_reduce_cf from column_family
Other API need to use the map_reduce_cf, so it is expose in the
column_family.hh.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-08-17 19:42:23 +03:00
Amnon Heiman
a66968e872 estimated_histogram: Add the mean method
This adds the implementation for the mean and count methods in the
estimated histogram.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-08-17 19:42:23 +03:00
Amnon Heiman
0e1aa2e78b Expose the cache tracker and the num_entries in row_cache
This expose the cache tracker and the num entries in the row cache so it
can be used by the API.

And it adds a const getter for the region.

Both are const and are used for inspecting only.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-08-17 19:42:23 +03:00
Amnon Heiman
361b2377bb Expose the row_cache in the column_family
This expose the row_cache in the column family, it will be used by the
API to get the row_cache statistic information.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-08-17 19:42:23 +03:00
Gleb Natapov
6b1669468a Fix short read problem.
Fix https://issues.apache.org/jira/browse/CASSANDRA-2643 same way
Origin does it: if short read is detected retry with bigger limit and
check again.
2015-08-17 18:11:26 +03:00
Gleb Natapov
d7b1146080 Include trailing tombstones in mutation when enforcing row_limit
It is how Origin deals with https://issues.apache.org/jira/browse/CASSANDRA-8933
and since we are going to implement same short read protection algorithm
as origin we need same behaviour here too.
2015-08-17 18:11:25 +03:00
Avi Kivity
608c0b8460 Merge "initial work on compaction manager API" from Rapahel 2015-08-17 17:24:13 +03:00
Calle Wilund
8f0f4e7945 Commitlog: do more extensive dir entry probes to determine type
Since directory_entry "type" might not be set.
Ensuring that code does not remain future free or easy to read.

Fixes #157.
2015-08-17 16:56:31 +03:00
Avi Kivity
932ddc328c logalloc: optimize current_allocation_strategy()
This heavily used function shows up in many places in the profile (as part
of other functions), so it's worth optimizing by eliminating the special
case for the standard allocator.  Use a statically allocated object instead.

(a non-thread-local object is fine since it has no data members).
2015-08-17 16:51:10 +03:00
Avi Kivity
29219fb31a Merge "Fixes for tuple types" from Paweł
"This patchset contains fixes to tuple types implementation necessary
to make them work properly. That includes using fully qualified class
name instead of CQL3 type name internally (just like it is done for
every other type), fixed bug with accessing vector that may be already
moved away and adding support for tuples in transport::type_codec."

Fixes #147.
2015-08-17 16:35:08 +03:00
Paweł Dziepak
4e3f81ee62 tests/cql3: test_tuples: test table creation as well
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-17 14:44:08 +02:00
Paweł Dziepak
944d0e5366 transport: encode tuple types properly
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-17 14:42:21 +02:00
Paweł Dziepak
f846eb2032 types: tuple: fix std::move() in constructor
In an expression like:

  tuple_type_impl(make_name(types), std::move(types));

the order in which arguments are evaluated is unspecified and it
is possible that make_name() is called with types already moved
away.

This is fixed by using initialization list (for which order of
evalutaion is specified). Unfortunately, this also requires some code
duplication.

Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-17 14:25:39 +02:00
Paweł Dziepak
08b2c5801d types: tuple: use fully qualified class name as type name
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-17 14:24:17 +02:00
Paweł Dziepak
9c33e1afcf types: add is_tuple()
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-17 14:24:04 +02:00
Avi Kivity
54a9191746 Merge seastar upstream
* seastar 44e35a4...69edf16 (1):
  > shared_ptr: inline lw_shared_ptr destructor
2015-08-17 13:12:48 +03:00
Avi Kivity
b27f9b3b01 Merge rpm updates from Takuya 2015-08-17 11:22:25 +03:00
Avi Kivity
a8f957b692 Merge "CQL3 tuples cleanup" from Paweł
"These are some minor fixes and improvements for issues pointed out
during review."
2015-08-17 10:51:58 +03:00
Avi Kivity
52b58fca8a Merge "streaming fix for repair" from Asias
"This series fix the issue found by Nadav in commit "repair: track ongoing
repairs"."
2015-08-17 10:40:01 +03:00
Paweł Dziepak
fc7062f5d2 cql3: tuples: get rid of lambda in std::transform()
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-17 09:26:19 +02:00
Avi Kivity
401725c446 Merge seastar upstream
* seastar f1b4290...44e35a4 (4):
  > future:then()/then_wrapped() simplification and optimization
  > futurize<>::apply() - make noexcept
  > future::forward_to() - move out exception
  > future::then() - throw correct exception
2015-08-17 10:18:51 +03:00
Avi Kivity
9caea0c86f Merge "Clean up CQL query options" from Pekka
"Clean up various issues with the query_options class to make it easier
to work on."
2015-08-17 10:18:18 +03:00
Paweł Dziepak
3be8e3638e cql3: add missing std::move() in tuples::in_value()
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-17 09:11:53 +02:00
Paweł Dziepak
b74c7824bb cql3: reserve vector capacity in tuple::in_value constructor 2015-08-17 09:07:52 +02:00
Takuya ASADA
36ef69c1d0 dist: Fixes on spec file
Fix Summary, added Conflicts/Provides, specified release mode on building stage.
2015-08-17 16:02:25 +09:00
Takuya ASADA
2e62f4452f dist: add limits.conf for scylla-server 2015-08-17 16:02:25 +09:00
Takuya ASADA
760a1345e1 dist: add a script to build rpm 2015-08-17 16:02:25 +09:00
Pekka Enberg
ed92f8516c cql3/query_options: Fix formatting
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-08-17 09:48:59 +03:00
Pekka Enberg
b165d22443 cql3/query_options: Move implementation to source file
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-08-17 09:48:59 +03:00
Pekka Enberg
401c3668a4 cql3/query_options: Remove ifdef'd code
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-08-17 09:48:58 +03:00
Pekka Enberg
5b9901d693 cql3/query_options: Encapsulate underlying values
Encapsulate the '_values' vector to make it easier to switch the
underlying type from bytes_opt to bytes_view_opt.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-08-17 09:48:58 +03:00
Asias He
e7c0db0160 streaming: Fix a race between initiator and follower
1) Node A sends prepare message (msg1) to Node A
2) Node B sends prepare message (msg2) back to Node A
3) Node A prepares what to receive according to msg2

The issue is that, Node B might sends before Node A prepares to receive.

To fix, we send a PREPARE_DONE_MESSAGE after step 3 to notify
node B to start sending.
2015-08-17 14:28:11 +08:00
Asias He
de504086b4 messaging_service: Add PREPARE_DONE_MESSAGE verb
It is used to notify the follower to start sending streaming data to the
initiator.
2015-08-17 14:28:11 +08:00
Asias He
fd1c0e0bb3 streaming: Fix iterate and delete
The problem is that in start_streaming_files we iterate the _transfers
map, however in task.start() we can delete the task from _transfers:
stream_transfer_task::start() -> stream_transfer_task::complete ->
stream_session::task_completed -> _transfers.erase(completed_task.cf_id)

To fix, we advance the iterator before we start the task.

std::_Rb_tree_increment(std::_Rb_tree_node_base const*) () from
/lib64/libstdc++.so.6
/usr/include/c++/5.1.1/bits/stl_tree.h:205
(this=this@entry=0x6000000dc290) at streaming/stream_transfer_task.cc:55
streaming::stream_session::start_streaming_files
(this=this@entry=0x6000000ab500) at streaming/stream_session.cc:526
(this=0x6000000ab500, requests=std::vector of length 1, capacity 1 =
{...}, summaries=std::vector of length 1, capacity 1 = {...})
    at streaming/stream_session.cc:356
streaming/stream_session.cc:83
2015-08-17 11:00:30 +08:00
Asias He
d2e826d6e6 streaming: Log STREAM_MUTATION_DONE before sending it
It is useful for debug.
2015-08-17 11:00:30 +08:00
Asias He
8c6e08c7e2 streaming: Log state in maybe_completed 2015-08-17 11:00:30 +08:00
Asias He
0f1f710b27 streaming: Introduce transfer_task_completed 2015-08-17 11:00:30 +08:00
Asias He
651200c123 streaming: Log exception
It is easier to tell what is going wrong.
2015-08-17 10:52:30 +08:00
Asias He
aa012ba374 streaming: Send STREAM_MUTATION in parallel
At the moment, when local node send a mutation to remote node, it will
wait for remote node to apply the mutation and send back a response,
then it will send the next mutation. This means the sender are sending
mutations one by one. To optimize, we can make the sender send more
mutations in parallel without waiting for the response. In order to
apply back pressure from remote node, a per shard mutation send limiter
is introduced so that the sender will not overwhelm the receiver.
2015-08-17 10:52:30 +08:00
Asias He
f15c98cbca streaming: Fix create_message_for_retry
It makes no sense to create an empty message to retry, we must retry a
existing message.
2015-08-17 10:52:30 +08:00
Asias He
09aae35baa streaming: Add move constructor for stream_transfer_task
Otherwise code in stream_session.cc

   _transfers.emplace(cf_id, stream_transfer_task(shared_from_this(), cf_id)).first;

will copy the stream_transfer_task and in turn copy the
outgoing_file_message which is not copyable due to the semaphore member.

Thanks avi for figuring this out.
2015-08-17 10:52:30 +08:00
Tzach Livyatan
dc73bb704b Rearrange scylla.yaml to supported and not supported segments
This patch rearrange scylla.yaml, without adding or omitting parameters, to two segments:
1. Supported parameters
2. Not supported parameters: saved for future use or backward compatibility

Signed-off-by: Tzach Livyatan <tzach@cloudius-systems.com>
2015-08-16 20:35:03 +03:00
Avi Kivity
77d2cd7300 Merge 2015-08-16 19:36:25 +03:00