Unfortunately, for some unknown reason, my compiler is not locally warning me
of signe comparison mismatches, but our builder's is.
We have a currently build failure that is hopefully fixed by this patch.
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
The implementation of sleep() looks like a game of Seastar golf - doing
something in the minimum number of lines possible :-) Unfortunately, it
looks very clever, but not quite right. sleep() usually works correctly,
but the sanitizer (in the debug build) catches a use after free.
The problem was that we delete an object which contains a timer which
contains the callback (and std::function) - from inside this callback.
The workaround in this patch is to use our future chaining to only delete
the sleeper object after its future became ready - and at that point, none
of the sleeper object or code is needed any more.
This patch also includes a regression test for this issue. The test looks
silly (just sleeps and checks nothing), but in the debugging build it
failed (with a sanitizer reporting use-after-free) before this patch.
Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
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
In db:config, "localhost" is used as the default IP address for
listen_address, rpc_address. We do not have a name resolver at the
moment.
Add a minimal resolver for localhost for now.
The msg parameter is missing.
Fix a bug where Node B does not not recognize Node A.
Node A
$ ./gossip --seed 127.0.0.1 --listen-address 127.0.0.1
Node B
$ ./gossip --seed 127.0.0.1 --listen-address 127.0.0.2
The issue is that in gossiper::mark_alive(), the parameter for ECHO
message is wrong and after commit 1a8c4b75f5 (message: do not erase client's
rpc call type), we deduce the rpc handler using the parameters supplied
to messaging_service::send_message(), so we will use a wrong handler for
the ECHO message and the message will never reply thus we never mark the
peer node alive.
empty_msg was used as a placeholder when messaging_service does not handle void
return type correctly. Since we support it now, drop it.
* Allow boost::config to translate string_maps via iostream
* Special case seed_provider (struct) into two parameters (for lack of a
good way to express it on command line)
Signed-off-by: Calle Wilund <calle@cloudius-systems.com>
We do our best to avoid serializing every cell we see. We will accumulate them
all in an internal data structure, and then finally serialize it to our internal
format all at the same time.
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
We currently have code (which is wrong, btw), to throw an exception
when we find a collection. Replace that code with something that aside
from working, has the added benefit of actually capturing the collection
information correctly. This is the first step into implementing conversion
for collections.
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
They don't depend on internal state (or can be made not to). We want to reuse
those fields later for detecting static columns in tombstones.
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
Composites have an extra byte at the end of each element. The middle bytes
are expected to be zero, but the last one may not always be. In cases like
those of a range tombstone, we will have a marker with special significance.
Since we are exploding the composite into its components, we don't actually
need to retrieve it. We merely need to make sure that the marker is the one
we expect.
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
As Nadav and Tomek both pointed out, the \0\0\0 is just a special case of a row
marker for a schema with no clustering keys. There is no need for us to handle
that separately.
And in fact, short-cutting it means that we will have to take care to update
the row timestamp in two places - which we weren't doing.
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
As suggested by Avi, we can return an actual mutation by moving it out of our
consumer. We will encapsulate it within an optional, to handle the cases where
the mutation cannot be found.
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
send_message() and send_message_oneway() are almost identical, implement
the later in terms of the former. The patch also fixes send_message() to
work properly with MsgIn = void.
Reviewed-by: Asias He <asias@cloudius-systems.com>
Reduces coupling. User's should not rely on the fact that it's an
std::map<>. It also allows us to extend row's interface with
domain-specific methods, which are a lot easier to discover than free
functions.
If method doesn't want to share schema ownership it doesn't have to
take it by shared pointer. The benefit is that it's slightly cheaper
and those methods may now be called from places which don't own
schema.
make_empty() is used from thrift to create a clustering_key for a
table's row without clustering key columns. The implementation was
misleading because it seemed to be handling any number of components in
the key while only no-component case is supposed to work.