Commit Graph

4907 Commits

Author SHA1 Message Date
Avi Kivity
b64094591f Merge seastar upstream 2015-07-20 17:59:40 +03:00
Shlomi Livne
026f6b7e2b Fix a race condition in node state for bootstrapped nodes
Booting a bootstrapped node had a race condition between setting and
advertising the state as boot strapped (call to
storage_service::bootstrap) and setting and advertising the
state as normal (call to storage_service::set_tokens) - as such a node
could get into a state in which it was "stuck" in bootstrap mode.

Following this patch you must wait for 5 seconds to have the cluster in
a stable state.

Signed-off-by: Shlomi Livne <shlomi@cloudius-systems.com>
2015-07-20 17:53:57 +03:00
Tzach Livyatan
736d209432 Rename README-urchin to README
Signed-off-by: Tzach Livyatan <tzach@cloudius-systems.com>
2015-07-20 17:32:49 +03:00
Avi Kivity
51e3f0a6df Merge "Size tiered compaction strategy" from Raphael 2015-07-20 17:29:13 +03:00
Avi Kivity
fee1f68b61 Add changes missing from previous commit 2015-07-20 17:28:45 +03:00
Avi Kivity
4a95f1589c Merge seastar upstream
Adjust make_file_*_stream() callers for updated seastar API.
2015-07-20 17:02:46 +03:00
Raphael S. Carvalho
a99c92f1b6 sstable compaction: add initial support to size-tiered strategy
Size-tired strategy basically consists of creating buckets with sstables
of nearly the same size.
Afterwards, it will find the most interesting bucket, which size must be
between min threshold and max threshold. Bucket with the smallest average
size is the most interesting one.

Bucket hotness is also considered when finding the most interesting bucket,
but we don't support this yet.
We are also missing some code that discards sstable based on its coldness,
i.e. hardly read.

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-07-20 10:08:14 -03:00
Raphael S. Carvalho
6ae3ffa319 database: add get_sstables to column_family
Returns all sstables added to a given column_family.

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-07-20 10:08:09 -03:00
Raphael S. Carvalho
ebbc7aa43e database: add compact_sstables to column_family
compact_all_sstables is about selecting all available sstables
for compaction and executing a compaction code on them.
This compaction code was moved to a more generic function called
compact_sstables, which will compact a list of given sstables.

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-07-20 10:08:02 -03:00
Raphael S. Carvalho
d627ede812 sstables: add bytes_on_disk
Returns the sum of the size of all sstable components.
It will be used by size-tiered strategy.

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-07-20 10:07:59 -03:00
Gleb Natapov
c58aea07c3 remove storage_proxy::query_local()
Use storage_proxy::query() instead.
2015-07-20 12:06:00 +02:00
Avi Kivity
6ade74b7c3 db: recover sstable generation counter on startup
Don't attempt to overwrite an existing sstable.
2015-07-20 12:00:34 +02:00
Avi Kivity
5339783d56 build: handle case where ninja command is named 'ninja-build' 2015-07-19 21:41:42 +03:00
Avi Kivity
6ccf8f8d86 build: make sure to ask seastar to build http/request_parser.hh, and depend on it 2015-07-19 21:37:14 +03:00
Avi Kivity
799b95aac0 tests: drop old seastar tests
Belong in seastar.
2015-07-19 20:57:38 +03:00
Avi Kivity
cc17c44640 Move seastar to a submodule
Instead of urchin being layered on top of seastar, move seastar to a
subdirectory (as a submodule) and use seastar.pc/libseastar.a to link
with it.
2015-07-19 20:48:36 +03:00
Avi Kivity
04b4047cac Merge seastar upstream 2015-07-19 16:28:13 +03:00
Avi Kivity
fa73a25146 memory: prevent cross-cpu free to dead cpu
When running with boost unit-tests, cpu threads can be destroyed, causing
static object destructors to fail when they try to free data which was
allocated on a cpu thread that no longer exists.

Leak the memory instead.
2015-07-19 16:24:07 +03:00
Avi Kivity
8712796e0f Merge seastar upstream
Add messaging_service thunk from new-style serialization (free functions)
to old-style serialization (serializer methods).
2015-07-19 14:18:35 +03:00
Avi Kivity
01e8cc8df2 rpc: switch user-defined serialization to free functions
By using free functions that take the serializer as a parameter (rather than
'this'), we can add serialization functions without changing the serializer
class.
2015-07-19 13:09:20 +03:00
Shlomi Livne
78b0554cce simple_strategy: coding convention fixes
Signed-off-by: Shlomi Livne <shlomi@cloudius-systems.com>
2015-07-19 12:45:25 +03:00
Gleb Natapov
605e5c04ab rpc: allocate header space together with payload 2015-07-18 21:15:38 +03:00
Avi Kivity
0d68b4614d Merge seastar upstream
Rewrote messaging_service serialization for new non-deferring rpc
serialization.
2015-07-18 20:21:20 +03:00
Avi Kivity
95970cfda0 Merge "rpc non-deferring serialization"
Switch rpc from using futurized serialization/deserialization to
in-memory, atomic serialization.  This is much faster, especially to
compile, and results in no loss of functionality, as it was illegal
for serialization to defer (except due to the connection being blocked),
because that would result in further rpc requests being stalled.
2015-07-18 19:16:49 +03:00
Avi Kivity
3942546d41 rpc: switch to non-deferring serialization
rpc currently allows serializers and deserializers to defer, because
the input and output stream may not be ready.  They may not, however,
defer on behalf of the object being serialized or deserialized (i.e.
you cannot serialize to disk or deserialize from disk) because that
causes the tcp connection to block until serialization/deserialization is
complete.  So in practice messages must be small enough to fit in memory,
and there is nothing gained by the complexity.

