This exception handling code is clearly bogus. That's old code, and it is not
the proper way to propagate it.
Fix it to use then_wrapped. Also include the filename in the message, so we have
a better clue about what happened.
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
By doing this, it is possible to synchronously wait for the seal to complete by
waiting on this future. This is useful in situations where we want to
synchronously flush data to disk.
Existing callers will not be patched, and this keeps their current behavior,
alas, asynchronously initiating a write, is preserved.
TODO: A better interface would guarantee that all writes before this one are
also complete
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
Being able to just get() a future inside a thread is a very nice functionality,
but we should be more careful a to when we do it. In particular, we are doing this
in a function inside db::legacy_schema_tables, because that function is supposed to
be used - so far - only inside a threaded function.
That approach simplify things, but at a great reusability cost. That means that this
function can now only be reused inside thread code.
This patch turns the offender into a normal future function, and moves the get0() to
code that is directly under seastar::async.
As a rule of thumb, we should stay away from ever doing get / get0 in functions that
are not used directly by async code.
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
"This patchset adds validation of 'create table' and 'create keyspace'
statements and mostly contains simple Java to C++ translation.
There are still few things missing, especially more detailed validation of
arguments passed to certain strategies (e.g. replication strategy, compaction,
compression). Some of them can be relatively easy to add (replication strategy,
maybe compression) while some probably need to wait a bit (compaction)."
Column stats min_timestamp, max_timestamp and max_local_deletion_time
were being update incorrectly.
max_local_deletion_time should be std::numeric_limits<int>::max() by
default, and then keep track of max local deletion time, if any.
This bug prevented a sstable generated by us from being compacted by
c* because max_local_deletion_time was storing std::numeric_limits<int>
::min(), and thus the sstable would be considered fully expired.
Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
compaction metadata is composed of ancestors and cardinality.
ancestors data is generated via compaction process, so it will be
empty by the time being.
cardinality data is generated by hashing the keys, offering the
values to hyperloglog and retrieving a buffer with the data to be
stored.
Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
The first change was to add the function get_bytes, which will create
a temporary buffer with the format expected by compaction metadata's
cardinality. For creating the format, I had to import write_unsigned_
var_int from stream-lib.
write_unsigned_var_int is about using fewer bytes to encode smaller
integer values, but will use slighly more bytes to larger values.
The last change was to add the function offer_hashed, which receives
a 64-bit hashed value instead. Hash algorithm used by c* is murmur
hash - hash2_64.
Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
This order is required since 5e1348e741
(storage_service: Use get_local_snitch_ptr in gossip_snitch_info).
This fixes the breakage in the cql_query_test.
Reported-by: Asias He <asias@cloudius-systems.com>
Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
This reverts commit 52aa0a3f91.
After c9909dd183 this is no longer needed since reference to a
handler is not used in abstract_write_response_handler::wait() continuation.
Conflicts:
service/storage_proxy.cc
"This introduces a very simple cache which caches whole partitions.
There is a reclaimer registerred which clears all caches upon memory pressure.
This is a temporary measure until we implement log-structured allocator and
incremental eviction.
I can see that for small data sets this series imporoves cassandra-stress read
throughput from 2k to 50k tps on muninn/huginn."
row_cache class is meant to cache data for given table by wrapping
some underlying data source. It gives away a mutation_reader which
uses in-memory data if possible, or delegates to the underlying reader
and populates the cache on-the-fly.
Accesses to data in cache is tracked for eviction purposes by a
separate entity, the cache_tracker. There is one such tracker for the
whole shard.
Currently mutation clustering uses two timers, one expires when wait for
cl timeouts and is canceled when cl is achieved, another expires if some
endpoints do not answer for a long time (cl may be already achieved at
this point and first timer will be canceled). This is too complicated
especially since both timers can expire simultaneously. Simplify it by
having only one timer and checking in a callback whether cl was achieved.