Commit Graph

5371 Commits

Author SHA1 Message Date
Pekka Enberg
12d99bd282 service/migration_manager: Migration listener hooks
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-08-05 11:50:51 +03:00
Pekka Enberg
5b3f7f8091 service: Convert MigrationListener to C++
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-08-04 15:08:24 +03:00
Pekka Enberg
44b53be4a1 service: Import IMigrationListener.java
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-08-04 13:17:05 +03:00
Vlad Zolotarov
707f3b25e3 transport: cql_server::connection: paralellization of cql requests handling
Take the request processing part into the separate function and
run it in parallel for incoming requests.

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2015-08-04 13:05:46 +03:00
Avi Kivity
8bc863bd14 Merge "Translating multi column restrictions" from Paweł
"This patchset translates all the remaining parts of Java code needed to
support multi column restrictions. There are at least two problems left
though:
 - CASSANDRA-8613 - allow something like:
   SELECT * FROM table WHERE c1 = 0 AND (c2, c3) = (1, 2)
   currently columns restricted by multi column restrictions need to be a
   prefix of clustering key
 - CASSANDRA-7281 - incorrect results if some of the columns have reversed
   type
I didn't want to delay this patchset any further and fixing these issues
isn't as straighforward as just translating Java to C++."
2015-08-04 12:51:27 +03:00
Nadav Har'El
27a5f53b10 main: better error message on invalid logger name
If a user tries to configure a non-existant logger, he gets an obscure error
message:

    $ scylla --logger-log-level nonexistant=info
    Exiting on unhandled exception of type 'std::out_of_range': _Map_base::at

With this patch,

    $ scylla --logger-log-level nonexistant=info
    Exiting on unhandled exception of type 'std::runtime_error':
    Unknown logger 'nonexistant'. Use --help-loggers to list available loggers.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-08-04 12:29:04 +03:00
Paweł Dziepak
77dd2faee0 tests/cql3: add tests for multi column relations
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-04 10:59:15 +02:00
Paweł Dziepak
0069040eb3 cql3: enable multi column restrictions
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-04 10:59:13 +02:00
Paweł Dziepak
f5a9fdfc61 cql3: translate MultiColumnRelation.java to C++
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-04 10:59:06 +02:00
Paweł Dziepak
c27acf56d3 cql3: translate MultiColumnRestriction.java to C++
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-04 10:58:53 +02:00
Paweł Dziepak
a03b148f54 cql3: make check_[not]_null() validator work with stdx::optional
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-04 10:58:32 +02:00
Paweł Dziepak
38ba7edf53 cql3: add method to_string() to term_slice
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-04 10:58:26 +02:00
Paweł Dziepak
9f2fd53a6e cql3: trasnlate remaining parts of tuples.hh to C++
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-04 10:58:06 +02:00
Nadav Har'El
6bd3817ed0 main: better error message for unsupported log level
If someone uses "--logger-log-level" with an unknown log level, e.g.,
"--logger-log-level repair=hello", the exception currently reported to the
user is:

   bad lexical cast: source type value could not be interpreted as target

In a long command line, the user has no idea where this exception is coming
from. This patches catches this exception, and instead reports a runtime_error
with the text:

   Unknown log level 'hello'

Which hopefully should be much more user friendly.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-08-04 11:24:37 +03:00
Shlomi Livne
b8bcf6d6e7 Fix a bug in mutation response processing in smp
Current code passes the storage_proxy instance of the shard on which the
message was received instead of using the storage_proxy instance of the
shard that sent the request.

Signed-off-by: Shlomi Livne <shlomi@cloudius-systems.com>
2015-08-04 11:23:49 +03:00
Pekka Enberg
a3c95235e6 migration_manager: Make stateful with sharded<>
In preparation for adding listener state to migration manager, use
sharded<> for migration manager.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-08-04 11:23:23 +03:00
Avi Kivity
536d6fa32a tests: fix mutation_test use-after-free
Two bugs:
 - column_family not stop()ped after use
 - flush() future not waited on
