Commit Graph

738 Commits

Author SHA1 Message Date
Paweł Dziepak
498958878e tests/cql3: compare token() with bigints
The default partitioner is murmur3 for which correct token type is
bigint.

Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-14 16:51:20 +02:00
Paweł Dziepak
d9f20ebbd1 tests/cql3: add tests for compact storage tables
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-14 14:53:35 +02:00
Paweł Dziepak
36bd11bf96 tests/cql3: add tests for IN restrictions
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-13 11:36:16 +02:00
Paweł Dziepak
9966a2eac6 cql3: sort and remove duplicates in multi-column IN restrictions
Values inside IN clause should be sorted and duplicates removed if the
restricted columns are part of the clustering key, which is always true
for multi column restrictions.

Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-13 10:52:42 +02:00
Calle Wilund
562fa1a726 Disable allocation failure test in debug/sanitizer build
Since sanitizer does not fail gracefully on over-alloc
2015-08-12 20:00:44 +03:00
Avi Kivity
95847f86c3 Merge "locator: introduce i_endpoint_snitch::reset_snitch()" from Vlad
"This series introduces the i_endpoint_snitch::reset_snitch() static method
that allows to replace the current (global) snitch instance with the new one.
This is done in an (per-shard) atomic way transparent so anyone holding a reference
to snitch_ptr.

This series starts with some cleanups, adds the above method and the unit test
that verifies its functionality."
2015-08-12 19:29:08 +03:00
Avi Kivity
517ceed515 Merge "sstable index write benchmark"
"I am currently looking at the performance of our index_read, since it was in
the past pinpointed at the source of problems.

While the read side is the one that is mostly interesting, I would like to test
both - besides anything else, it is easier to test reads after writes so we
don't have to create synthetic data with outside tools.

This patch introduces the write side benchmark (read side will hopefully come
tomorrow).  While the write side is, as mentioned, not the most interesting
part, I did see some standing from the flamegraph that allowed me to optimize
one particular function, yielding a 8.6 % improvement."
2015-08-12 18:33:11 +03:00
Calle Wilund
47b7314c78 Commitlog: add test for too large alloc 2015-08-12 16:20:12 +02:00
Glauber Costa
4ddef06ba6 perf tests: test sstables index reads and writes
This is a test that allow us to query the performance of our sstable index
reads and writes (currently only writes implemented). A lot of potentially
common code is put into a header, which will make writing new tests easier if
needed.

We don't want to take shortcuts for this, so all reading and writing is done
through public sstable interfaces.

For writing, there is no way to write the index without writing the datafile.
But because we are only writing the primary key, the datafile will not contain
anything else. This is the closest we can get to an index testing with the
public interfaces.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-08-12 09:18:37 -05:00
Glauber Costa
07eb98e799 tests: enhance _remove so it also removes directory structures
if a directory is found, recursively delete it. This will be useful for
allowing the creation of test structures like test/cpuX/sstable

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-08-12 09:17:37 -05:00
Glauber Costa
fa4cbe4844 tests: allow one to specify the directory in which test sstables will be created
Our normal test directory may not be good enough for performance testing. The
reason is, that while our git tree with its relative path will usually be
sitting in a standard ext4 filesystem, we want the performance tests to be run
against XFS, which is our deployment target.

It is a lot easier to point the perf test to an already mounted xfs directory,
than to meddle with mounts into the codebase's relative path for this alone.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-08-12 09:17:09 -05:00
Glauber Costa
da3cd1dc6a tests: expose create directory function
In some situations, it is useful to have the test directory persistent. To do that,
expose the inner function that creates it.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-08-12 09:12:59 -05:00
Vlad Zolotarov
806cc8c09a locator: snitch_reset_test
Checks that both successful and insuccessful calls for reset_snitch()
function as expected.

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2015-08-12 16:44:47 +03:00
Vlad Zolotarov
4eeed09572 tests: gossiping_property_file_snitch_test: stop() the distributed in an error case
If snitch has been created while it had to fail we have to stop the
global (distributed) snitch in order to avoid the assert.

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2015-08-12 16:19:06 +03:00
Glauber Costa
480d2c6d3e tests: move directory creation code to header
So we can use it in tests other than the main sstable one

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-08-11 23:37:06 -05:00
Raphael S. Carvalho
ce2fea2976 tests: add basic test to compaction manager functionality
Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-08-11 20:14:48 +03:00
Avi Kivity
ca6ab0a6d1 Merge "Implement "atomic" batch statement processing" from Calle
"I.e. implement storage_proxy::mutate_atomically, which in turn means
roughly the same as mutate, with write/remove from the batchlog table
intermixed.

