"We have found a bug when reading an old sstable. Some versions of Cassandra
will not use start_range as a marker, but rather 0.
We need to account for that possibility."
Some version of Origin will write 0 instead of -1 as the start of range marker
for a range tombstone. I've just came across one of such tables, that ended up
breaking our code. Let's be more flexible in what we accept. We don't really have
a choice.
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
Current timeout is 100ms. cassandra-stress is failing for me often
because of this, with "Mutation write timeout" message.
The comment says that the timeout value is based on
DatabaseDescriptor.getWriteRpcTimeout(), which in Origin is equal to 2
seconds by default, so bump it up.
Code pointers:
DatabaseDescriptor:L844
public static long getWriteRpcTimeout()
{
return conf.write_request_timeout_in_ms;
}
Config:L74
public volatile Long write_request_timeout_in_ms = 2000L;
"This series adds the storage_proxy API with a stab API implementation.
It covers the API defined in StorageProxyMBean, it does not contain the metrics
associate with the storage proxy that will be added in a different series."
"local_strategy is used for system keyspaces to allow query / update of
tables without the need to have snitch or token metadata avilable
without this patch updating of system tables (e.g. insert system.local ...)
fails."
To support initialization of system tables keyspace replication_strategy
without the need of having snitch creation.
Signed-off-by: Shlomi Livne <shlomi@cloudius-systems.com>
As Avi suggested, we should use size_t only for memory sizes, not disk
sizes, as some hypothetical 32-bit machine could have 32-bit size_t
but still support 64-bit file sizes.
So this patch changes a number of places we used size_t in sstables/
to use uint64_t instead. It doesn't change *all* uses of size_t: Where
the size_t refers to a size of an object in memory (or an object that
should fit into memory - like the summary file), I left size_t.
Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
The current sstable write interface only knows how to write a memtable.
For compaction, we also want it to be able to write the compaction's
output, which we can represent as a mutation_reader. So this patch
changes the sstable::write_components() method to accept a mutation_reader,
and whatever else is needed (a schema and the number of partitions in
the reader - or an estimate thereof).
Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
Similar to std::shared_mutex, allows shared and exclusive locking of a
resource (also known as a reader/writer lock). This implementation is
strictly FIFO.
In a couple of places in sstable_datafile_test.cc, we had
make_shared<memtable> instead of the usual make_lw_shared<memtable>.
It appears that since commit bc468f9a0e,
which made memtables inherit from enable_lw_shared_from_this (not the "lw"),
this no longer works correctly. I'm not sure I can really explain the
details of what's wrong, but with some refactoring I did on the sstable
writing code, it stopped working giving various strange crashes which appear
like the object protected by this shared_ptr got prematurely destructed.
Changing the test to use make_lw_shared() fixes the problems I was having.
Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
If last response comes after write timeout is triggered, but before
continuation, that suppose to handle it runs the handler can be removed
to earlier and be access from the continuation after deletion. Fix it by
making response handler to be shared pointer instead of unique and
holding to it in timeout continuation.
We need to do that in order to close the database cleanly, flushing all pending
data before we do.
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
If compression is used, we should provide both uncompressed and
compressed length to metadata collector, so as for the ratio to
be computed. Stats metadata stores compression ratio.
Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
When an exceptional future is ignored, we print a message, and for an
std::exception we print its what(). However, it would be useful to also
see the exception's type. We already had such exception type printing
code for engine_exit(), and this patch extracts that code into a separate
function, and also uses it to print the warning message when an exceptional
future is ignored.
For example, in one test before this patch I see:
WARNING: exceptional future ignored: _Map_base::at
After this patch,
WARNING: exceptional future ignored of type 'std::out_of_range': _Map_base::at
Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>