Commit Graph

4075 Commits

Author SHA1 Message Date
Avi Kivity
04a25474e4 tombstone: make its print operator nicer 2015-06-22 19:00:55 +03:00
Avi Kivity
78add789c3 Merge "Fix bug with old sstable" from Glauber
"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."
2015-06-22 18:23:16 +03:00
Glauber Costa
b008f8cf06 sstables: test table with wrong marker
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-06-22 11:13:42 -04:00
Glauber Costa
6336c02cab sstables: fix bug with old sstable
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>
2015-06-22 11:13:42 -04:00
Raphael S. Carvalho
118e4fc8be sstable: make do_write_components more pleasant to read
Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-06-22 16:27:47 +03:00
Tomasz Grabiec
b8db713b81 service: Increase write timeout to 2 seconds
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;
2015-06-22 15:45:51 +03:00
Avi Kivity
acb56b580f abstract_replication_strategy: work around missing _snitch in cql_query_test 2015-06-22 15:28:22 +03:00
Avi Kivity
ddc84f3459 Merge "Adding the stroage_proxy API" from Amnon
"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."
2015-06-22 14:54:17 +03:00
Avi Kivity
de26b3a75c Merge "Update system keyspace rs to local_strategy" from Shlomi
"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."
2015-06-22 14:27:57 +03:00
Shlomi Livne
b3e4094e11 Updating setting of system keyspace strategy to be local_strategy
Signed-off-by: Shlomi Livne <shlomi@cloudius-systems.com>
2015-06-22 14:18:42 +03:00
Shlomi Livne
36ab6c1a5a Changing order of database and storage_service initialization
Signed-off-by: Shlomi Livne <shlomi@cloudius-systems.com>
2015-06-22 14:18:42 +03:00
Shlomi Livne
0ce374a853 Add support for setting keyspace replication_strategy
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>
2015-06-22 13:19:55 +03:00
Shlomi Livne
afe0f7dc85 Add support for local_strategy
Signed-off-by: Shlomi Livne <shlomi@cloudius-systems.com>
2015-06-22 13:19:37 +03:00
Avi Kivity
9ea9626bdf Merge seastar upstream 2015-06-22 12:51:01 +03:00
Avi Kivity
b879fabf36 reactor: block SIGALRM while we're still not ready to handle it
If some code sets up a timer before we've set up the SIGALRM signal handler,
we die.  Block it in the meantime.
2015-06-22 12:48:50 +03:00
Avi Kivity
7859f5a421 Merge seastar upstream 2015-06-22 10:45:06 +03:00
Avi Kivity
6d09819d1d Merge "repeat" from Tomasz
"repeat() is a single-callback version of do_until(), which makes it easier to
stop the loop if the stop condition is calculated in the loop body."
2015-06-22 10:38:55 +03:00
Vlad Zolotarov
ea274a0eda locator: Fix a typo in a token_metadata constructor
Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2015-06-22 09:16:24 +02:00
Tomasz Grabiec
e5e7348f76 core: Reimplement keep_doing() using repeat() 2015-06-22 09:08:38 +02:00
Tomasz Grabiec
61992f84c5 core: Introduce repeat()
It's like do_until(), but the stop condition is calculated by the
callback instead of being supplied separately.
2015-06-22 09:08:38 +02:00
Nadav Har'El
00e9f9e06a sstables: don't use size_t for on-disk sizes
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>
2015-06-22 08:02:50 +03:00
Avi Kivity
bd3044a38d do_with: doc: mark cherry_pick_tuple as internal 2015-06-21 23:37:12 +03:00
Nadav Har'El
646c31e596 sstables: take generic mutation_reader instead of memtable
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>
2015-06-21 23:32:17 +03:00
Avi Kivity
5367a0fb8b doc: unhide static functions 2015-06-21 23:27:33 +03:00
Avi Kivity
6975be8e12 Merge seastar upstream 2015-06-21 21:16:48 +03:00
Avi Kivity
9679075b30 shared_mutex: reinstate FIFO ordering
Noticed by Nadav.
2015-06-21 20:54:53 +03:00
Avi Kivity
18fd73b065 gate: fix doc typo 2015-06-21 20:36:15 +03:00
Avi Kivity
a2ec5ebe87 doc: add gate class to fiber module 2015-06-21 20:35:54 +03:00
Avi Kivity
ac94c1d68e doc: add fiber module to main page 2015-06-21 20:33:34 +03:00
Avi Kivity
d9bfbe55c8 core: introduce shared_mutex class
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.
2015-06-21 20:28:43 +03:00
Avi Kivity
a99956db8e future-util: implement range-based map_reduce() variant 2015-06-21 20:21:24 +03:00
Avi Kivity
33a4f1b32b reactor: move destructor to .cc file
It's totally uninteresting to anyone else.
2015-06-21 18:02:28 +03:00
Avi Kivity
cebe81082b reactor: destroy system timer in destructor
Keeping the timer armed can cause a signal to be sent, which will not
be handled, terminating the program too early.
2015-06-21 17:59:18 +03:00
Nadav Har'El
d7099358a7 tests: Fix shared/lw_shared mixup in test
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>
2015-06-21 17:28:20 +03:00
Gleb Natapov
52aa0a3f91 db: hold onto write response handler until timeout handler is executed
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.
2015-06-21 13:09:43 +03:00
Avi Kivity
614da559d0 semaphore: provide broken() variant accepting an std::exception_ptr 2015-06-21 11:44:57 +03:00
Glauber Costa
f4a167670a database: seal active memtables when we close the database
Failing to do so can lead to data not being written to disk when
we terminate.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-06-21 09:39:31 +03:00
Glauber Costa
1f13d3e38f database: gate seal_active_memtable
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>
2015-06-21 09:39:29 +03:00
Avi Kivity
7faebf4524 Merge "Bloom filter tracker" from Glauber
"This is the code responsible for tracking bloom filter activity. Origin uses
atomics, we will just keep local counters and map-reduce (yay!)"
2015-06-21 08:15:54 +03:00
Raphael S. Carvalho
113d3b1001 sstables: update compression ratio stats
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>
2015-06-21 08:14:07 +03:00
Avi Kivity
42a0089e5d Merge "streaming updates" from Asias 2015-06-21 08:09:47 +03:00
Avi Kivity
971c116207 Merge seastar upstream 2015-06-21 08:08:42 +03:00
Avi Kivity
439b9c848a tests: fix fstream_test misuse of shared_ptr
'static shared_ptr' causes the shared_ptr to be destroyed on a cpu other
than the one it was constructed on, which is illegal.
2015-06-20 12:02:00 +03:00
Avi Kivity
535928c643 tests: fix fstream_test use-after-free 2015-06-20 11:43:14 +03:00
Avi Kivity
033d919eaa tests: add missing tests to test.py 2015-06-20 11:30:13 +03:00
Avi Kivity
1c8ee4e160 tests: convert foreign_ptr_test to SEASTAR_TEST_CASE
Makes it pass.
2015-06-20 11:29:53 +03:00
Avi Kivity
32ede23303 tests: remove obsolete test-reactor test 2015-06-20 11:17:28 +03:00
Nadav Har'El
9b884b3435 reactor: more information on ignored exceptional future
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>
2015-06-20 11:07:09 +03:00
Nadav Har'El
13a68fa62c pipe: fix syntax error in pipe reader
I'm not sure how my compiler didn't complain earlier...

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-06-20 11:07:06 +03:00
Avi Kivity
7a596dfa61 Merge seastar upstream 2015-06-19 21:53:39 +03:00