Commit Graph

31 Commits

Author SHA1 Message Date
Shlomi Livne
39429e2481 Alignment
Signed-off-by: Shlomi Livne <shlomi@cloudius-systems.com>
2015-06-14 12:19:11 +03:00
Shlomi Livne
edfb4fc671 Add support for read seeds from configuration
Moved setting of configuration variables after the configuration file
has been read.

Updated the code parsing seeds to comply with configuration file format
- seeds: <ip1>,<ip2>,<ip3>

Signed-off-by: Shlomi Livne <shlomi@cloudius-systems.com>
2015-06-14 11:48:03 +03:00
Vlad Zolotarov
ab14716ce8 gossiper: "Start" gossiper on all CPUs and initialize its services only on CPU0
Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2015-06-09 15:33:38 +03:00
Asias He
c95364fe31 failure_detector: Start on all cpus
Code calls failure_detector::is_alive on all cpus, so we start
failure_detector on all cpus. However, the internal data of failure_detector
is modified on cpu zero and it is not replicated to non-zero cpus.
This is fine since the user of failure_detector (the gossiper) accesses
it on cpu0 only.
2015-06-04 17:25:20 +08:00
Asias He
f1ed0cdc7e storage_service: Start on all cpus and replicate _token_metadata
_token_metadata is needed by replication strategy code on all cpus.
Changes to _token_metadata are done on cpu 0. Replicate it to all cpus.

We may copy only if _token_metadata actually changes. As a starter, we
always copy in gossip modification callbacks.
2015-06-04 17:16:50 +08:00
Asias He
6673b510d0 main: Set a default seed ip address
If user does not specify one, set it to 127.0.0.1 as Origin does.
2015-05-27 13:06:00 +03:00
Asias He
e98ec068ca storage_service: Start gossiper inside prepare_to_join 2015-05-26 17:45:29 +08:00
Asias He
93f4ba820e storage_service: Make storage_service distributed 2015-05-26 17:45:29 +08:00
Gleb Natapov
be5676fc95 main: use rpc-address config option for cql and thrift
Currently if you run more than one instance on the same machine, they
all bind to the same local address and port (we enable an option that
makes this non error) and cql/thrift requests are distributed randomly
among them.
2015-05-21 15:17:41 +03:00
Amnon Heiman
b795acdf63 Adds the database to the API context
The API needs the database distribute object to get information from it.
This adds a database reference the API context so it would be
available in the API.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-05-19 13:27:57 +03:00
Asias He
fbb3d9d434 main: Init messaging_service before thrift and cql server
Init messaging_service before thrift and cql server, since
thrift/cql may not rely on gossip having all the data, but they may
query.
2015-05-14 15:38:05 +03:00
Asias He
64d9fca4ef main: Move messaging_service init code into a helper function 2015-05-14 11:10:29 +03:00
Asias He
1adacecb41 main: Fix indentation
Spotted when reading the code.
2015-05-14 10:37:27 +03:00
Asias He
bb87afcd1f main: Wire up gossip and friends
Integrate messaging_service and failure_detector and gossiper into urchin.

To start a 3 nodes cluster on a single host:

./seastar --listen-address 127.0.0.1 --seed-provider-parameters 127.0.0.1
./seastar --listen-address 127.0.0.2 --seed-provider-parameters 127.0.0.1
./seastar --listen-address 127.0.0.3 --seed-provider-parameters 127.0.0.1
2015-05-14 10:37:26 +03:00
Calle Wilund
2f4e7a00f6 Use db/config object in main, database etc
* Uses config object to augument/impl options parsing
* Database now holds config obj
* Commitlog can now be inited with global config obj.
2015-04-29 18:01:17 +02:00
Amnon Heiman
e5007f49ae Adding the API to urchin
This adds the API to urchin, all API related files will be placed under
the api directory.

The API server uses a context object to access global parameters,
typically the different servers themselves.

