Commit Graph

4228 Commits

Author SHA1 Message Date
Tomasz Grabiec
9ebb7e968d tests: Switch to schema_builder in partitioner_test 2015-06-25 18:45:13 +02:00
Tomasz Grabiec
f444f88dbe schema_builder: Add missing include 2015-06-25 18:45:13 +02:00
Tomasz Grabiec
ac333f04e2 dht: Make decorated_key comparable with ring_position 2015-06-25 18:45:12 +02:00
Tomasz Grabiec
9525464f74 Move query::ring_position to dht::ring_position 2015-06-25 18:45:12 +02:00
Tomasz Grabiec
6515cb642b dht: Remove obsolete files 2015-06-25 18:45:12 +02:00
Avi Kivity
90412a2b26 Merge "Compression parameter fixes" from Paweł 2015-06-25 18:48:30 +03:00
Paweł Dziepak
89ede1fc00 schema: rename [set, get]_compressor to [set, get]_compressor_params
Compressor type is only a part of the information kept in compressor
parameters and things like schema.get_compressor().get_compressor()
do not look very good.

Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-06-25 17:05:53 +02:00
Raphael S. Carvalho
92054f8391 sstables: fix typo in compaction code
s/estimated_parititions/estimated_partitions

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-06-25 17:45:06 +03:00
Paweł Dziepak
4899100877 compress: use '= default' for default constructor
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-06-25 16:32:58 +02:00
Paweł Dziepak
28242489c3 compress: fix include quotes
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-06-25 16:32:30 +02:00
Tomasz Grabiec
cb43e23cf4 Merge branch 'glommer/bootstrap-v3' from git@github.com:glommer/urchin.git
Bootstraping of system tables from Glauber.
2015-06-25 16:20:13 +02:00
Tomasz Grabiec
6be8d30862 Merge tag 'avi/token-wraparound/v1' from seastar-dev.git
Fixes for token workaround from Avi:

"Tokens wrap around in a ring; if we have a range (t1, t2) where t1 > t2
the midpoint is not between them."
2015-06-25 16:01:20 +02:00
Glauber Costa
e19f7e93a4 database: column families loading
Same as for keyspaces, and we will reuse most of the code. CFs that are
found on disk upon bootstrap are now recreated in memory.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-06-25 09:50:55 -04:00
Glauber Costa
b3a4eb83d3 database: keyspaces loading
This patch bootstraps the keyspaces found in system sstables and make
our in-memory structures reflect them. It tries to reuse as much code
as we can from db::legacy_system_tables, but keeping everything local
and without applying any mutations to the database - since the latter
would only unnecessarily complicate the write path.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-06-25 09:50:55 -04:00
Glauber Costa
c0ad0dc1d3 database: pass storage proxy to init_data_directory
In order for us to call some function from db::legacy_schema_tables, we need
a working storage proxy. We will use those functions in order to leverage the
work done in keyspace / table creation from mutations

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-06-25 09:50:55 -04:00
Glauber Costa
48cfdcee7b main: init from data directory later
Soon I will introduce some changes that make init_from_data_directory dependent
on a working storage proxy.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-06-25 09:50:55 -04:00
Amnon Heiman
72c034abe1 Http API: Add Swagger-UI support
This patch adds support to the Swagger-UI. It does so by adding
reference to the Swagger-UI target directory, after applying this patch
/ui/ will display the Swagger-UI page with the available APIs.

From the Swagger-UI page it is possible to run the different APIs.

