Commit Graph

5348 Commits

Author SHA1 Message Date
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
Avi Kivity
124de4bcd1 main: rename logger name not to contain a space
Confuses other stuff.
2015-08-02 12:50:54 +03:00
Glauber Costa
746fdc87b9 main: convert error messages to logger
Calling the logger 'main' may cause confusion to external readers not familiar
with the source code, since there is nothing 'main' about this logger in
particular - that is just the file name.

It is then called the start up log.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-08-02 10:44:50 +03:00
Avi Kivity
66d6e471ad Merge seastar upstream
* seastar beeaccb...3cf6bee (4):
  > dpdk: i40e_should_linearize(): Check the resulting cluster and not the original packet
  > reactor: fix inverted logic in recursive_touch_directory()
  > build: suport -march=... in cflags
  > tests: futures_test: Add test case for parallel_for_each()
2015-08-01 10:18:19 +03:00
Glauber Costa
9dcc926e92 create directory for commitlog
The same way we create a directory for the sstables, we should do it for the
commitlog.

If you, like me, have been using the --datadir directive, the fact that we
don't do it would have slipped away: when using --datadir, both the commitlog
and sstables will be put in this same root.

However, when using the system defaults from the configuration file, this won't
be true.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-08-01 10:14:32 +03:00
Glauber Costa
cb4a4e4ce3 schema: fix regular column count
There is a small but potentially serious mistake in the way we are computing
the number of regular columns. We are using an incorrect offset, and the
number of regular columns in a table like this:

    schema(...,
            {{"pk", utf8_type}},
            {{"ck", utf8_type}, {"ck2", utf8_type}},
            {
                {"reg1", long_type},
                {"reg2", long_type},
            },
            {{"static", utf8_type}},
            utf8_type,
            "comment"
    );

is being reported as 3.

Fix this

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-08-01 10:11:59 +03:00
Raphael S. Carvalho
6bc822dd71 db: fix problem with initialization of a column family
We should only call column_family::start after the checks because
if a check failed, column_family would be destroyed without
column_family::stop being called first, and that would lead to
a problem, such as _compaction_done future not being resolved.

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-07-31 13:03:07 +03:00
Avi Kivity
465c03a8b5 Merge "gossip: cleanup" from Asias 2015-07-31 13:01:54 +03:00
Avi Kivity
834fd67567 Merge "streaming: improve stream completion" from Asias 2015-07-31 12:59:32 +03:00
Tomasz Grabiec
679b71e79f unimplemented: Use logger 2015-07-31 12:58:16 +03:00
Asias He
804564fe76 streaming: Remove completed stream in stream_manager 2015-07-31 16:27:55 +08:00
Asias He
90ec97743b streaming: Introduce get_stream_result_future
Stream manager tracks two kind of streams: initiated or receiving. Give
a plan_id, search both lists to get a stream_result_future instance.
2015-07-31 16:27:55 +08:00
Asias He
1749305165 streaming: Fix stream_result_future::create_and_register
It is used to create stream initiated by us.
2015-07-31 16:27:55 +08:00
Asias He
588da78574 streaming: Introduce stream_manager::get_sending_stream
Return streams initiated by us.
2015-07-31 16:27:55 +08:00
Asias He
4d12f40b8a streaming: Implement stream_manager::register_sending
It is used to track streams initiated by us.
2015-07-31 16:27:55 +08:00
Asias He
59cae82470 streaming: Make stream_plan::execute return a future
Returns a ready future if the stream_plan completes successfully, or a
failed future otherwise.
2015-07-31 16:27:55 +08:00
Asias He
3a5af0a7fb streaming: Fix stream_coordinator::is_receiving
Unlike Origin, We can not use _connections_per_host == 0 to indicate we
are a follower since we set _connections_per_host to 1 for follower too.
2015-07-31 16:27:55 +08:00
Asias He
67acaf1a79 streaming: Convert StreamException.java to C++ 2015-07-31 16:27:55 +08:00
Asias He
8864d0c25c streaming: Import StreamException.java 2015-07-31 16:27:55 +08:00
Asias He
eaa3fd299b logger: Align log level 2015-07-31 16:27:55 +08:00
Asias He
eb79a119bf gossip: Move code from gms/gossip_digest_syn.hh to source file 2015-07-31 10:43:40 +08:00
Asias He
175ccfe49d gossip: Move code from gms/gossip_digest_ack2.hh to source file 2015-07-31 10:43:40 +08:00
Asias He
3ad6d1309f gossip: Move code from gms/gossip_digest_ack.hh to source file 2015-07-31 10:43:40 +08:00
Asias He
6398bb4bdc gossip: Move code from gms/endpoint_state.hh to source file 2015-07-31 10:43:40 +08:00