To simplify things, switch to non-deferring serialization.  Add a frame
header to messages that specifies the buffer size, which allows rpc to
use a read_exacly() to consume the message, and thereafter deserialize it
immediately.

The result is significantly simpler, which should help with compile time.
2015-07-18 19:08:07 +03:00
Avi Kivity
c1906a3d2a future: add futurize::make_exception_future()
Add a way to create an exceptional future of a type that is not directly
known.
2015-07-18 11:14:19 +03:00
Avi Kivity
f2577c8af3 function_traits: export the function signature as a type
This makes it easy to further examine using pattern matching instead
of std::index_sequence.
2015-07-18 11:14:19 +03:00
Avi Kivity
bf2395a727 Merge "Remove all set functions from the schema" from Glauber
"In the beginning, we needed to set fields in the schema, so we had set_
functions. Then the schema_builder came, and it acquired a lot of set_
functions.

Because its role is actually to build the schema, it is obvious that those
functions are much better placed if they are there. In this sense, having
them to stay in schema as well, is just duplication.

Some of the functions were already orphans in this sense. No callers left.
But some others had callers. This patchset fixes them so they build through
the builder. And once this is done, schema will now consistently have getters
only.

This will become more pressing once I introduce the compact storage changes -
which is the reason I am doing this now. For those, the process of computing
the right value is a bit complicated - definitely not just val = x, and we
definitely don't need the code living in two places. It would be much
better if the existing users - specially the system tables, would be already
fixed."
2015-07-18 10:49:39 +03:00
Glauber Costa
443178ef81 schema: remove set_default_time_to_live
Make calls go through the builder. Current caller is patched.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-17 20:40:40 -04:00
Glauber Costa
8b68fb5ff6 schema: remove set_gc_grace_period
Make all callers go through the builder. Current callers - there are many
in the system tables code, are patched.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-17 20:40:40 -04:00
Glauber Costa
4d6457ba18 schema: remove set_comment
There are no more callers left, all already happens through the builder.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-17 20:29:21 -04:00
Glauber Costa
2d1561d4d2 schema: remove set_id
Pass it through the builder. Existing caller is patched.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-17 20:29:21 -04:00
Glauber Costa
75ffcefd90 schema: remove set_compressor_params
use the builder instead. Sole current user is patched

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-17 20:29:21 -04:00
Glauber Costa
d3e539e868 schema: delete set_bloom_filter_fp_chance
We do this through the builder now, and there are no more callers to
this one.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-17 20:29:21 -04:00
Asias He
744fa25852 logger: Fix compile error
gcc version 5.1.1 20150618 (Red Hat 5.1.1-4) (GCC)

[1/6] CXX build/release/log.o
FAILED: g++ -MMD -MT build/release/log.o -MF build/release/log.o.d
-std=gnu++1y -g  -Wall -Werror -fvisibility=hidden -pthread -I.
-U_FORTIFY_SOURCE  -I/usr/include/jsoncpp/ -Wno-maybe-uninitialized
-DHAVE_XEN -DHAVE_HWLOC -DHAVE_NUMA -O2 -I build/release/gen -c -o
build/release/log.o log.cc
log.cc: In member function ‘void
logging::logger::really_do_log(logging::log_level, const char*,
logging::logger::stringer**, size_t)’:
log.cc:86:19: error: no match for ‘operator<<’ (operand types are
‘std::ostream {aka std::basic_ostream<char>}’ and ‘std::ostringstream
{aka std::basic_ostringstream<char>}’)
         std::cout << out;
                   ^
log.cc:86:19: note: candidate: operator<<(int, int) <built-in>
log.cc:86:19: note:   no known conversion for argument 2 from
‘std::ostringstream {aka std::basic_ostringstream<char>}’ to ‘int’
In file included from /usr/include/c++/5.1.1/iostream:39:0,
                 from core/sstring.hh:31,
                 from log.hh:8,
                 from log.cc:5:
2015-07-17 20:02:18 +02:00
Tomasz Grabiec
db331efaa1 tests: Add test for exception propagation from make_lw_shared() 2015-07-17 16:31:43 +03:00
Tomasz Grabiec
0bfcf27b15 core: lw_shared_ptr: Don't mark make() as noexcept
The constructor or operator new may throw, and we don't want to
std::terminate() on that occasion.
2015-07-17 16:31:42 +03:00
Shlomi Livne
c2ba0df3a9 calculate_natural_endpoints limit retuned ips by replication factor
calculate_natural_endpoints needs to limit the list of returned
addresses by the replication_factor current impl will return all nodes
in cluster

for reference origins code:

while (endpoints.size() < replicas && iter.hasNext())
{
    InetAddress ep = metadata.getEndpoint(iter.next());
    if (!endpoints.contains(ep))
        endpoints.add(ep);
    }
}

Signed-off-by: Shlomi Livne <shlomi@cloudius-systems.com>
2015-07-17 10:33:11 +02:00
Vlad Zolotarov
6017d7f6bc sequenced_set: add a non-const version of get_vector()
This is meant to allow std::moving the returned object when needed.
Otherwise std::move(s.get_vector()) will be degraded to copying.

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2015-07-17 10:24:57 +02:00
Glauber Costa
c71dace86c type_parser: reword exception message
The current message makes exactly at least no sense.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-17 10:23:11 +02:00
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