Commit Graph

5246 Commits

Author SHA1 Message Date
Asias He
d799d1aa8f gossip: Implement the missing sleep logic 2015-07-29 11:13:35 +08:00
Asias He
1a6f7cf2aa gossip: Fix assassinate
- Use seastar::async to simplify the sleep logic.
- Futurize assassinate so that future is ready when assassination finishes.
2015-07-29 10:57:23 +08:00
Asias He
acd6e6268f gossip: Fix storage_service_value_factory
We have value_factory in storage_service now. Use it.
2015-07-29 10:06:43 +08:00
Asias He
33d3fcf7db gossip: Add set_last_processed_message_at() helper
Set time_point to now by default.
2015-07-29 09:54:29 +08:00
Asias He
65232edfe8 gossip: Move swagger API to source file 2015-07-29 09:49:28 +08:00
Avi Kivity
f6e17ecab2 Merge seastar upstream
* seastar ce6c5c8...98c6bba (2):
  > dpdk: Linearize too fragmented xmit packet for i40e NICs
  > dpdk: get rid of backward compatibility code
2015-07-28 22:20:35 +03:00
Raphael S. Carvalho
c9fdc7dc5d compaction: get rid of invalid FIXME comment
Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-07-28 19:22:26 +03:00
Avi Kivity
71579001ee Merge seastar upstream
* seastar 495822f...ce6c5c8 (2):
  > memory: count small_pool spans in use
  > build: disable dpdk kernel-mode drivers
2015-07-28 18:35:24 +03:00
Avi Kivity
b78621c5c6 Merge seastar upstream
* seastar 581f262...495822f (1):
  > core: fix close-after-free in recursive mkdir

Fixes #51
2015-07-28 17:12:11 +03:00
Pekka Enberg
804f5d98f1 version.hh: Pretend to be Cassandra 2.1.8
We are targeting the 2.1.x series so advertise that we're Cassandra
2.1.8 which is the latest stable release.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-07-28 16:58:46 +03:00
Asias He
079ea13e67 main: Add init_storage_service helper
Simplifies deinit call.
2015-07-28 15:21:08 +03:00
Avi Kivity
1df8b0471b Merge 2015-07-28 14:59:51 +03:00
Asias He
0ce3d89a85 gossip: Switch to use chrono for time operation
This is a long-awaited cleanup. Gossiper code runs every second, it is
not performance sensitive, so it does not make much sense to stick to
lowres db_clock, use high_resolution_clock instead.
2015-07-28 14:59:44 +03:00
Avi Kivity
fa13050f64 tests: deinit storage_service in cql_tests_env 2015-07-28 14:57:57 +03:00
Avi Kivity
f9d1c6b79d Merge "Improve CQL transport error handling" from Pekka
"This series converts some user-triggerable CQL transport layer
assertions to exceptions that are converted to proper CQL error
messages."
2015-07-28 14:29:13 +03:00
Pekka Enberg
1ae8522e9e transport/server: Fix unknown consistency level error handling
If we receive an unknown consistency level, fail with PROTOCOL_ERROR. If
we're trying to send out an unknown consistency level, fail with
SERVER_ERROR.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-07-28 14:02:40 +03:00
Pekka Enberg
c15de0257d transport/server: Fail with PROTOCOL_ERROR on unknown frame version
If we don't recognize a frame version, throw a protocol_exception like
Origin does rather than killing the process.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-07-28 13:59:11 +03:00
Pekka Enberg
d22adbf878 transport/server: Fail gracefully on unknown change and target type
If the switch statements don't match to change or target type
enumerations, throw a invalid_argument exception that's translated to
proper SERVER_ERROR. The error is not triggerable in practice as
change_type and target_type are enumerations. However, the compiler is
unhappy if we don't have them so lets just clean them up.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-07-28 13:55:26 +03:00
Pekka Enberg
e2692a9d08 transport/server: Fail gracefully if client asks for frame compression
Throw a runtime_exception which is translated to proper SERVER_ERROR
message rather than killing the process with assert().

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-07-28 13:46:57 +03:00
Pekka Enberg
d0826bc10d transport/server: Fix unknown opcode error handling
If we encounter an unknown opcode, throw a protocol exception rather
than killing the process with assert().

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-07-28 13:44:37 +03:00
Pekka Enberg
980dc910d9 exceptions: Move protocol_exception to exceptions.hh
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-07-28 13:44:20 +03:00
Avi Kivity
057cc804dc Merge "Clean up service startup code" from Asias
"With the seastar patch below, if we have this code

  engine().at_exit([] { return f1() });
  engine().at_exit([] { return f2() });

