Commit Graph

4622 Commits

Author SHA1 Message Date
Pekka Enberg
842eb00a68 cql3: Import IndexName.java
Origin commit: ebc50d783505854f04f183297ad3009b9095b07e

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-07-10 10:33:28 +03:00
Pekka Enberg
2c02c9c436 cql3: Convert KeyspaceElementName to C++
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-07-10 10:31:56 +03:00
Pekka Enberg
34563ca8e4 cql3: Import KeyspaceElementName.java
Origin commit: ebc50d783505854f04f183297ad3009b9095b07e

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-07-10 10:12:15 +03:00
Avi Kivity
290804baec Merge "Functions to update the peer table" from Glauber 2015-07-09 19:33:10 +03:00
Avi Kivity
50236b69b3 Merge "Fix floating point comparison" from Paweł
"This change makes comparing floating point values behave exactly like
it does in case of Java compareTo() function, which is different than
the usual IEEE 754 behaviour."
2015-07-09 19:09:18 +03:00
Glauber Costa
afee9ab72a system_keyspaces: implement remove_endpoint
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-09 11:58:31 -04:00
Glauber Costa
e559959632 system_keyspace: implement update_peer_info
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-09 11:58:31 -04:00
Glauber Costa
38465dea70 system_keyspaces: implement load_dc_rack_info
To implement that, we will resort to a cache mechanism, instead of doing the
query all the time.  This is mainly because we want to avoid overfuturization
of the callers, that are usually just interested in passing simple strings
around.

We will be able to intercept all updates to it, and maintain consistency with our
internal cache. The updates are not done in this patchset.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-09 11:58:30 -04:00
Paweł Dziepak
92740919eb tests/type: add test for comparing floating point values
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-09 17:52:45 +02:00
Paweł Dziepak
cf07b4c09a types: make comparing floating point values follow Java behavior
In Java method compareTo() of Float and Double types doesn't strictly
follow IEEE 754. Firstly, NaN is equal NaN and is greater than any other
value. Secondly, positive zero is larger than negative zero.

Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-09 17:52:45 +02:00
Glauber Costa
d43933e642 gms: add addr method to inet_addr
Because the cql types deal with a raw inet address and not the gms container, we need
a method to fetch it

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-09 11:27:45 -04:00
Avi Kivity
28652c669f Merge "UTF8 validation in CQL binary protocol" from Paweł
"These patches add verification that strings passed using CQL binary protocol
are valid utf8. Exception hierarchy is also adjusted to make sure that
protocol exceptions are properly translated to an appropriate error code.

This makes DTEST cql_tests.py:TestCQL.invalid_string_literals_test pass."

Reviewed-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-07-09 17:44:09 +03:00
Glauber Costa
4ed027bf89 types: add data_type for inet_address
That was still missing

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-09 09:34:30 -04:00
Glauber Costa
6b8d823c82 gms: allow the construction of the object from a net address
That is what is going to be stored in the data_type(), so provide the conversion

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-09 09:34:22 -04:00
Tomasz Grabiec
06917666f9 Merge tag 'bootstrap-v3' from git@github.com:glommer/urchin.git
Among other things, saving of system keyspace schema, from Glauber.
2015-07-09 15:31:27 +03:00
Glauber Costa
bac0a8a680 legacy_schema_tables: convert save_system_keyspace_schema()
This function is called at bootstrap, to make sure the system tables exist in
the keyspace list. I honestly don't know why do we have to force a delete +
reconstruct. But let's keep consistency with Origin here.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-09 08:12:47 -04:00
Paweł Dziepak
4273c6d390 transport: verify that strings are valid utf8
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-09 13:41:35 +02:00
Paweł Dziepak
ac776d2618 exceptions: remove transport_exception
transport_exception is an interface implemented by both
cassandra_exception and protocol_exception. The logic implemented in
both these subclasses is identical.

This patch removes transport_exception and makes protocl_exception a
subclass of cassandra_exception.

Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-09 13:39:31 +02:00
Tomasz Grabiec
31b0c60640 Merge branch 'penberg/cql-drop-table' from seastar-dev.git
From Pekka:

"This series enables DROP TABLE statement in the front-end. Our
back-end is not really prepared to deal with it so throw "not
implemented" exception from migration manager."
2015-07-09 10:53:48 +02:00
Avi Kivity
8857f42c5f Merge "Wire up streaming and ssstable" from Asias 2015-07-09 11:37:22 +03:00
Tomasz Grabiec
724099abe9 query: result_set_builder: Use the set of columns which was queried for
This builder is the one used to build the convenient result_set (not
on fast path). The builder was assuming that the whole set of columns
was always queried, which resulted in buffer underflow exceptions
during parsing of the results if this was not the case. Let's also
handle queries which have narrower column sets.
2015-07-09 11:35:31 +03:00
Asias He
b7b0aa3318 streaming: Negotiate core to core connection.
In streaming code, we need core to core connection(the second connection
from B to A). That is when node A initiates a stream to node B, it is
possible that node A will transfer data to node B and vice verse, so we
need two connections. When node A creates a tcp connection (within the
messaging_service) to node B, we have a connection ip_a:core_a to
ip_b:core_b. When node B creates a connection to node B, we can not
guarantee it is ip_b:core_b to ip_a:core_a.

Current messaging_service does not support core to core connection yet,
although we use shard_id{ip, cpu_id} as the destination of the message.

We can solve the issue in upper layer. We can pass extra cpu_id as a
user msg.

Node A sends stream_init_message with my_cpu_id = current_cpu_id

