Commit Graph

5120 Commits

Author SHA1 Message Date
Asias He
4e72b2a6b1 gossip: Fix mark_dead
We should change the state stored in endpoint_state_map, not local
variable.
2015-07-24 15:56:04 +08:00
Asias He
c3b77f499b failure_detector: Enable logger 2015-07-24 15:56:04 +08:00
Asias He
1eef40e9ae gossip: Add error handling for sending message 2015-07-24 15:56:04 +08:00
Asias He
b856d03338 gossip: Use logger.debug in dump_endpoint_state_map 2015-07-24 15:56:04 +08:00
Asias He
c0ff7feeb3 tests: Set logger level to trace for tests/urchin/gossip.cc 2015-07-24 15:56:04 +08:00
Asias He
5aedb7cfda messaging_service: Drop rpc client when rpc errors 2015-07-24 15:56:04 +08:00
Pekka Enberg
7fe99de608 gms/gossiper: Enable more token_metadata::is_member() checks
Translate more is_member() checks like in commit 67f4b55 ("gms/gossiper:
Fix is_gossip_only_member() logic").

This hopefully cures #36.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-07-23 19:50:11 +02:00
Glauber Costa
6624dd7491 schema: add default value to compaction strategy class
Because we will do from and to sstring operations on it, it needs
a default value. The lack of it is causing our tests to fail.

This should have been included in the original patch but I have somehow
missed it. Sorry.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-23 20:34:20 +03:00
Avi Kivity
0ff7ed8a48 Merge "One stop per service" from Glauber
"Not all services define a stop method. All of them should."
2015-07-23 18:55:44 +03:00
Glauber Costa
4cd143de87 filter_tracker: define and call a stop method
All sharded services "should" define a stop method. Calling them is also
a good practice. For this one specifically, though, we will not call stop.
We miss a good way to add a Deleter to a shared_ptr class, and that would
be the only reliable way to tie into its lifetime.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-23 11:11:57 -04:00
Glauber Costa
b488b06fa4 cql_server: define and call a stop method
All sharded services "should" define a stop method. Calling them is also
a good practice.

Blindly calling it at exit is wrong, but it is less wrong than not calling
it at all, and makes it now equally as wrong as any of the other services.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-23 11:11:57 -04:00
Glauber Costa
60cdfa20c1 thrift_server: define and call a stop method
All sharded services "should" define a stop method. Calling them is also
a good practice.

Blindly calling it at exit is wrong, but it is less wrong than not calling
it at all, and makes it now equally as wrong as any of the other services.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-23 11:10:48 -04:00
Glauber Costa
f323551ebb thrift_server: make destructor out of line
The destructor depends on a lot of things (like the thrift lib classes), that
are not visible from the .hh. It works fine so far because nobody is trying to
destroy it explicitly either. But soon I will.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-23 10:57:53 -04:00
Gleb Natapov
dadd097f9c do not use boost::multiprecision::msb()
It is not available in boost older than 1.55.
2015-07-23 17:55:12 +03:00
Avi Kivity
bb3aef7fd9 Merge "Basic schema handling of compact strategy" from Glauber
"With this patchset, cqlsh's describe table command now work"
2015-07-23 16:47:29 +03:00
Avi Kivity
f413e137dd Merge seastar upstream 2015-07-23 16:35:28 +03:00
Avi Kivity
be32746c58 Merge "Handle Compact Storage" from Glauber
"This is my current proposal for Compact Storage tables - plus
the needed infrastructure.

Getting rid of the CellName abstraction allows us to simplify
things by quite a lot: now all we need is to mark whether or
not a table is composite, and provide functions to play the
role of the comparator when dealing with the strings."
2015-07-23 16:20:31 +03:00
Avi Kivity
2d2422b6b7 Merge 2015-07-23 16:19:41 +03:00
Tomasz Grabiec
5cb840ad09 Merge tag 'asias/tests/gossip_fix/v1' from seastar-dev.git
Gossip test fixes from Asias.
2015-07-23 16:16:46 +03:00
Pekka Enberg
b912c888f1 service/migration_manager: Fix logging by de-thread-localizing loggers
The migration_manager and migration_task logging is currently not
visible in the logs. Fix that by de-thread-localizing both loggers.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-07-23 16:16:14 +03:00
Avi Kivity
eea955723e Merge "Serialize query::range<token> in stream_request" from Asias 2015-07-23 16:06:33 +03:00
Tomasz Grabiec
3fd682de4b db/legacy_schema_tables: Fix dead lock in create table statement
merge_schema() was recursively calling itself, causing it to block
iself on a non-recursive lock.
2015-07-23 12:37:42 +02:00
Gleb Natapov
e41880fc66 drop reference to storage_proxy from read executors
Now when storage_proxy can be accessed globally there is no need to
waste memory to save its pointer in each read executor.
2015-07-23 12:32:21 +03:00
Gleb Natapov
00d4974cec storage_proxy: add logger
Uncomment exiting logging points.
2015-07-23 12:32:21 +03:00
Gleb Natapov
f122ee39b9 storage_proxy: return proper error codes to transport layer
Transport layer expects to get error code in an exception of type
exceptions::cassandra_exception. Fix code to use it as a base for
all user visible exceptions and put correct error code there.
2015-07-23 12:32:21 +03:00
Asias He
e558efc42c tests: Use time based generation_number number 2015-07-23 15:26:46 +08:00
Asias He
879ca5adaf tests: Fix tests/urchin/gossip.cc
After commit 67f4b55b16 "gms/gossiper: Fix is_gossip_only_member() logic",
storage_service is needed by gossip.

To fix, start storage_service in the test. Also, improve the
indentation.
2015-07-23 15:26:46 +08:00
Pekka Enberg
78ee9e7478 db/system_keyspace: Fix "peers" table "schema_version" column type
The column type of "schema_version" is set to UTF8 which results in the
following value conversion errors:

  storage_service: fail to update schema_version for 127.0.0.2: boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::bad_any_cast> > (boost::bad_any_cast: failed conversion using boost::any_cast)

Change the column type to UUID like in Origin. Fixes #35.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-07-23 09:37:32 +03:00
Avi Kivity
c1aed26377 Merge "More fixes for ORDER BY clauses"
"These patches fix more problems related to ORDER BY clauses.
Firstly, mutation_partition::query() can now return rows in reveresed
order which makes it easy for select statements to ask for data from
single partition with clustering keys in reversed order even if limit
of rows is set.
That alone is not sufficient, though, if the request contains IN clause
on partition keys and number of returned rows is limited. The information
needed to determine which rows need to be in the reply isn't available
before post-query sort is done, so select statement asks for more rows
than the limit and trims the output later."
2015-07-23 07:27:53 +03:00
Avi Kivity
ae6ea2a7a8 Merge "Fix setting collections to null" from Paweł
"The following patches fix a bug in collections setters where the tombstone
was created but never applied if the collection was set to null.

This series makes cql_tests.py:TestCQL.null_support_test pass."
2015-07-23 07:23:08 +03:00
Glauber Costa
4e83530c3f do not "throw new"
This is how Java does. But in C++, "throw new", although valid, would require
the catcher to catch a pointer to the exception - which isn't really what we
do.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-23 07:07:17 +03:00
Glauber Costa
f778e2aea2 system keyspace: set compaction strategy options for system.hints
This is the last system table that needed parameters. All them are
now devoid of fixmes

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-23 00:02:11 -04:00
Glauber Costa
2c3463cf1f schema: handle compaction strategy options
We will store the options in the schema, but it is not yet used by
the compaction code.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-23 00:02:11 -04:00
Glauber Costa
d1496944d9 sstables: handle compaction strategy
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-23 00:02:11 -04:00
Glauber Costa
3a21ca5056 unimplemented: remove compact table
We have it now.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-22 23:51:00 -04:00
Glauber Costa
5c33549be5 system tables: mark some system tables as compact storage
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-22 23:10:22 -04:00
Glauber Costa
81e7a9ced7 sstable tests: test the writing of a compact sstable
Since the read tests are validated using Origin-generated tables, our
write test will just write to the tables and make sure we can read them
back ok.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-22 23:10:22 -04:00
Glauber Costa
c2232d2f2e tests: move some definition from mutation_test to the common header
I would like to use them from sstable_datafile_test.cc to make sure that
the tables we write are really correct.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-22 23:10:22 -04:00
Glauber Costa
cd91f2ecdc sstables: add tests for dense tables
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-22 23:10:22 -04:00
Glauber Costa
96f7c77a04 sstables: write dense tables
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-22 23:10:22 -04:00
Glauber Costa
2757cc595a sstable partition: read dense tables
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-22 23:10:22 -04:00
Glauber Costa
bb78499063 sstables: test for non-compound tables
Test the read of a table that is not compound NOR dense.
Dense tables will be handled later.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-22 23:10:21 -04:00
Glauber Costa
87c77acbac sstables: correctly write column names for non compound types
This can happen for COMPACT STORAGE.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-22 23:10:21 -04:00
Glauber Costa
3383c619ad partition: handle reads of non-composite types
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-22 23:10:21 -04:00
Glauber Costa
e9094db7ef sstable partition: remove dead code
This is no longer used

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-22 23:10:21 -04:00
Glauber Costa
5b7c749310 sstables: simplified version of write_column_name for non-clustered columns
We still want to wrap it instead of writing the column name directly, so we are
able to update the statistics.

It is better to have a separate function for this, because write_column_name
doesn't have enough information to decide when to do what. Augmenting it so we
could have would require passing the schema, or an extra parameter, which would
then spread to all callers.

Keep in mind that testing for an empty clustering key is not enough, since
composite types will serialize the empty clustering key in this case.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-22 23:10:21 -04:00
Glauber Costa
09631cbf5a schema: fix comparator field
We were currently using the regular column name as the comparator. That is
only correct in some specific cases, in particular, of a non-compound cell name,
that has no collections.

Now that we have the cell_name.hh infrastructure, we can use it.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-22 23:10:21 -04:00
Glauber Costa
d7cb078592 sstable_tests: convert schemas to use the schema_builder
Technically, this is not needed for the existing schemas: the builder is only
necessary when we are setting properties. For consistency, however, let's
convert them all.

Soon we will have some schemas that will set properties. In particular, compact
storage.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-22 23:10:21 -04:00
Glauber Costa
194a24fd37 sstable_tests: move cs schema to sstable_test.hh
This solitary schema definition should go live with the rest.
We give it a more descriptive name now that it is going.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-22 23:10:21 -04:00
Glauber Costa
d5b4731e49 schema: make all schemas be generated by the schema_builder
Some of the fields in the schema will not not be passed directly, but
calculated by the schema_builder. This is because they are not simple values of
the form a = x, but slightly more complex and have to be derived from other
properties (for instance, the amount of clustering keys).

For those values, a default value does not really make sense. Take for instance
the case of the comparator: there is always a comparator, and there is not any
comparator that can serve as a default. Which comparator to use depend on
whether or not the table has collections, whether or not it has clustering
keys, and whether or not it is marked as compact storage.

Making all tables go through the builder is a guarantee that all of them
will have their values set.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-22 23:10:21 -04:00