We can make sure f2 is called before f1, like

   f2.then([] {
       reutrn f1();
   })

We can use this feature to simplfy deinit code a lot. If we have the correct
init order, the deinit order will be correct if we always call
engine().at_exit() when we do init."
2015-07-28 13:24:21 +03:00
Asias He
e6438a701f main: Print ip address info for CQL and Thrift server
CQL server listening on 127.0.0.3:9042 ...
Thrift server listening on 127.0.0.3:9160 ...
Seastar HTTP server listening on 127.0.0.3:10000 ...
2015-07-28 18:20:45 +08:00
Asias He
15001ef1de main: Introduce api-address option
It is default to rpc-address.
2015-07-28 18:20:45 +08:00
Asias He
4839d385dc main: Cleanup snitch storage_service and db init 2015-07-28 18:20:45 +08:00
Asias He
a2b54fc757 main: Introduce init.cc to cleanup service startup code
This patch introduce init.cc file which hosts all the initialization
code. The benefits are 1) we can share initialization code with tests
code. 2) all the service startup dependency / order code is in one
single place instead of everywhere.
2015-07-28 18:20:45 +08:00
Asias He
9990191666 main: Make do_help_loggers and apply_logger_settings static
They are local functions.
2015-07-28 18:17:24 +08:00
Avi Kivity
53c170a468 Merge seastar upstream
581f262a2024cb9afb3ba6fee53080787fe10cb9 Revert "Merge "Adding NAT Adapter" from Takuya"
8d333aea8721ad110bced638824a155ad9ae052e reactor: Run at_exit functions in LIFO order
0eb3175ed8cfcfc3f6932c5ce32af6b87c9be6bd httpd: Allow specifying ip address to listen on
b0c8b806ce2791298dc637b062ff69681df90cdf Merge "Adding NAT Adapter" from Takuya
423e593dbc9cab87f06f32b4486d61113ce10a05 tests: Add packet class test
b648d924bfe0bf516ca09a47c8d9802147f50905 Add scripts & config files for install / startup SeaStar instance
4be17878e204fbc397b71080a83d7588008657ae Hook network stack for NAT adapter
a1c817c00bce81faded663a2415f1dc40dc88928 Add NAT adapter
cd0703c538c5d5c484748dc1ad8951bc7e62db45 native-stack: add create_device() function to share create_native_net_device() code with nat-adapter
afe4e197c35acf00435e897d65994dbe665b1639 packet: implement untrim_front() and untrim_back()
c74ce091aa1bc5ea9e65eb83f92919bd9084742c ip: Add an argument to modify local port range
6f5101f8cd3b35040bb4e26b9d02ae075a774e2a ip: Add ipv4_address::to_string()
01337bd09020223be9bb9c63428ce89e24f1c98b future: remove incorrect noexcept specifications from schedule()
fa8d7401d66adb13e9f4892b674fff6c32fbf52e future: catch exceptions thrown while scheduling a continuation
2015-07-28 13:05:44 +03:00
Pekka Enberg
c30afdc3c7 transport/server: Fix error encoding some more
All error messages encode a error message as well. It sometimes pays off
to read the fine print in specs:

"4.2.1. ERROR

   Indicates an error processing a request. The body of the message will be an
   error code ([int]) followed by a [string] error message. Then, depending on
   the exception, more content may follow. The error codes are defined in
   Section 9, along with their additional content if any."

