Tomek pointed out that we shouldn't be passing a reference to commitlog every
time we use the add_column_family interface, because that will at times pass a
reference to a null object.
Test that, and pass no_commitlog if there is none.
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
The patch introduces reconciliation code. The same code suppose to be
working for both range and single key queries. Handling of raw_limit,
short reads and read repairs is still very much missing.
--
v1->v2:
- call live_row_count() only once.
According to the comments, we are doing this for simplicity, to avoid
creating a new type_parse object.
However, while this approach works well for the simple case where we expect
a single token, it won't work as the parser becomes more able to recognize
other cases.
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
Note that the multicell attribute can't be part of the parse instance, because
otherwise we would either freeze every subsequent element, or complicate the
flow considerably to handle it.
It is instead, passed as a parameter to get_instance_types(), which will then
have to be propagated to parse() and get_abstract_type()
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
We currently have a bug when parsing collection types that contains collections
themselves.
We call the recursion correctly, but get_abstract_type gets its value by copy, not
reference. Therefore, all work it does in the _idx manipulation is done in the copy,
and when the callee returns, the caller, with its _idx unchanged, will try recursing
again.
Fix it by passing by reference
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
Collections can at times have the form <hex>:type. This is the case,
for instance, for the strings that compose the comparator string. The
actual hex number isn't terribly interesting: it is used as a key to
hash the collection types, but since we hash them by their types anyway,
we can safely ignore them.
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
Schema versioning from Pekka:
"This series adds support for schema versioning. It's a prerequisite for
schema pull functionality which needs to know if the schema has been
changed on other nodes.
Schema version is a content-based hash of the schema. When there's a
schema change on local node, "schema_version" UUID is updated using a
MD5 hash of system table contents:
Node 1:
[penberg@nero apache-cassandra-2.1.7]$ ./bin/cqlsh --no-color 127.0.0.1
Connected to Test Cluster at 127.0.0.1:9042.
[cqlsh 5.0.1 | Cassandra 2.2.0 | CQL spec 3.2.0 | Native protocol v3]
Use HELP for help.
cqlsh> SELECT key, schema_version FROM system.local;
key | schema_version
-------+--------------------------------------
local | d41d8cd9-8f00-3204-a980-0998ecf8427e
(1 rows)
cqlsh> CREATE KEYSPACE keyspace3 WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };
cqlsh> SELECT key, schema_version FROM system.local;
key | schema_version
-------+--------------------------------------
local | 02a099fa-9914-324b-b0c7-b62916584844
(1 rows)
Node 2:
[penberg@nero apache-cassandra-2.1.7]$ ./bin/cqlsh --no-color 127.0.0.2
Connected to Test Cluster at 127.0.0.2:9042.
[cqlsh 5.0.1 | Cassandra 2.2.0 | CQL spec 3.2.0 | Native protocol v3]
Use HELP for help.
cqlsh> SELECT key, schema_version FROM system.local;
key | schema_version
-------+--------------------------------------
local | d41d8cd9-8f00-3204-a980-0998ecf8427e
(1 rows)
cqlsh> SELECT key, schema_version FROM system.local;
key | schema_version
-------+--------------------------------------
local | 02a099fa-9914-324b-b0c7-b62916584844
(1 rows)
"
syslogd supprt from Avi:
Allow log output to go to syslog, from where it can be shipped to journald/
some other machine/splunk/whatever. Disabled by default, exposed via config.
config.hh changes rapidly, so don't force lots of recompiles by including it.
Need to place seed_provider_type in namespace scope, so we can forward
declare it for that.
The code does:
auto fm = make_lw_shared<std::vector<frozen_mutation>>(schema.begin(), schema.end());
return net::get_local_messaging_service().send_message_oneway(net::messaging_verb::DEFINITIONS_UPDATE,
std::move(id), std::move(fm));
ms.register_handler(net::messaging_verb::DEFINITIONS_UPDATE, [this] (std::vector<frozen_mutation> m) {
...
}
We should not send a lw_shared_ptr, but std::vector<frozen_mutation>.
However, from Gleb:
Well, this is not a bug, this is really cool (and to be honest
unintended) feature of RPC. It is smart enough to detect that it is a
smart pointer to an object and dereference it. But in this particular
case there is not justification to use shared_ptr in the first place.
So, drop the lw_shared_ptr anyway.
As the name implies, this patch introduces the concept of automatic
compaction for sstables.
Compaction task is triggered whenever a new sstable is written.
Concurrent compaction on the same column family isn't supported, so
compaction may be postponed if there is an ongoing compression.
In addition, seastar::gate is used both to prevent a new compaction
from starting and to wait for an ongoing compaction to finish, when
the system is asked for a shutdown.
This patch also introduces an abstract class for compaction strategy,
which is really useful for supporting multiple strategies.
Currently, null and major compaction strategies are supported.
As the name implies, null compaction strategy does nothing.
Major compaction strategy is about compacting all sstables into one.
This strategy may end up being helpful when adding support to major
compaction via nodetool.
Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>