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>
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>
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>
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>
"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."
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>
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.
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.
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>
"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."
"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."
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>
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>
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>
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>
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>
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>
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>
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>
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>
Origin has another column_kind, that we lack: compact_value. This kind is
used to identify regular columns of dense tables.
Take for instance, the following table:
CREATE TABLE ks2.compact (
ks text,
cl1 text,
cl2 text,
PRIMARY KEY (ks, cl1)
) WITH COMPACT STORAGE
cqlsh> select keyspace_name, columnfamily_name, column_name, type from system.schema_columns \
where keyspace_name='ks2' and columnfamily_name='compact';
keyspace_name | columnfamily_name | column_name | type
---------------+-------------------+-------------+----------------
ks2 | compact | cl1 | clustering_key
ks2 | compact | cl2 | compact_value
ks2 | compact | ks | partition_key
We will treat those columns as regular columns for most purposes. Because of
that, we don't need to separate them from the regular columns when we sort
initially, for instance. All we have to do is change its type.
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
This is how it happens for Origin. Take for instance the following CF:
CREATE TABLE ks2.noregular_cs2 (
ks text,
cl1 text,
cl2 text,
PRIMARY KEY (ks, cl1, cl2)
) WITH COMPACT STORAGE;
cqlsh> select keyspace_name, columnfamily_name, column_name from system.schema_columns \
where keyspace_name='ks2' and columnfamily_name='noregular_cs2';
keyspace_name | columnfamily_name | column_name
---------------+-------------------+-------------
ks2 | noregular_cs2 | <===== added this.
ks2 | noregular_cs2 | cl1
ks2 | noregular_cs2 | cl2
ks2 | noregular_cs2 | ks
In order to achieve that, we need to relax the test in db/legacy_schema_tables.cc.
It will throw in case it finds an empty name.
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
We are deviating a bit from Origin here: In Origin, we would store a full
comparator class. However, due to the fact that our types are very different,
and as a consequence we will not call a serializer directly on the cell name,
that is not necessary.
The only information that we will need to store is whether or not the table is
compound. Some functions to manipulate it will be presented in the next patch.
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
We currently have code to calculate "is_dense" in the create statement handler.
That obviously don't work for the system schemas, which are not defined this
way.
Since all of our schemas now have to pass through the schema_builder one way or
another, that is the best place in which to do that calculation.
Note that unfortunately, that does not mean we can just get rid of
set_is_dense() in the schema builder: we still need to set it in some
situations, where for instance, we read that property in schema_columnfamilies,
and then apply to the relevant CF. Those uses are, however, all internal to
legacy_schema_tables.cc
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>