Commit Graph

5754 Commits

Author SHA1 Message Date
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
Avi Kivity
9f9f435e9a Merge "Adding snitch_name and update_snitch" from Amnon
"This adds the get_snitch_name and update_snitch functionality to the API. After
this series it would be possible to return the snitch name and to update the
snitch."
2015-08-16 19:34:41 +03:00
Avi Kivity
5a061fe66e lsa: increase segment size
While #152 is still open, we need to allow for moderately sized allocations
to succeed.  Extend the segment size to 256k, which allows for threads to
be allocated.

Fixes #151.
2015-08-16 19:26:59 +03:00
Avi Kivity
bd935d9815 Merge seastar upstream
* seastar 432e973...f1b4290 (3):
  > reactor: don't abort if a timer throws an exception
  > reactor: move complete_timers to .cc
  > resource: stop using now-deprecated hwloc_distribute()
2015-08-16 18:59:33 +03:00
Avi Kivity
7a14bcd66e Merge "API: add get estimated row size histogram to column family" from Amnon
"This series cleans the streaming_histogram and the estimated histogram that
were importad from origin, it then uses it to get the estimated min and max row
estimation in the API."
2015-08-16 17:31:23 +03:00
Avi Kivity
eb09eddee5 Merge "Adding sampled histogram" from Amnon
"Histograms are used to collect latency information, in Origin, many of the
operations are timed, this is a potential performance issue. This series adds
an option to sample the operations, where small amount will be timed and the
most will only be counted.

This will give an estimation for the statistics, while keeping an accurate
count of the total events and have neglectible performance impact.

The first to use the modified histogram are the column family for their read
and write."

Conflicts:
	database.hh
2015-08-16 17:15:24 +03:00
Glauber Costa
d552d99cdd sstables: record index file size on opening
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-08-16 17:12:20 +03:00
Glauber Costa
89366dc2c2 sstables: do not accept files with missing TOC.
We can catch most errors when we try to load an sstable. But if the TOC file is
the one missing, we won't try to load the sstable at all. This case is still an
invalid case, but it is way easier for us to treat it by waiting for all files
to be loaded, and then checking if we saw a file during scan_dir, without its
corresponding TOC.

Fixes #114

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-08-16 15:21:40 +03:00
Glauber Costa
0650579ace sstables: refuse to boot on corrupted sstables
We are now skipping them. That's dangerous.