The target directory of the ui can be override from the command line.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-06-25 16:41:38 +03:00
Avi Kivity
71e04b412e Merge "Compression parameters" from Paweł
"This patch series introduces compression_parameters class which is used
to handle compression options specified at table creation. Such information
is now properly propagated to the database internals."
2015-06-25 15:48:15 +03:00
Avi Kivity
1a12438e5e tests: add token midpoint tests 2015-06-25 15:25:57 +03:00
Avi Kivity
ba3fb44bf5 dht: implement more token relational operators 2015-06-25 15:25:37 +03:00
Avi Kivity
e4140a19ed dht: virtualize i_parititoner::midpoint() and implement for murmur3 2015-06-25 15:25:04 +03:00
Paweł Dziepak
335fe5ce50 tests/cql: add test for compression specific validation
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-06-25 14:17:59 +02:00
Paweł Dziepak
51e3f2bcea cql3: use default compressor if none specified
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-06-25 14:17:46 +02:00
Avi Kivity
f8e2c13933 dht: rename midpoint() to midpoint_unsigned()
midpoint()'s algorithm only works for unsigned tokens, so rename it
accordingly.
2015-06-25 14:54:40 +03:00
Paweł Dziepak
6845cc0ee5 cql3: propagate compression info to schema and sstables code
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-06-25 13:33:00 +02:00
Paweł Dziepak
53640c73fd compress: add compression_parameters class
Passing a single enum specifying a compressor type around is not enough,
since there are other compression options user may want to specify.

Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-06-25 13:32:13 +02:00
Avi Kivity
70aaa0fb76 Update swagger-ui for local fix (change URL to not to point to pet store) 2015-06-25 14:04:07 +03:00
Avi Kivity
d8946d07ed dht: fix token wraparound in midpoint()
midpoint(l, r) where l > r needs to wrap around the end of the ring.  Adjust
the midpoint() function to do this.

Note this is still broken for the murmur3 partitioner, since it doesn't treat
tokens as unsigned.
2015-06-25 13:55:46 +03:00
Nadav Har'El
3f5114e415 compaction: compact_all_sstables demo function
This is an example of how to use the low-level compact_sstable() function
to compact all the sstables of one column family into one. It is not a
full-fledged "compaction strategy" but the real ones can be based on this
example.

Among the things that this code doesn't do yet is to delete the old
sstables. In the future, this should happen automatically in the sstable
destructor when all the references to the sstable get deleted.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-06-25 11:05:35 +03:00
Raphael S. Carvalho
b54d35dcbb sstables: fix use-after-free at the end of compaction
Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-06-25 08:39:10 +03:00
Tomasz Grabiec
e0eb07abe9 Merge tag 'consolidate-keyspaces-v2' from git@github.com:glommer/urchin.git
"Consolidate Keyspaces" from Glauber:

"In some situations, we fail to create a keyspace directory where we should.
This leads later sstable creation invocations to fail.

Moreover, we are replicating a lot of code in this front.

This patchset consolidates the callers to create_keyspace, and guarantees that
we will always do the right thing.

It is still possible to create an in-memory only keyspace (to be used in my
upcoming bootstrap patchset), but that will now be a private method of the
database."
2015-06-24 20:07:45 +02:00
Glauber Costa
7fa8071dde fix creation of keyspaces
When we call merge_keyspaces, we end up calling db.add_keyspace, which means we
don't do parts of creation of a keyspace - like creating the directory. This works
in some situations where all the work was already done, but not in others.

We should be calling create_keyspace instead, which will take care of all that
for us. That will include creating a directory when one is needed.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-06-24 12:44:05 -04:00
Glauber Costa
4d07c952cc remove global create_keyspace
There is only one user in tree, and as Tomek pointed out, it is buggy. The
reason is that ksm is a shard-local structure, and it is currently used
indiscriminately by all shards which can easily lead to problems.

We could fix it with some tricks, but it is way better and safer to make sure
the callers are doing it right instead. There is only one caller, so let's fix
that.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-06-24 12:44:05 -04:00
Glauber Costa
f0f04892d3 database: no longer replicate create_keyspace code
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-06-24 12:44:05 -04:00
Raphael S. Carvalho
79532b6603 sstables: merge prepare_statistics and add_statistics_metadata
The two separate functions can now be merged. As a result, the code
that generates statistics data is now much easier to understand.

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-06-24 18:58:17 +03:00
Raphael S. Carvalho
74febd97f2 sstables: avoid assert when generating cardinality metadata
Assert should be completely avoided. Instead, we should trigger an
exception, allowing the db to proceed with a "smooth" shutdown.

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-06-24 18:58:17 +03:00
Tomasz Grabiec
dc6bfb63da system_keyspace: Introduce query()
Simple method to get all data from a system table.