2015-08-04 11:19:59 +03:00
Tomasz Grabiec
793a4fabf9 locator: Drop the _logger suffix from logger name
We know it's a logger.
2015-08-04 10:49:38 +03:00
Raphael S. Carvalho
34eaeedff2 db: remove imprecise log message about compaction
This message is printed when we are about to run the strategy code
which may not decide to compact anything. Compaction is already
properly logged in sstables::compact_sstables().

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-08-04 00:15:50 +03:00
Avi Kivity
9663ea86e9 db: fix test for whether an sstable includes a shard's range
Spotted by Raphael and Nadav.
2015-08-04 00:14:22 +03:00
Avi Kivity
eaca3f7cd1 build: forward compiler selection to seastar configuration 2015-08-03 22:37:32 +03:00
Avi Kivity
3a5e3c8829 sstables: de-futurize write path
The sstables write path has been partially de-futurized, but now creates a
ton of threads, and yet does not exploit this as everything is serialized.

Remove those extra threads and futures and use a single thread to write
everything.  If needed, we'll employ write-behind in output_stream to
increase parallelism.

Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-08-03 20:33:59 +03:00
Avi Kivity
2929510ef3 Merge "Range friendly sharding"
Switch sharding to work on the most significant bits of the token,
rather than the least significant bits.  This is more friendly to
range operations, since adjacent partitions will reside on the same shard.

Not exploited yet, except for ignoring sstables that don't belong to a
shard.
2015-08-03 20:32:58 +03:00
Avi Kivity
c1a2831d41 db: ignore sstables that clearly don't belong to this shard 2015-08-03 20:17:41 +03:00
Avi Kivity
ad443e4771 sstable: add accessor for first/last partition keys 2015-08-03 20:17:41 +03:00
Avi Kivity
6ca6f0c3a4 sstables: add conversion function from sstable key to partition key 2015-08-03 20:17:40 +03:00
Avi Kivity
f915ff1fcd dht: introduce i_partitioner::shard_of() and implement msb sharding
Make sharding partitioner-specific, since different partitioners interpret
the byte content differently.

Implement it by extracting the shard from the most significant bits, which
can be used to minimize cross shard traffic for range queries, and reduces
sstable sharing.
2015-08-03 20:17:40 +03:00
Avi Kivity
526c20157a Merge "Introduce storage_proxy::make_local_reader()" from Tomasz
A convenient mutation_reader combining readers from all shards. Is supposed
to make implementing streaming easier.
2015-08-03 16:37:00 +03:00
Tomasz Grabiec
b88fc51e2a tests: Introduce test for storage_proxy::make_local_reader() 2015-08-03 15:21:40 +02:00
Tomasz Grabiec
51b3bf38bb storage_proxy: Introduce make_local_reader() 2015-08-03 15:21:40 +02:00
Tomasz Grabiec
14f8c242b2 tests: cql_test_env: Simplify make_env_for_test() using seastar::async() 2015-08-03 15:21:36 +02:00
Avi Kivity
a9cc6d7be1 Merge "Parallel CQL table creation improvements" from Pekka
"This series improves parallel CQL table creation to validate CF UUID.
This should bring us closer to Origin behavior when there's multiple
cassandra-stress processes started at the same time."
2015-08-03 14:37:29 +03:00
Pekka Enberg
e22f5a1cd7 database: Add CF UUID validation to update
Add CF UUID validation to update table paths to make us behave like
Origin for parallel table creation.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-08-03 13:41:16 +03:00
Pekka Enberg
a520f6499f utils/UUID: Add inequality operator overloading
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-08-03 13:41:16 +03:00
Pekka Enberg
0b762338c1 database: Futurize update_column_family()
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-08-03 13:41:16 +03:00
Tomasz Grabiec
19851fb8db storage_proxy: Move stop() implementation to source file 2015-08-03 11:52:23 +02:00
Pekka Enberg
59c5be12ae db/legacy_schema_tables: Convert create_table_from_name()
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-08-03 12:41:01 +03:00
Nadav Har'El
b229f1bc61 Fix abstract_replication_strategy's logger
The existing code tried to make the logger a function-local static object.
This attempt is commendable, because it means the logger is only created
when first used - if used at all. But it doesn't play well with our logging
infrastructure, which *assumes* that all logger objects are created during
initialization, and register themselves, to make it possible to implement
the "--logger-log-level" and "--help-loggers" command line parameters.

So the logger needs to be a global object, not a function-local object.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-08-03 12:36:28 +03:00
Avi Kivity
1e086b7b0b Merge "Adding stats to the column family" from Amnon 2015-08-03 12:22:40 +03:00
Amnon Heiman
cea73277ca API: Add read, write, and flush statistic to column_family
This adds the API implementation for the read, write, number of
panding flushes and memtable switch count.

