Commit Graph

4867 Commits

Author SHA1 Message Date
Avi Kivity
6d9e95ef93 Merge "Fixes and enhancements for type parser" from Glauber 2015-07-16 20:08:40 +03:00
Glauber Costa
4250b7dd64 database: do not use commitlog constructor if there is no commitlog
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>
2015-07-16 20:04:29 +03:00
Gleb Natapov
640e65b947 storage_proxy: Reconciliation. The beginning
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.
2015-07-16 19:23:58 +03:00
Tomasz Grabiec
388c23291a Merge branch 'pdziepak/random-cql3-fixes/v2' from seastar-dev.git
Fixes for CQL from Pawel.
2015-07-16 18:16:44 +03:00
Paweł Dziepak
fe491ee5f5 cql3: make sure an exception is caught in create statements
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-16 16:23:39 +02:00
Paweł Dziepak
b2cdd36769 cql3: make sure an exception is caught in delete statements
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-16 16:23:27 +02:00
Paweł Dziepak
6107c6dd09 types: rename why() to what() in exception classes
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-16 16:23:14 +02:00
Paweł Dziepak
a6d0ed205b cql3: use api::missing_timestamp for missing timestamps
A missing timestamp is a missing one, not the smallest one.

Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-16 16:23:03 +02:00
Glauber Costa
bfe7656cfc types_test: add test for collection parser
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-16 09:47:00 -04:00
Glauber Costa
e5dbbc61a2 type_parser: parse tuples
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-16 09:47:00 -04:00
Glauber Costa
8b94cc8654 type_parser: don't duplicate parsing code.
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>
2015-07-16 09:47:00 -04:00
Glauber Costa
9b96a2441a type parser: detect frozen types
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>
2015-07-16 09:47:00 -04:00
Glauber Costa
31e22034f2 type_parser: fix a bug with recursive parsing
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>
2015-07-16 09:47:00 -04:00
Glauber Costa
85be9f55e8 type_parser: find - and ignore strings in the form <hex>:type
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>
2015-07-16 09:47:00 -04:00
Tomasz Grabiec
b176917a13 Merge branch 'penberg/schema-version/v2' from seastar-dev.git
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)
"
2015-07-16 16:28:57 +03:00
Pekka Enberg
da53127e35 service/migration_manager: Wire up versioning to merge_schema()
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-07-16 14:53:31 +03:00
Pekka Enberg
c090ac076f service/migration_manager: Convert passiveAnnounce() to C++
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-07-16 14:53:31 +03:00
Pekka Enberg
b417405f48 service/migration_manager: Enable logging
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-07-16 14:53:31 +03:00
Pekka Enberg
822d3cab55 service/storage_service: Make value_factory public
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-07-16 14:53:31 +03:00
Pekka Enberg
e8d110a8e3 db/legacy_schema_tables: Convert calculateSchemaDigest() to C++
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-07-16 14:53:31 +03:00
Pekka Enberg
2520112bda db/system_keyspace: Add query_mutations() function
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-07-16 14:53:30 +03:00
Pekka Enberg
440157b07b db/system_keyspace: Use database::get_version() instead of random UUID
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-07-16 14:53:30 +03:00
Pekka Enberg
81cddec777 database: Add versioning support
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-07-16 14:53:30 +03:00
Pekka Enberg
c003f89484 utils/UUID_gen: Add bytes_view variant of get_name_UUID()
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-07-16 14:53:30 +03:00
Avi Kivity
0b9eecc2d1 Merge branch 'master' of github.com:cloudius-systems/urchin into db 2015-07-16 13:10:49 +03:00
Avi Kivity
c74e36c30e Merge branch 'master' of github.com:cloudius-systems/urchin into db
Conflicts:
	message/messaging_service.cc
	message/messaging_service.hh
2015-07-16 12:51:19 +03:00
Tomasz Grabiec
3e69a0b137 Merge tag 'avi/syslog/v1' from seastar-dev.git
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.
2015-07-16 12:45:45 +03:00
Avi Kivity
8af2975473 Merge "Improve messaging_service build time, part 4" from Asias 2015-07-16 12:33:27 +03:00
Avi Kivity
1d4805236b messaging_service: don't include config.hh in .hh
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.
2015-07-16 12:26:02 +03:00
Asias He
c75e89da88 messaging_service: Farewell rpc.hh 2015-07-16 17:23:26 +08:00
Asias He
48c895aa18 messaging_service: Move rpc_protocol_wrapper and friends to .cc file 2015-07-16 17:23:26 +08:00
Asias He
244b9289c6 api/messaging_service: Use get_stats
Hide rpc::protocol<serializer, messaging_verb>::client from it.
2015-07-16 17:23:26 +08:00
Asias He
70236dbfa6 messaging_service: Add shard_info::get_stats helper
Will be used in api/messaging_service.cc.
2015-07-16 17:23:26 +08:00
Asias He
8c2cd037a2 messaging_service: Include rpc_types.hh
so that when we remove rpc.hh, types like rpc::closed_error will be
available.
2015-07-16 17:23:26 +08:00
Asias He
8bc59fb0b9 messaging_service: Move register_handler and send_message to .cc file 2015-07-16 17:23:26 +08:00
Asias He
14526e31b0 tests: Disable tests/urchin/message.cc for now
The interface of ms.send_message() will be gone shortly. We need to
write the tests using the new interface. Let's postpone it a bit.
2015-07-16 17:23:26 +08:00
Asias He
b07ae77585 messaging_service: Add wrapper for READ_DIGEST verb 2015-07-16 17:23:26 +08:00
Asias He
c19f5edefe messaging_service: Add wrapper for READ_MUTATION_DATA verb 2015-07-16 17:23:26 +08:00
Asias He
85c6dc0b7e messaging_service: Add wrapper for READ_DATA verb 2015-07-16 17:23:26 +08:00
Asias He
0707c15000 messaging_service: Add wrapper for MUTATION_DONE verb 2015-07-16 17:23:26 +08:00
Asias He
196c7d6f2b messaging_service: Add wrapper for MUTATION verb 2015-07-16 17:23:22 +08:00
Asias He
292ddd68c2 streaming: Delay adding wrappers for some stream verbs
It might be changed or be dropped since the upcoming change of streaming
code. It is not used at the moment.
2015-07-16 17:22:53 +08:00
Asias He
857fa5ccbb messaging_service: Add wrapper for STREAM_MUTATION verb 2015-07-16 17:19:51 +08:00
Asias He
1f6a76f2a0 messaging_service: Add wrapper for PREPARE_MESSAGE verb 2015-07-16 17:19:51 +08:00
Asias He
49b80535d9 messaging_service: Add wrapper for DEFINITIONS_UPDATE verb 2015-07-16 17:19:51 +08:00
Asias He
3e9d88e67c migration_manager: Do not use make_lw_shared in push_schema_mutation
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.
2015-07-16 17:19:51 +08:00
Asias He
47503d0eaf messaging_service: Add wrapper for verbs used by gossip
Tested with tests/urchin/gossip.cc.
2015-07-16 17:19:51 +08:00
Asias He
ec0c1187ff messaging_service: Add out of line destructor 2015-07-16 17:19:50 +08:00
Raphael S. Carvalho
719898d0e5 introduce automatic compaction
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>
2015-07-16 12:00:12 +03:00
Avi Kivity
6257ef1d83 Merge "Add mutation::live_row_count()" from Tomasz 2015-07-16 10:32:11 +03:00