Commit Graph

3532 Commits

Author SHA1 Message Date
Asias He
03b526f06b storage_service: Implement get_tokens_for 2015-06-01 11:24:38 +08:00
Asias He
322b27c12b storage_service: Implement set_tokens 2015-06-01 11:24:38 +08:00
Asias He
d28503374d storage_service: Add debug print helper 2015-06-01 11:24:38 +08:00
Asias He
8d7aff89e3 storage_service: Reduce default num_tokens to 3
The default value 256 in Origin is too big for debug. We can set it back
when storage_service is maturer.
2015-06-01 11:24:38 +08:00
Asias He
1e289018ea gossip: Implement versioned_value for tokens
Tokens are store in versioned_value hex string split by semicolon, e.g.:

9f6fd6dd5149e39c;59068b2415190651;63684ccb1b73c1e3
2015-06-01 11:24:38 +08:00
Asias He
d026ca6852 token: Add constructor token(kind, bytes) 2015-06-01 11:24:38 +08:00
Asias He
487768732f storage_service: Rename bootstrapTokens to _bootstrap_tokens 2015-06-01 11:24:38 +08:00
Asias He
e6f5618d97 storage_service: Rename tokenMetadata to _token_metadata 2015-06-01 11:24:37 +08:00
Amnon Heiman
bdb2a7ff47 api: Remove empty parameter from storage_service.json
Empty parameter definition is not accepted by the swagger UI, instead,
the parameter list itself should be empty.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-05-31 18:17:29 +03:00
Avi Kivity
ff8769fdf7 Merge "Extend storage_service API support"
From Amnon:

"This seriese adds functionality to the storage_service API. It focus on tokens
information, that are partially supported in the storage_service and the call
to the API will return an empty list."
2015-05-31 17:57:30 +03:00
Gleb Natapov
699a47342d message: drop tuple<int, long> serializer
It is used only in test and even there it is not needed.
2015-05-31 17:53:51 +03:00
Vlad Zolotarov
81c9b327c6 compress: Use file::dma_read_exactly() instead of a local version of it.
Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2015-05-31 11:21:56 +03:00
Nadav Har'El
33270efc39 sstables: make consume_row_end() a future
After commit 3ae81e68a0, we already support
in input_stream::consume() the possibility of the consumer blocking by
returning a future. But the code for sstable consumption had now way to
use this capability. This patch adds a future<> return code for
consume_row_end(), allowing the consumer to pause after reading each
sstable row (but not, currently, after each cell in the row).

We also need to use this capability in read_range_rows(), which wrongly
ignored the future<> returned by the "walker" function - now this future<>
is returned to the sstable reader, and causes it to pause reading until
the future is fulfilled.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-05-28 18:53:32 +03:00
Glauber Costa
c02e3fc16a tests:: fix sstable test files removal for good
The current scheme of creating temporary files inside the current directory is
very fragile.

First, whenever we start writing new files, the test breaks if we forget to
include it in the list of removed files (likely).

Second, because we have to manually delete the files after we're done with
them, we can either forget, or if the test crashes, the final condition may not
run.

Instead of doing that, let's move the files to a separate directory. That makes
it a lot easier to make sure we're deleting all the relevant files, because we
can just wipe out the whole directory.

All tests are then wrapped in a function that makes sure that the proper setup
is in place.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-05-28 18:03:37 +03:00
Avi Kivity
7e4d8c3796 Merge seastar upstream 2015-05-28 18:01:10 +03:00
Glauber Costa
b77605cdba reactor: call remove instead of unlink
remove() is a convenient glibc wrapper that will unlink() a file and rmdir() a
directory. It will allow us to operate on both without creating a separate
function for a directory.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-05-28 17:56:42 +03:00
Glauber Costa
a209a5c2cb bloom filter: go back to size for bitset
max_size, as currently used, will return -1 and while it will fix the previous
bug, it will uncover another.

We can go back to using size, as long as we make sure that all sites correctly
pick a size when creating the bitset. Aside from that, for compatibility with
the java code, the total number of bits has to be a power of two.