Node B receives stream_init_message, it runs on whatever cpu this
connection goes to, then it sends response back with Node B's
current_cpu_id.

After this, each node knows which cpu_id to send to each other.

TODO: we need to handle the case when peer node reboots with different
number of cpus.
2015-07-09 15:52:28 +08:00
Asias He
853175fc61 streaming: Implement prepare_message handler
This is a bit different from Origin. We always send back a
prepare_message even if the initializer requested no data from the
follower, to unify the handling.
2015-07-09 15:52:28 +08:00
Asias He
abfcf7d825 streaming: Send prepare_message message 2015-07-09 15:52:28 +08:00
Asias He
7ae860a43a streaming: Enable init_receiving_side 2015-07-09 15:52:28 +08:00
Asias He
f1dc4f21d5 streaming: Send stream_init_message to remote 2015-07-09 15:52:28 +08:00
Asias He
3256a21556 streaming: Use frozen_mutation to send mutations
Each outgoing_file_message might contain multiple mutations. Send them
one mutation per RPC call (using frozen_mutation), instead of one big
outgoing_file_message per one RPC call.
2015-07-09 15:52:28 +08:00
Asias He
cdf50aa078 messaging_service: Add STREAM_MUTATION verb
It is used by streaming service to send frozen_mutation.
2015-07-09 15:52:28 +08:00
Asias He
1dd80bac65 streaming: Make get_local_db() and ms() public 2015-07-09 15:52:28 +08:00
Asias He
1aab3c7bb9 streaming: Drop serialization interface for {outgoing,incoming}_file_message
We will send mutations using the frozen_mutation verb
2015-07-09 15:52:28 +08:00
Asias He
4718211d4a streaming: Wire up stream_transfer_task::add_transfer_file
Wire up with outgoing_file_message
2015-07-09 15:52:27 +08:00
Asias He
ad3692f666 streaming: Implement stream_session::add_transfer_ranges
Given keyspace names, ranges and column_families names, figure out
mutation_readers to transfer.
2015-07-09 15:52:27 +08:00
Asias He
3d42a9f9ad streaming: Introduce stream_detail
It is used to hold mutations which we will send over network.
2015-07-09 15:52:27 +08:00
Asias He
4b676bfac5 streaming: Init streaming service in main
We need a reference to <distributed> db.
2015-07-09 15:52:27 +08:00
Asias He
c41872a64d messaging_service: Move serialization code frozen_mutation to source file 2015-07-09 15:52:27 +08:00
Asias He
a773c151a3 messaging_service: Move serialization code for sstring to source file 2015-07-09 15:52:27 +08:00
Asias He
ff5e80bd35 messaging_service: Move serialization code for messaging_verb to source file
It is *HUGE* pain to modify one line of the code in messaging_verb.hh and
wait like forever until urchin compiles.
2015-07-09 15:52:27 +08:00
Pekka Enberg
31248ee0cf cql3: Enable DROP TABLE statement grammar
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-07-09 09:36:39 +03:00
Pekka Enberg
b68f93191e cql3: Convert DropTableStatement to C++
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-07-09 09:36:39 +03:00
Pekka Enberg
a64eab772c migration_manager: Convert announceColumnFamilyDrop to C++ as stub
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-07-09 09:22:02 +03:00
Glauber Costa
4641e4166f db/query_context: expose next_timestamp from query_processor
Helper function only

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-09 00:12:08 -04:00
Glauber Costa
d1c8b4fb05 query_context: accessor for storage proxy
Will be useful later to invoke things like mutate_locally

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-09 00:12:08 -04:00
Glauber Costa
cb103449a5 db: move query_context to a header
Do this so we can use it from legacy_schema_tables as well

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-09 00:12:08 -04:00
Glauber Costa
cdeab4a3d3 cql3: provide a mechanism to get a timestamp higher than any
It is common for some operations, like system table updates, to try and guarantee
some particular ordering of operations.

The way Origin does it, is by simply incrementing one to the current timestamp.
Our calls, however, are being dispatched through our internal query processor, which
has a builtin client_state.

Our client_state has a mechanism to guarantee monotonicity, by adding 1 if needed
to operations that happen subsequentially. By using a clock that is not wired up
to this mechanism, we can't really guarantee that if other operations happened to
get in between.

If we expose this mechanism through the query_processor, we will be able to guarantee
that.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-09 00:12:08 -04:00
Glauber Costa
9a691503ff add default_validator to schema_builder
We eventually need to wire them all up. This one is needed for describe
keyspaces to work.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-09 00:12:08 -04:00
Glauber Costa
0cb43b42d0 query_options: use native_protocol instead of 3 for internal options as well.
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-09 00:12:08 -04:00
Pekka Enberg
69c56997e2 cql3: Enable DROP KEYSPACE statement grammar
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-07-08 18:40:30 +02:00
Pekka Enberg
816254ed45 cql3: Convert DropKeyspaceStatement to C++
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-07-08 18:40:30 +02:00
Pekka Enberg
386792e63f migration_manager: Convert announceKeyspaceDrop to C++ as stub
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-07-08 18:40:30 +02:00
Pekka Enberg
d3eb9f9b57 version.hh: Fix release version to be "2.2.0"
Fix release version to be compatible with origin to avoid confusing
clients.

Before:

  [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 SeastarDB v0.1 | CQL spec 3.2.0 | Native protocol v3]
  Use HELP for help.
  cqlsh>

After:

  [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>

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-07-08 19:21:14 +03:00