The implementation uses a helper function to perform map and map_reduce
on column_family.

The get_uuid helper method now supports both colon notations (i.e.
either as a ":" or as %3A)

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-08-03 11:36:40 +03:00
Amnon Heiman
8356b493a3 API: Adding read and write counters to column_family definition
This adds the read and write counters to the column_family swagger
definitions.

It adds the following commands:
get_read
get_all_read
get_write
get_all_write

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-08-03 11:36:33 +03:00
Paweł Dziepak
5f2fd9b4dd cql3: cassandra_exceptions shouldn't be logged as errors
Only unexpected server errors should be logged, exception classes
deriving from cassandra_exception do not count as those.

Fixes #60.

Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-03 11:09:50 +03:00
Amnon Heiman
0d7fe9bd89 Adding stats to column_family
This adds the stats object to column_family.

It set the write counter in the write path and support the pending_flush
counter.

The stats object contains information for switch_count, number of
pending flushes, and counters for read, write, and range.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-08-03 11:09:37 +03:00
Asias He
1da37796bc gossip: Fix do_shadow_round
We sleep storage_service_ring_delay until we abort due to failing to
talk to a seed node. We should retry sending GossipDigestSyn message,
instead of sending it once.

With this, we can start the seed node and normal node in a script like
below, without any sleep between.

./scylla --listen-address 127.0.0.1
./scylla --listen-address 127.0.0.2

This is useful for testing.
2015-08-03 10:05:42 +03:00
Vlad Zolotarov
86e28bbf5d transport::cql_server::connection::process(): Consume the last future
When process() terminated _ready_to_respond contains the future with the
state of the last I/O operation of this connection. Consume it at the
end of process().

Fixes issue #44

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2015-08-02 19:24:13 +03:00
Avi Kivity
0ef1fac078 Merge seastar upstream
* seastar 3cf6bee...947619e (1):
  > Merge "net: add statistics counter for linearization events" from Vlad
2015-08-02 19:16:13 +03:00
Raphael S. Carvalho
477a3586d7 compaction: add missing information to compaction log
duration and throughput weren't being calculated.

closes #54.

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-08-02 19:15:57 +03:00
Nadav Har'El
1d31a929b9 config: fix options with string_map type
Several of Scylla's options (in db/config.hh) have the type "string_map"
(unordered_map<sstring, sstring>). The intent was such options could get
multiple "key=value" settings. However, this never actually worked correctly,
and had two bugs:

 1. Any option name with a space in it would fail, for example:
       $ scylla --logger-log-level  'BatchLog Manager=info'
       error: the argument ('BatchLog Manager=info') for option '--level'
              is invalid

 2. Trying to set multiple entries in the map did *not* work. For example,
       $ scylla --logger-log-level  a=info --logger-log-level b=info
       error: option '--level' cannot be specified more than once

The problem is that boost::program_options does not actually understand
unordered_map<sstring, sstring>: It doesn't know it is a container (it
only recognizes std::vector) so it doesn't allow multiple options, and
it doesn't know how to convert a string to it, so it uses boost::lexical_cast
which for strings, cuts the string at a space...

The solution is to write a custom "validate()" function overload, which
boost::program_options uses to validate (and consume) options into object
types it doesn't understand by default. Getting this function in the right
place in the code was a difficult exercise, but here it is, a working
implementation :-) And it fixes the above two bugs.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-08-02 17:19:35 +03:00
Shlomi Livne
199f4d2545 Add enable-in-memory-data-store,enable-commitlog,enable-cache config
Abillity to enable/disable specific sub-modules - this settings do not
affect system tables which are allways persisted,cached and written to
commitlog

enable-in-memory-data-store marks if tables will be written/read to/from
disk
enable-commitllog marks if tables will be written to commitlog
enable-cache marks if tables will be written/read to/from cache

Please note in-memory-data-store does not change the read path so "old"
sstables are still read and cache may be used to cache their data

Signed-off-by: Shlomi Livne <shlomi@cloudius-systems.com>
2015-08-02 17:19:30 +03:00
Avi Kivity
98ec451d6a Extract range<> into its own header
It's not just for queries any more.
2015-08-02 16:07:42 +03:00