The best way to achieve those goals, is to just set the size ourselves through
resize() in the filter constructor. num_blocks() * bits_per_block is guaranteed
to yield a power of two as we need, and in case one caller did not explicitly
set a size, it will be set from this moment on.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-05-28 17:12:39 +03:00
Avi Kivity
9dd680493c Merge seastar upstream 2015-05-28 13:30:11 +03:00
Vlad Zolotarov
c547f9a718 fstream: prevent ANY exceptions to be thrown in good get() flow
There is a hidden exception that could be thrown insize file::dma_get_bulk()
if file size is not aligned with fstream::_buffer_size. In this case
file::dma_read_bulk() will be given a _buffer_size as a length for the last data
chunk in the file too. file::dma_read_bulk() will get a short read (till EOF)
and then will try to read beyond it (by calling file::read_maybe_eof())
in order to differentiate between I/O error and EOF. file::read_maybe_eof()
will throw a file::eof_error exception to indicate the EOF, it will be caught
by file::dma_read_bulk() and since we have read some "good" bytes by now this
exception won't be forwarded further. However the damage by throwing the exception
has already been done and we want to avoid this in fstream flow (unless there are
real errors).

In order to prevent the above we will always request file::dma_read_bulk() to
read the amount of data it should be able to deliver (not beyond EOF).

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2015-05-28 13:25:40 +03:00
Vlad Zolotarov
b70c9a2e18 file: read_maybe_eof(): Don't throw file::eof_error().
Make read_maybe_eof() return zero-sized buffer when pos is at or beyond
EOF. This will prevent an internal exception throwing inside "file" class
in cases when dma_read_bulk() is going to succeed and return read data, e.g. when
it was called with "offset" less than file size but "offset" + "range_size"
beyond EOF.

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2015-05-28 13:25:40 +03:00
Vlad Zolotarov
ae03cfbb5d file: clarify the class interface.
Move read_state helper class, file::dma_read_bulk() and file::read_maybe_eof()
definitions outside the class declaration in order to make reading the class
interface easier.

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2015-05-28 13:25:40 +03:00
Avi Kivity
9243187ac2 stream: make subscriptions a little more usable
Requiring next_fn to be available at listen() time means you can't pass
subscriptions around, and it is often hard to create next_fn, since it
usually needs to capture 'this', while this also points to the subscription
itself, creating a chicken and egg problem.

Fix by separating the registration process into two steps: listen() creates
the subscription, and start() accepts the next callback and starts processing
events.
2015-05-28 13:11:40 +03:00
Pekka Enberg
c2675980b9 database: Fix data_value comparison operator
Tomek says:

  "Some types may yield different byte-representations for equal
   values."

Fix that up.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-05-28 11:21:22 +02:00
Avi Kivity
40e8985f64 Merge "Make migration manager announce new column families"
From Pekka:

"This series wires up migration manager column family announcements in
preparation for eventually storing column family schema in system
tables."
2015-05-27 16:42:00 +03:00
Pekka Enberg
42cfcfb32d database: Remove compose() function
Convert code to use the deserialize() function and drop the duplicate
compose() wrapper that we inherited from Origin.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-05-27 16:22:35 +03:00
Pekka Enberg
27749769e8 migration_manager: Convert announce_new_column_family() to C++
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-05-27 16:22:13 +03:00
Pekka Enberg
257511d271 db/legacy_schema_tables: make_create_table_mutations()
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-05-27 16:22:13 +03:00
Pekka Enberg
a388b088c6 map_difference: Parametrize value comparison
If map value type is lw_shared_ptr<T>, for example, we need to be able
to pass our own value comparison function to the difference() function.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-05-27 16:22:13 +03:00
Takuya ASADA
c620bab8e5 VM image build script to running SeaStar on Linux guest
Creates Linux guest with SeaStar + DPDK in just 2 commands.