This patch restructures some stuff in storage_proxy to avoid to much code
duplication, with the assumption (amongst other) that dead nodes will be few
etc."
2015-08-11 18:33:34 +03:00
Calle Wilund
81f2f80963 Add batchlog_manager to cqlenv + add batch statement test to cql test 2015-08-11 17:10:18 +02:00
Raphael S. Carvalho
9823164c89 db: introduce compaction manager
Currently, each column family creates a fiber to handle compaction requests
in parallel to the system. If there are N column families, N compactions
could be running in parallel, which is definitely horrible.

To solve that problem, a per-database compaction manager is introduced here.

Compaction manager is a feature used to service compaction requests from N
column families. Parallelism is made available by creating more than one
fiber to service the requests. That being said, N compaction requests will
be served by M fibers.

A compaction request being submitted will go to a job queue shared between
all fibers, and the fiber with the lowest amount of pending jobs will be
signalled.

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-08-11 17:25:46 +03:00
Avi Kivity
925b44250d tests: fix cql_test_env fight with storage_service
storage_service is a singleton, and wants a database for initialization.
On the other hand, database is a proper object that is created and
destroyed for each test.  As a result storage_service ends up using
a destroyed object.

Work around this by:
  - leaking the database object so that storage_service has something
    to play with
  - doing the second phase of storage_service initialization only once
2015-08-10 15:48:38 +03:00
Avi Kivity
d6351ecca7 utils: add crc32 class
C++ interface to the crc32 x86 instruction.
2015-08-09 00:05:33 +03:00
Tomasz Grabiec
5e677f4331 tests: Add row_cache eviction test 2015-08-08 09:59:24 +02:00
Tomasz Grabiec
bceeb301b7 tests: lsa: Add test for region merging 2015-08-08 09:59:24 +02:00
Avi Kivity
a1543dc4f9 tests: mark fake variable as unused in logalloc_test
So that gcc 5.1 doesn't complain.
2015-08-07 21:32:09 +03:00
Glauber Costa
21ebaeffae schema_builder: provide a build function that doesn't take compact storage.
We will invoke the schema builder from schema_tables.cc, and at that point, the
information about compact storage no longer exists anywhere. If we just call it
like this, it will be the same as calling it with compact_storage::no, which
will trigger a (wrong) recomputation for compact_storage::yes CFs