Fixes #115

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-08-16 15:21:38 +03:00
Paweł Dziepak
f0040c2af1 keys: use resize() to fill missing values
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-16 14:41:56 +03:00
Nadav Har'El
5a02eeaba9 v2: repair: track ongoing repairs
[in v2: 1. Fixed a few small bugs.
        2. Added rudementary support parallel/sequential repair.
	3. Verified that code works correctly with Asias's fix to streaming]

This patch adds the capability to track repair operations which we have
started, and check whether they are still running or completed (successfully
or unsuccessfully).

As before one starts a repair with the REST api:

   curl -X GET --header "Content-Type: application/json" --header "Accept: application/json" "http://127.0.0.1:10000/storage_service/repair_async/try1"

where "try1" is the name of the keyspace. This returns a repair id -
a small integer starting with 0. This patch adds support for similar
request to *query* the status of a previously started repair, by adding
the "id=..." option to the query, which enquires about the status of the
repair with this id: For example.,

    curl -i -X GET --header "Content-Type: application/json" --header "Accept: application/json" "http://127.0.0.1:10000/storage_service/repair_async/try1?id=0"

gets the current status of this repair 0. This status can be RUNNING,
SUCCESSFUL or FAILED, or a HTTP 400 "unknown repair id ..." in case an
invalid id is passed (not the id of any real repair that was previously
started).

This patch also adds two alternative code-paths in the main repair flow
do_repair_start(): One where each range is repaired one after another,
and one where all the ranges are repaired in parallel. At the moment, the
enabled code is the parallel version, just as before this patch. But the
will also be useful for implementing the "parallel" vs "sequential" repair
options of Cassandra.

Note that if you try to use repair, you are likely to run into a bug in
the streaming code which results in Scylla either crashing or a repair
hanging (never realising it finished). Asias already has a fix this this bug,
and will hopefully publish it soon, but it is unrelated to the repair code
so I think this patch can independently be committed.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-08-16 14:23:02 +03:00
Tzach Livyatan
e9754b9e16 README: Add missing prerequisites libs on Fedora 22
Add missing libs required for compiling on Fedora 22
thrift-devel antlr3-tool libasan libubsan

Signed-off-by: Tzach Livyatan <tzach@cloudius-systems.com>
2015-08-16 14:14:37 +03:00
Raphael S. Carvalho
82425fd24a sstables: initial work on handling a partially written sstable
The solution was proposed by Nadav. When writing a new sstable,
write all usual files, write the TOC to a temporary file, and
then rename it, which is atomic.
Files not belonging to any TOC are invalid, so we ensure that
partially written sstables aren't reused.

Avi also proposed using fsync on the sstable directory to guarantee
that the files reached the disk before sealing the sstable.

Subsequently, we should add code to avoid loading sstable which
TOC is either temporary or doesn't exist. Temporary TOC files
should also be deleted.

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-08-16 13:01:44 +03:00
Vlad Zolotarov
cb55bdbfbc transport: register the correct "current number of open connections" statistics counter source
There are two counters for the "current number of open connections" in the cql_server:
   - _connects: incremented every time a new connection is opened. Should be used for
                a derived statistics of connections/sec
   - _connections: incremented and decremented every time a new connection is opened/closed
                correspondingly.

_connects has been registered as a source for both derived and gauge collectd statistics by
mistake while it had to be registered for a derived counter only and _connections had to be
registered as a source for a gauge counter.

Fixes issue #143

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2015-08-16 12:56:11 +03:00
Vlad Zolotarov
4e55033dc9 db::config: improve a help output for --endpoint_snitch parameter
- Improve the output formating.
   - Comment out not supported snitches.

Fixes issue #124

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2015-08-16 12:55:34 +03:00
Vlad Zolotarov
5f13ebad30 locator: create/reset_snitch(): improve the error message for a not-supported case
Fixes issue #124

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2015-08-16 12:55:33 +03:00
Amnon Heiman
eee3094197 API: Add the get_snitch command
This adds the get_snitch_name command.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-08-16 12:15:38 +03:00
Amnon Heiman
524e0a00df API: Adding the update snitch API
The update snitch API reset the snitch with a new class.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-08-16 12:15:14 +03:00
Gleb Natapov
6f9cc6efe4 fix query::read_command lifetime issue in mutation_result_merger
mutation_result_merger can outlive query::read_command, so it have to
hold shared pointer to it instead of reference. The bug was introduced by
89e36541c3
2015-08-16 10:59:43 +03:00
Avi Kivity
14ad301b26 Merge "Use proper token type" from Paweł
"These patches make sure that proper type is used to represent token."
2015-08-14 18:14:13 +03:00
Paweł Dziepak
498958878e tests/cql3: compare token() with bigints
The default partitioner is murmur3 for which correct token type is
bigint.

Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-14 16:51:20 +02:00
Paweł Dziepak
50abc62fe2 cql3: use proper token type in token relations
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-14 16:12:42 +02:00
Paweł Dziepak
15a0e2e386 cql3: use proper token type in token() function
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-14 16:12:38 +02:00
Paweł Dziepak
d06e450616 dht: add i_paritioner::token_to_bytes()
This allows token::_data to be in a different representation
than the one expected by the token type.

Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-14 16:12:30 +02:00
Paweł Dziepak
faa588cb0a dht: murmur3_paritioner: implement get_token_validator()
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-14 15:58:39 +02:00
Avi Kivity
cc30da38f9 Merge "CQL3 and WITH COMPACT STORAGE" from Paweł
"This series of patches solves several remaining issues with COMPACT
STORAGE support and translates the missing parts of the CQL3 frontend."
2015-08-14 16:55:03 +03:00
Paweł Dziepak
d9f20ebbd1 tests/cql3: add tests for compact storage tables
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-14 14:53:35 +02:00
Paweł Dziepak
b42a9d6e6a cql3: translate support of update statements for dense tables
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-14 14:53:35 +02:00
Paweł Dziepak
1119141959 cql3: translate validation code for compact storage tables
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-14 14:53:35 +02:00
Paweł Dziepak
f6a93be655 cql3: skip compact value columns with no name
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-14 14:53:35 +02:00
Paweł Dziepak
eeb26ca8de compound: fix iterator comparison for null values
_v.begin() points to the next element. If the size of last element
in a compound is zero then iterators pointing to second to last and
last element would seem equal. To fix this we also have to compare
_types_left.

Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-14 14:53:22 +02:00
Paweł Dziepak
83b18597d9 keys: allow incomplete keys in from_clustering_prefix()
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-14 14:10:36 +02:00
Avi Kivity
dc10545ef4 Merge seastar upstream
* seastar b56a6eb...432e973 (3):
  > dpdk: merge local patch to fix ixgbe
  > dpdk: rebase to latest upstream
  > net::dpdk: actually check the resulting cluster and not the original packet
2015-08-14 11:39:26 +03:00
Gleb Natapov
89e36541c3 Correctly enforce row limit in mutation_result_merger
Currently limit is enforced only on partition boundary, so real result
can contain 2*row_limit - 1 rows in the worst case. Fix it by trimming
rows from a mutation if only part of its rows fit the requested limit.
2015-08-13 18:28:30 +03:00
Avi Kivity
06c6432f1e messaging: fix bad return type in string deserializer
Found by gcc 6.
2015-08-13 17:51:29 +03:00
Avi Kivity
5c6a1eb1b0 Merge "Fixes for IN restrictions" from Paweł
"The following patches fix some remaining issues with IN restrictions,
namely empty IN () restriction and ordering of results."
2015-08-13 14:22:17 +03:00
Paweł Dziepak
36bd11bf96 tests/cql3: add tests for IN restrictions
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-13 11:36:16 +02:00
Paweł Dziepak
80fc1b1408 cql3: allow IN restriction only on last restricted column
2.2 allows IN on any column and it seems that we support that fine, but
DTESTs except us to reject such queries.

Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-13 11:34:26 +02:00
Paweł Dziepak
1402125bd8 cql3: reverse order of bounds for reversed selects
Because of the reverse flag in partition slice rows inside bounds will
be returned in reversed order, however, we still have to make sure
that the bounds are in the expected order.

Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-13 11:08:20 +02:00
Paweł Dziepak
486387bff8 cql3: sort and remove duplicates from clustering key restrictions
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-13 10:55:12 +02:00
Paweł Dziepak
9966a2eac6 cql3: sort and remove duplicates in multi-column IN restrictions
Values inside IN clause should be sorted and duplicates removed if the
restricted columns are part of the clustering key, which is always true
for multi column restrictions.

Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-13 10:52:42 +02:00
Paweł Dziepak
0afbbb9d44 cql3: fix empty IN () restriction
Values inside IN () restrictions may be either in a vector _in_values or
a marker (_in_marker or _value). To determine which one is appropriate
we check whether _in_values is empty, which is wrong because IN clause
can be empty (and there is no marker in such case). This is fixed by
using the presence of a marker to determine whether a vector of values
or a marker should be used.

Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-13 10:45:27 +02:00