Note: Perhaps we should move storage_proxy::query_local() here as well.
2015-06-24 18:13:02 +03:00
Avi Kivity
a723942a54 Merge seastar upstream 2015-06-24 18:12:43 +03:00
Avi Kivity
716c7c04db build: configure dpdk MAX_MEMSEG to a higher value
Prevent failure on a high memory machine.
2015-06-24 18:09:17 +03:00
Avi Kivity
ab22932899 build: make dpdk config more generic
Allow setting a variable to any value, not just disabling it.
2015-06-24 18:07:11 +03:00
Avi Kivity
e639b56952 Add swagger-ui submodule
Only needed for runtime, not build.
2015-06-24 17:26:14 +03:00
Avi Kivity
3d22623a6b Merge "Flush schema changes to disk" from Glauber
"This is the current patchset to flush and persist schema changes to disk.
It is not perfect, in the sense that older changes still in flight won't be
waited for. But as we discussed - at this moment we'll just note that, and
leave the fix for later"
2015-06-24 17:08:33 +03:00
Paweł Dziepak
e5a2e63785 cql3: fix properties allowed in table creation statements
KW_MINCOMPACTIONTHRESHOLD and KW_MAXCOMPACTIONTHRESHOLD shouldn't be
allowed, they are properties of compaction strategy not the table itself.
KW_COMPACTION and KW_COMPRESSION should be allowed.

Reported-by: Shlomi Livne <shlomi@cloudius-systems.com>
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
2015-06-24 16:45:19 +03:00
Nadav Har'El
27c238d6b7 sstable: fix load of new sstable
Apparently, after writing a new sstable, with write_components(), it
is necessary to load() it. I'm not sure why, but we get a crash on
an aio to a closed file descriptor if we don't.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-06-24 16:44:25 +03:00
Nadav Har'El
0b297b9f6c sstable compaction: simplify compact_sstables() function
Instead of requiring the user to subclass a "sstable_creator" class to
specify how to create a new sstable (or in the future, several of them),
switch to an std::function.

In practice, it is much easier to specify a lambda than a class, especialy
since C++11 made it easy to capture variables into lambdas - but not into
local classes.

The "commit()" function is also unnecessary. Then intention there was to
provide a function to "commit" the new sstables (i.e., rename them).
But the caller doesn't need to supply this function - it can just wait
for the future of the end of compaction, and do his own committing code
right then.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-06-24 16:44:11 +03:00
Avi Kivity
e93ac50666 Merge "Adding the cache_service stub API" from Amnon
"This series adds the cache_service definition file with a stub implementation.
The API is based on the CacheServiceMBean interface.
The stubbed API return stubbed value of the correct type."
2015-06-24 15:52:48 +03:00
Avi Kivity
66afef0bd7 Merge seastar upstream
Conflicts:
	NOTICE
	configure.py
2015-06-24 15:21:55 +03:00
Amnon Heiman
4258b005db API: Adding stub implementation for the cache service
This adds a stub implementation for the cache_service. It also register
the API doc.
The cache_service doc will be available at:
http://localhost:10000/api-doc/cache_service/

The stub implementation returns the correct value type with stubbed
values.

After this patch the following path will be available:
/cache_service/row_cache_save_period
/cache_service/key_cache_save_period
/cache_service/counter_cache_save_period
/cache_service/row_cache_keys_to_save
/cache_service/key_cache_keys_to_save
/cache_service/counter_cache_keys_to_save
/cache_service/invalidate_key_cache
/cache_service/invalidate_counter_cache
/cache_service/row_cache_capacity
/cache_service/key_cache_capacity
/cache_service/counter_cache_capacity
/cache_service/save_caches

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-06-24 14:30:08 +03:00
Amnon Heiman
d4b5e65b7c API Adding the cache_service definition file
This adds the definition file for the cache service, the API is based on
the CacheServiceMBean definition and contain the following command:
get_row_cache_save_period_in_seconds
set_row_cache_save_period_in_seconds
get_key_cache_save_period_in_seconds
set_key_cache_save_period_in_seconds
get_counter_cache_save_period_in_seconds
set_counter_cache_save_period_in_seconds
get_row_cache_keys_to_save
set_row_cache_keys_to_save
get_key_cache_keys_to_save
set_key_cache_keys_to_save
get_counter_cache_keys_to_save
set_counter_cache_keys_to_save
invalidate_key_cache
invalidate_counter_cache
set_row_cache_capacity_in_mb
set_key_cache_capacity_in_mb
set_counter_cache_capacity_in_mb
save_caches

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-06-24 14:29:22 +03:00
Avi Kivity
63e7f8d99c docs: exclude dpdk 2015-06-24 13:09:51 +03:00