Commit Graph

473 Commits

Author SHA1 Message Date
Glauber Costa
0519dec0d7 sstable tests: remove filter file
It is not being remove, and is thus left as garbage in the sstable directory.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-05-25 20:47:16 -04:00
Glauber Costa
8b2f5979c9 sstable tests: replace last then statement with finally
Currently, a failed test is leaving files behind.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-05-25 20:47:16 -04:00
Pekka Enberg
f092f33848 cql_test_env: Create keyspace for all test cases
Make sure keyspace exists for all test cases, not just ones that call
the create_table() helper.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-05-25 19:31:51 +03:00
Avi Kivity
5b259ff9e3 Merge "sstable range reads"
Sstable range reads, from Glauber.
2015-05-25 10:53:00 +03:00
Pekka Enberg
4dc488afb2 database: Store metadata in 'struct keyspace'
Store a lw_shared_ptr<keyspace_metadata> in struct keyspace so callers
in migration manager, for example, can look it up.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-05-25 09:12:29 +02:00
Glauber Costa
fc735de91c tests: test range reader
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-05-21 16:31:07 -04:00
Glauber Costa
84cbe7c862 sstables: fix test position
This is my turn to make the same mistake as Nadav recently made: I have
written down the expected position from the test output itself, instead
of checking the file.

A position of 0x400c0000000000 is obviously ridiculous. The file itself is not
that big. My recent patch to fix the summary broke the test, and so we need to
fix it.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-05-21 18:28:55 +02:00
Raphael S. Carvalho
f6073bea21 tests: test that generated sstable components can be loaded
Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-05-20 15:20:05 -03:00
Raphael S. Carvalho
5051575ac4 sstables: add initial support to generation of TOC file
Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-05-20 15:19:18 -03:00
Raphael S. Carvalho
57060b5dfe sstables: add initial support to generation of summary file
Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-05-20 15:17:21 -03:00
Raphael S. Carvalho
9e71f6d35c sstables: add initial support to generation of index file
This patch is built on the previous one, where access to members of sstable
class was made possible.
Index file is being properly generated, but it's important mentioning that
promoted indexes aren't supported yet.

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-05-20 14:37:08 -03:00
Raphael S. Carvalho
b00bb80c18 sstables: improve approach to generation of sstables
The function write_datafile was renamed to write_components and made a member
of sstable class because write of components requires access to private
members. This change is an important step towards the generation of components
other than data file.
The respective testcases were adapted to the changes.

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-05-20 14:10:24 -03:00
Raphael S. Carvalho
ea6f8a0f5a tests: use sstable::filename
Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-05-20 13:44:14 -03:00
Avi Kivity
85f23f6894 tests: reindent test_multiple_memtables_multiple_partitions() 2015-05-19 23:48:17 +03:00
Tomasz Grabiec
137b3beb2f Merge tag 'avi/readpath-prep/v1' from seastar-dev.git
From Avi:

"This patchset prepares for adding sstables to the read path.  Because sstables
involve I/O, their APIs return futures, which means that APIs that may call
those sstable APIs also need to return futures.

This patchset uses the two-space indent + do_with + reference aliases trick
to make patches more readable.  Cleanup patches will follow once it is merged."
2015-05-19 20:39:36 +02:00
Avi Kivity
5e759aa2dd Merge "Keyspace creation cleanups"
Pekka says:

"Clean up keyspace creation functions by using keyspace_metadata. While
at it, simplify creation by moving replication strategy initialization
to database.cc. This paves the way for adding keyspace metadata lookup
functionality to database that's needed by migration manager."
2015-05-19 20:06:42 +03:00
Avi Kivity
3ae81e68a0 Merge seastar upstream
Updated sstables::data_consume_rows_context for input_stream::consume()
API change.
2015-05-19 19:57:09 +03:00
Nadav Har'El
c5f61666d3 input_stream::consume() overhaul
Our input_stream::consume() mechanism allows feeding data from an input
stream into a consumer, piece by piece, until the consumer doesn't want
any more. It currently assumed the input can block (when reading from disk),
but the consumption is assumed to be immediate. This patch adds support for
blocking in the consumption function: The consumer now returns a future
which it promises to fulfill after consuming the given buffer.

This patch goes further by somewhat simplifying (?) the interface of the
consumer. Instead of receiving a mysterious "done" lambda the consumer
is supposed to call when done (doesn't want any more input), the consumer
now returns a future<optional<temporary_buffer<char>>, which means:

1. The future is fulfilled when the consumer is done with this buffer
   and either wants more - or wants to stop.

2. If the consumer wants to stop, it returns the *remaining* part of the
   buffer it didn't want to process (this will be pushed back into the
   input stream).

3. If the consumer is not done, and wants to consume more, it returns an
   unset optional.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-05-19 19:33:18 +03:00