Fixes #32.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-07-28 13:00:19 +03:00
Avi Kivity
34131b22dd Merge "Debuggability improvements" from Tomasz 2015-07-28 12:47:33 +03:00
Tomasz Grabiec
81eb51b8f8 scylla-gdb.py: Fixes for GDB with python3
Fixes complaints about inability to convert gdb.Value to int.
2015-07-28 11:31:08 +02:00
Tomasz Grabiec
c2664c0d46 storage_proxy: Add query logging on log_level::trace 2015-07-28 11:31:08 +02:00
Tomasz Grabiec
d9e6f0d1da query: Introduce query::result::pretty_print() 2015-07-28 11:31:08 +02:00
Tomasz Grabiec
eec76b1f2c log: Introduce logger::is_enabled(log_level) 2015-07-28 11:31:08 +02:00
Tomasz Grabiec
86735f93fa log: Prepend shard number and logger name 2015-07-28 11:31:08 +02:00
Nadav Har'El
d074dfe322 build: no need any more to try both ninja and ninja-build
We have the "ninja" variable. Use it.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-07-28 12:30:49 +03:00
Pekka Enberg
dcbf8d5a9c transport/server: Fix UNPREPARED error encoding
Fix UNPREPARED error encoding to follow the CQL transport protocol spec.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-07-28 10:36:53 +02:00
Nadav Har'El
280c450892 Fix compilation
The at_exit() callback needs to return a future. In one place we forgot,
and now that at_exit() takes an std::function<>, this is verified at
compilation time and fails compilation.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-07-28 10:28:08 +02:00
Glauber Costa
3bb16fba7e create table: fix creation of compact storage tables
The statement being removed in this patch is wrong, and nonexistent in Origin.
If the list of column aliases is empty, we should leave it this way.

This code was already present before the compact storage series. But because
tables created using the schema_builder directly won't exercise this code path,
I ended up not noticing - specially because it only happens with tables that
lack a clustering key. The ones I tested through cqlsh, all had a clustering
key.

Fixes #45

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-28 10:05:05 +02:00
Tomasz Grabiec
ae98a3aae7 Merge branch 'penberg/consistency-level-cleanups/v1' from seastar-dev.git
From Pekka:

This series cleans up consistency_level.hh dependency issues that allow
us to use 'enum consistency_level' cleanly in CQL transport layer
exceptions in exceptions.hh. No functional changes.
2015-07-28 09:56:22 +02:00
Avi Kivity
b3b0d5150a main: fix system tables vs. sstables initialization race
We must wait for the system tables to be loaded on all shards before
populating the other keyspaces, or we might miss some keyspaces or column
families.  This is hinted at by the fact that we use storage_proxy, which
isn't usable until the system keyspace is ready.

Credit to Tomek for identifying the problem and the fix.
2015-07-28 09:49:11 +02:00
Avi Kivity
0f4f5f5bfc transport: collect and expose statistics to collectd 2015-07-28 09:48:27 +02:00
Avi Kivity
e577ed8459 row_cache: wire up collectd statistics 2015-07-28 09:48:27 +02:00
Avi Kivity
225cbf0ed3 cache: be a little more optimistic about caching newly evicted (from memtable) rows 2015-07-28 09:48:27 +02:00
Pekka Enberg
1c039f9855 exceptions/exceptions.hh: Use 'pragma once' as include guard
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-07-28 10:06:18 +03:00
Pekka Enberg
3803e0ed5b exceptions: Move request_timeout_exception to exceptions.hh
Now that consistency level dependency issues are sorted out, move
request_timeout_exception to exceptions.hh.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-07-28 10:06:18 +03:00
Pekka Enberg
0b8c67ed79 exceptions: Move unavailable_exception to exceptions.hh
Move unavailable_exception to exceptions.hh where other CQL transport
level exceptions are defined in.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-07-28 10:06:18 +03:00
Pekka Enberg
055e25ed43 db/consistency_level: Move enum to separate header
Move 'consistency_level' enumeration to a separate header file to fix
dependency issues that arise when we move 'unavailable_exception' to
exceptions.hh.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-07-28 10:06:18 +03:00
Pekka Enberg
7fc1311d4a db/consistency_level: Move implementation to .cc file
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-07-28 10:06:18 +03:00
Pekka Enberg
32378708d0 db/consistency_level: Remove ifdef'd code
Cleanup consistency_level.hh by removing untranslated code that's been
sitting in the tree for a while.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-07-28 09:36:36 +03:00