After this patch the api-doc will be available, though empty under:
http://localhost:10000/api-doc

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-04-13 18:57:14 +03:00
Tomasz Grabiec
e6bca5721c main: Stop distributed<query_processor> on exit
Fixes assertion failure on ^C
2015-03-20 13:00:53 +01:00
Pekka Enberg
d04c41d8a8 transport: CQL prepared statements
This patch adds initial support for PREPARE and EXECUTE requests which
are used by the CQL binary protocol for prepared statements. The use of
prepared statement gives a nice 2.5x single core performance boost for
Urchin:

  $ ./build/release/seastar --data data --smp 1

  $ ./tools/bin/cassandra-stress write -mode cql3 simplenative -rate threads=32

  Results:
  op rate                   : 31728
  partition rate            : 31728
  row rate                  : 31728
  latency mean              : 1.0
  latency median            : 0.9
  latency 95th percentile   : 1.8
  latency 99th percentile   : 1.8
  latency 99.9th percentile : 5.6
  latency max               : 181.7
  Total operation time      : 00:00:30
  END

  $ ./tools/bin/cassandra-stress write -mode cql3 simplenative prepared -rate threads=32

  Results:
  op rate                   : 75033
  partition rate            : 75033
  row rate                  : 75033
  latency mean              : 0.4
  latency median            : 0.4
  latency 95th percentile   : 0.7
  latency 99th percentile   : 0.8
  latency 99.9th percentile : 3.4
  latency max               : 205.0
  Total operation time      : 00:00:30
  END

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-03-19 15:54:46 +02:00
Nadav Har'El
dbf5f1ff82 Avoid crash on ctrl-C
When engine.exit() is used, e.g., on trapping SIGINT, the engine
exits before doing db.stop(), causing an assertion failure.

This patch adds an at_exit([&db] { return db.stop(); }). This means
that before the engine exits, it runs db.stop() and waits for the
future that it returns to be completed. This is exactly what we need.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-02-25 10:10:42 +01:00
Avi Kivity
70381a6da5 db: distribute database object
s/database/distributed<database>/ everywhere.

Use simple distribution rules: writes are broadcast, reads are local.
This causes tremendous data duplication, but will change soon.
2015-02-19 17:53:13 +02:00
Avi Kivity
6bf105511b transport: rename cql/ to transport/
cql/, where the binary protocol code resides, is too similar to cql3/, where
the grammar lives.  Rename it to transport/ to reduce confusion.  While the
name isn't perfect, it matches origin.
2015-02-09 18:23:09 +01:00
Pekka Enberg
15ae102296 Fix startup error reporting if data directory is missing
If data directory does not exist, Urchin starts up without printing
anything and hangs. Make sure the error is shown to user by terminating
the application.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
2015-02-03 15:42:31 +01:00
Pekka Enberg
2a7da21481 CQL binary protocol
This patch implement initial support for CQL binary protocol versions 1,
2, 3, and 4. The CQL server is able to handshake with cqlsh and
cassandra-stress from Cassandra 2.1 which uses the STARTUP and OPTIONS
messages. Queries or other functionality is not supported.

To try it out, start Urchin:

  $ build/release/seastar --smp 1 --datadir data
  CQL server listening on port 9042 ...
  Thrift server listening on port 9160 ...

Then try to login with cqlsh:

  $ ./bin/cqlsh 127.0.0.1

Urchin side will fail with:

  CQL_VERSION => 3.2.0
  warning: ignoring event registration
  warning: ignoring query SELECT peer, data_center, rack, tokens, rpc_address, schema_version FROM system.peers
  seastar: cql/server.cc:222: future<> cql_server::connection::process_query(uint16_t, temporary_buffer<char>&): Assertion `0' failed.
  Aborted (core dumped)

TODO:

  - Compression is not supported.

  - Authentication is not supported.

  - Supported options are defined to make cqlsh and cassandra-stress
    happy. We really need to decide which CQL versions and compression
    algorithms we want to support.

  - std::string is used everywhere because sstring does not work with
    std::map, std::multimap, and others.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
2015-02-02 19:28:31 +01:00
Avi Kivity
cf8161b532 Merge branch 'master' of github.com:cloudius-systems/seastar into db 2015-01-14 17:02:12 +02:00
Glauber Costa
7f96fc9509 db: read all keyspaces from directory structure
This patch includes a helper function that executes a function for each entry
in a directory. It is future based and can include in the future, future-based
code to asychronously read, for instance, an sstable.

At the moment, it only scan all keyspaces and make sure they appear in the
keyspaces hash.

Both the database and keyspace classes gain a populate<T> factory that returns a
populated database. At this point, the names found are just listed, but not really
stored anywhere.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-01-13 10:41:13 +02:00
Tomasz Grabiec
84d35f8850 Fix use-after-free on database object
Caused urchin to SIGSEGV.
2015-01-12 21:04:36 +02:00
Glauber Costa
974278203c db: add datadir to the database
This is the directory from which we will read the sstables.
Code to actually parse them will come later.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-01-06 14:54:47 +02:00
Avi Kivity
a49fd99327 thrift: create a database and pass it to the server
Not sharded yet.
2014-12-23 18:41:29 +02:00
Avi Kivity
094329a95e Move apps/seastar/* to top level 2014-12-22 16:15:37 +02:00
Avi Kivity
c77f77ee3f build: organize files into a directory structure 2014-08-31 21:29:13 +03:00
Avi Kivity
193ac5919d Initial commit 2014-08-10 08:56:33 +03:00