Pekka Enberg
56d6fdacfe database: Simplify replication strategy initialization
Initialize replication strategy when keyspace is being created now that
we have access to keyspace_metadata.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-05-19 15:27:47 +03:00
Pekka Enberg
cd35617855 database: Use keyspace_metadata for creation functions
Use the keyspace_metadata type for keyspace creation functions. This is
needed to be able to have a mapping from keyspace name to keyspace
metadata for various call-sites.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-05-19 15:27:47 +03:00
Avi Kivity
db04bba208 db: futurize the single partition query path
Prepare for disk reads.
2015-05-19 15:13:09 +03:00
Avi Kivity
05f7c6abd5 sstable: rename convert_row() to read_row()
More reader-friendly.
2015-05-19 15:01:29 +03:00
Pekka Enberg
8380df84b4 database: Rename ks_meta_data to keyspace_metadata
Follow the naming convention set by user_types_metadata and rename
ks_meta_data to keyspace_metadata.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-05-19 11:24:06 +03:00
Pekka Enberg
f1fc575401 Clean up ks_meta_data construction
Simplify ks_meta_data construction in few places by using the default
arguments.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-05-19 11:16:11 +03:00
Pekka Enberg
032af4d53b database: Move ks_meta_data definition to database.hh
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-05-19 11:03:28 +03:00
Avi Kivity
9b43fe252a Merge branch 'penberg/user-types-cleanup' of github.com:cloudius-systems/seastar-dev into db
Pekka says:

"There's a user_types_metadata type defined in database.hh. Use that and
remove the left-over ut_meta_data from initial CQL translations."

Conflicts:
	thrift/handler.cc
2015-05-18 16:07:19 +03:00
Pekka Enberg
9ee7e21438 Switch to user_types_metadata
There's a user_types_metadata type in database.hh. Use it and drop the
left-over ut_meta_data from Origin.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-05-18 15:54:44 +03:00
Avi Kivity
07d7f410f3 Merge branch 'memtable' into db
Conflicts:
	database.hh
	memtable changes moved to memtable.hh
2015-05-18 15:50:24 +03:00
Avi Kivity
1cf95e4bd8 Merge branch 'thread' of github.com:cloudius-systems/seastar-dev
This patchset adds thread support to seastar.  Threads can use the normal
seastar API, and may also "block" by calling future<>::get() on an
unavailable future.  Synchronous and asynchronous code may be intermixed.

Threads may not issue blocking operating system calls.
2015-05-18 15:27:22 +03:00
Avi Kivity
ca49d73f97 db: allow configuring a column family to be memory-only
Useful for tests.
2015-05-18 15:00:33 +03:00
Avi Kivity
dda5cbfd0d db: make column_family and keyspace configurable
Currently used for the data directory.
2015-05-18 15:00:31 +03:00
Avi Kivity
6223e88653 tests: add thread context switch timing test 2015-05-17 15:57:11 +03:00
Avi Kivity
7a309c07f5 tests: add basic thread test 2015-05-17 15:57:11 +03:00
Avi Kivity
99f0bc784e tests: remove old sstables before creating new in sstable_test 2015-05-17 12:54:53 +03:00
Avi Kivity
a4880ac0c5 tests: convert mutation_test to use SEASTAR_TEST_CASE()
Following changes introduce a dependency on engine().cpu_id(), which requires
SEASTAR_TEST_CASE().
2015-05-17 10:31:22 +03:00
Avi Kivity
ad54edb047 tests: use memtable instead of column_family where appropriate
Requires less configuration.
2015-05-17 10:31:22 +03:00
Glauber Costa
81e4c28898 sstable: fix signed conversion build problems
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>
2015-05-14 17:37:37 +03:00
Shlomi Livne
7c879ea842 Add a test to start/stop messaging_service,gossiper,failure-detector
Signed-off-by: Shlomi Livne <shlomi@cloudius-systems.com>
2015-05-14 17:01:26 +08:00
Nadav Har'El
902d5b21ca sleep: Fix use-after-free in sleep()
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>
2015-05-14 11:26:58 +03:00
Glauber Costa
8de096ba81 sstable: add tests for mutation transformation
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-05-13 18:28:37 -04:00
Glauber Costa
2fba948ad8 sstables: move timestamps to signed integer
This is to follow Origin

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-05-13 17:14:02 -04:00
Glauber Costa
590abb800e sstables: pass a key_view instead of bytes_view to consume_row_start
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-05-13 17:14:02 -04:00
Gleb Natapov
8d9fb8a96c message: consolidate send_message() and send_message_oneway()
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>
2015-05-13 13:41:24 +03:00
Avi Kivity
8c09dbdbe8 Merge branch 'tgrabiec/cleanups' of github.com:cloudius-systems/seastar-dev into db
Database core cleanups, from Tomasz.
2015-05-13 11:08:21 +03:00
Avi Kivity
097aeb261e Merge branch 'master' of github.com:cloudius-systems/seastar into db 2015-05-13 10:57:53 +03:00
Tomasz Grabiec
f656ae8ed4 db: Encapsulate deletable_row fields 2015-05-13 08:56:54 +02:00
Tomasz Grabiec
dbc40dfb09 db: Encapsulate the "row" class
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.
2015-05-13 08:56:54 +02:00
Tomasz Grabiec
56bea440a7 mutation_partition: Pass schema by const& where applicable
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.
2015-05-13 08:56:54 +02:00
Avi Kivity
f3c8994535 distributed: add map_reduce() variant accepting an initial value
Separating the initial value (and accumulator) from the reducer function
can result in simpler invocations.

Unfortunately, the name conflicts with another variant, so we have to name
the method map_reduce0.
2015-05-12 16:57:50 +03:00
Avi Kivity
b300a05468 Merge branch 'master' of github.com:cloudius-systems/urchin into db 2015-05-12 15:07:16 +03:00