Signed-off-by: Takuya ASADA <syuu@cloudius-systems.com>
2015-05-27 15:39:30 +03:00
Amnon Heiman
dc4584254b API: Adding storage_service implementation
This adds implementation to the added storage service definitions.
After this patch, the following calls will be supported:
/storage_service/tokens
/storage_service/tokens/{endpoint}
/storage_service/commitlog
/storage_service/tokens_endpoint

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-05-27 15:29:49 +03:00
Amnon Heiman
041fd4c617 storage_service: expose the storage functionality
The storage service runs on CPU 0, this adds a wrapper function that
would expose the relevent storage_service function but will hide the
cpu this is actually be run on.

The implemented methods are the one needed by the API and are equivelent
to the ones defined in StorageServiceMBean

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-05-27 15:29:49 +03:00
Amnon Heiman
df7a06c8dc token_metadata expose the token and token mapping
This adds an API that expose the token to endpoint mapping and the token
that are associate with an address.

Both method will be used by the API to expose the tokens.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-05-27 15:29:49 +03:00
Amnon Heiman
a28b90bfd3 Adding definitions to the storage_service
This adds the following definitions to the storage_service swagger
definition file:
/storage_service/tokens
/storage_service/tokens/{endpoint}
/storage_service/commitlog
/storage_service/tokens_endpoint

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-05-27 15:28:20 +03:00
Amnon Heiman
f0e5d76d85 API: Add helper function to transfer collection to list of sstring
These adds a helper function to transfer a list of object to a list of
string. It will be used by the API implementation.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-05-27 15:28:20 +03:00
Amnon Heiman
bb4b15566c rpc: fix get_stats not returning the updated stats structure
get_stats needs to return the copy of the stats structure. Not the
original value.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-05-27 15:06:01 +03:00
Pekka Enberg
5ab968137f cql_test_env: Use CQL for keyspace creation
Use CQL for keyspace creation to make sure the keyspace definition also
exists in system tables.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-05-27 14:31:30 +03:00
Avi Kivity
ef11234d0c reactor: add counters for file reads, writes, fsyncs, and threaded fallbacks
Reviewed-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-05-27 14:16:58 +03: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
Avi Kivity
3ef36a952b Merge "Query result set comparison support"
Pekka says:

"This series adds comparison operators for query result sets that are
needed by schema merging code. The operators are implemented using a
newly added "data_value" type that encodes the type of the value."
2015-05-27 12:38:20 +03:00
Pekka Enberg
6ed0d8c0e4 query-result-set.hh: Add comparison operators
Schema merging code needs to be able to compare two result sets to
determine if a keyspace, for example, has changed. Add comparison
operators for that.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-05-27 11:49:12 +03:00
Pekka Enberg
446555f2de query-result-set.hh: Use data_value instead of boost::any
Switch to data_value in preparation for adding support for comparison
operators.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-05-27 11:49:12 +03:00
Pekka Enberg
ea0e1ff3b5 types.hh: Add data_value class
Add a data_value class that also encodes a value type. This makes it
easier to use than plain boost::any for comparing two values.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-05-27 11:49:12 +03:00
Avi Kivity
4f45633464 Merge "token bootstrap"
From Asias: "With this series, when a node bootstraps, it can get 256 tokens."
2015-05-27 10:56:38 +03:00
Asias He
64a9935206 storage_service: Implement join_token_ring 2015-05-27 15:05:12 +08:00
Asias He
ff099c44ce gossip: Convert more versioned_value 2015-05-27 15:03:29 +08:00
Avi Kivity
876af389be Merge "sstable bloom filter fixes"
Bloom filter fixes from Glauber.
2015-05-27 08:36:03 +03:00
Avi Kivity
0e29f9a3c5 Merge "sstable write bug fix"
Glauber says:

"Our stress tests found today a bug in sstable writing.
This fixes it, at least locally for me."
2015-05-27 08:34:55 +03:00
Raphael S. Carvalho
1d4c92b7fb sstables: fix scope problem when writing a vector
There is no guarantee that vector tmp will be alive by the time
it's written via output stream. Let's use do_with here.

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-05-27 08:34:22 +03:00
Asias He
de169ca9e7 storage_service: Call boot_strapper::get_random_tokens 2015-05-27 13:06:33 +08:00
Asias He
aa4a23a248 dht: Virtualize get_random_token
murmur3_partitioner::get_random_token is implemented.
2015-05-27 13:06:33 +08:00