The best way to solve that, is make the compact_storage parameter mandatory
every time we create a new table - instead of defaulting to no. This will
ensure that the correct dense and compound calculation are always done when
calling the builder with a parameter, and not done at all when we call it
without a parameter.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-08-07 09:30:54 -05:00
Glauber Costa
976de6f6f4 sstables: get cf and ks strings for filename
We will need them to properly build names in some situations.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-08-07 08:31:55 -05:00
Glauber Costa
cd8c9ad288 sstables: add ks and cf name to sstable constructor
When a schema is available, we use it. However, we have, by now, way too many
tests. Some of them use tables for which we don't even know the schema. It would
have been a massive amount of work to require a schema for all of them - so I am
keeping both constructors around.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-08-07 08:31:55 -05:00
Pekka Enberg
87f0e50a46 tests/bytes_ostream_test: Test case for appending big and small chunks
Add a test case that triggers the heap overflow fixed in previous commit
("bytes_ostream: Fix current_space_left()").

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-08-07 13:00:31 +03:00
Raphael S. Carvalho
004af400de tests: add method in sstables::test to write components
Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-08-06 17:39:05 +03:00
Tomasz Grabiec
343f84e3aa tests: Fix condition in allocation_strategy_test 2015-08-06 15:32:02 +02:00
Avi Kivity
48a1ce28fc Merge "Switch to log-structured allocator" from Tomasz 2015-08-06 15:45:39 +03:00
Tomasz Grabiec
8978d0ba1a tests: Test memtable data survives full compaction 2015-08-06 14:05:16 +02:00
Tomasz Grabiec
658c21a060 tests: Add LSA tests 2015-08-06 14:05:16 +02:00
Tomasz Grabiec
e7e79af435 tests: Add allocation_strategy_test 2015-08-06 12:52:43 +02:00
Avi Kivity
640db3383a Revert "tests: give cql_test_env a directory"
This reverts commit 6b2be41df00bc42331eccd423b7031b345cf979d; tests should
work without a data directory, so let's find why they don't and fix it
instead.
2015-08-06 13:09:06 +03:00
Asias He
b27201bd56 storage_service: Pass db into storage_service
It is needed for db.get_version(). I really hated to pass &db everywhere
If we had a global helper function like get_local_db(), life will be much
easier.
2015-08-06 15:23:51 +08:00
Avi Kivity
6b2be41df0 tests: give cql_test_env a directory
While supposedly running in memory, looks like it still wants a data
directory.  Give it one.
2015-08-05 15:05:50 +03:00
Avi Kivity
c720cddc5c tests: mv tests/urchin/* -> tests/
Now that seastar is in a separate repository, we can use the tests/
directory.
2015-08-05 14:16:52 +03:00
Tomasz Grabiec
eba7121bf5 Merge branch 'pdziepak/select-distinct/v2' from seastar-dev.git
From Pawel:

This series fixes SELECT DISTINC statements. Previously, we relied on the
existance of static row to get proper results. That obviously doesn't work
when there is no static row in the partition. The solution for that is
to introduce new option to partition_slice: distinct which informs that
the only important information is static row and whether the partition
exists.
2015-08-04 17:00:56 +02:00
Paweł Dziepak
b4d967fcf2 tests/cql3: add tests for SELECT DISTINCT
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-04 15:39:57 +02:00
Avi Kivity
318cc489c8 mutation_reader: add make_joining_reader()
Reads from provided readers, in order (assumes provided readers are
disjoint and in required order).
2015-08-04 15:49:09 +03:00
Paweł Dziepak
77dd2faee0 tests/cql3: add tests for multi column relations
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-04 10:59:15 +02:00
Pekka Enberg
a3c95235e6 migration_manager: Make stateful with sharded<>
In preparation for adding listener state to migration manager, use
sharded<> for migration manager.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-08-04 11:23:23 +03:00
Avi Kivity
536d6fa32a tests: fix mutation_test use-after-free
Two bugs:
 - column_family not stop()ped after use
 - flush() future not waited on
2015-08-04 11:19:59 +03:00
Tomasz Grabiec
b88fc51e2a tests: Introduce test for storage_proxy::make_local_reader() 2015-08-03 15:21:40 +02:00
Tomasz Grabiec
14f8c242b2 tests: cql_test_env: Simplify make_env_for_test() using seastar::async() 2015-08-03 15:21:36 +02:00
Paweł Dziepak
6121fded85 tests/cql3: add more ttl tests
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-30 14:10:06 +02:00
Asias He
079ea13e67 main: Add init_storage_service helper
Simplifies deinit call.
2015-07-28 15:21:08 +03:00
Avi Kivity
fa13050f64 tests: deinit storage_service in cql_tests_env 2015-07-28 14:57:57 +03:00
Asias He
a2b54fc757 main: Introduce init.cc to cleanup service startup code
This patch introduce init.cc file which hosts all the initialization
code. The benefits are 1) we can share initialization code with tests
code. 2) all the service startup dependency / order code is in one
single place instead of everywhere.
2015-07-28 18:20:45 +08:00