Commit Graph

6861 Commits

Author SHA1 Message Date
Glauber Costa
d3aef2c1a5 database: support clear snapshot
This allows for us to delete an existing snapshot. It works at the column
family level, and removing it from the list of keyspace snapshots needs to
happen only when all CFs are processed. Therefore, that is provided as a
separate operation.

The filesystem code is a bit ugly: it can be made better by making our file
lister more generic. First step would be to call it walker, not lister...

For now, we'll use the fact that there are mostly two levels in the snapshot
hierarchy to our advantage, and avoid a full recursion - using the same lambda
for all calls would require us to provide a separate class to handle the state,
that's part of making this generic.

Signed-off-by: Glauber Costa <glommer@scylladb.com>
2015-10-20 15:38:14 +02:00
Glauber Costa
500ee99c93 file lister: allow for more than one directory type
There are situations in which we would like to match more than one directory
type.  One example of that, would be a recursive delete operation: we need to
delete the files inside directories and the directories themselves, but we
still don't want a "delete all" since finding anything other than a directory
or a file is an error, and we should treat it as such.

Since there aren't that many times, it should be ok performance wise to just
use a list. I am using an unordered_set here just because it is easy enough,
but we could actually relax it later if needed. In any case, users of the
interface should not worry about that, and that decision is abstracted away
into lister::dir_entry_types.

Signed-off-by: Glauber Costa <glommer@scylladb.com>
2015-10-20 15:38:14 +02:00
Avi Kivity
5abdc4323a Merge seastar upstream
* seastar 46fd389...6af5a0d (2):
  > sharded: do not try to call nonexistent delete callback
  > use real argv0 in dpdk initialization
2015-10-20 15:19:35 +03:00
Tomasz Grabiec
67d0f9c7df lsa: Restore heap invariant before calling _segments.erase()
This is certainly the right thing to do and seems to fix #403. However
I didn't manage to convince myself that this would cause problems for
binomial_heap, given that binomial_heap::erase() calls siftup()
anyway:

    void erase(handle_type handle)
    {
        node_pointer n = handle.node_;
        siftup(n, force_inf());
        top_element = n;
        pop();
    }

    void increase (handle_type handle)
    {
        node_pointer n = handle.node_;
        siftup(n, *this);

        update_top_element();
        sanity_check();
    }
2015-10-20 15:18:05 +03:00
Asias He
08b762111e storage_service: Fix ignored future in on_dead
All the on_xxx interface in i_endpoint_state_change_subscriber are
called within a seastar::async context.
2015-10-20 15:16:03 +03:00
Amnon Heiman
1e8752d55e API: Fix a confusion in the storage service snapshot details
There was a confusion between the snapshot key and the keyspace in the
snapshot details, this fixes it.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-10-20 13:53:09 +03:00
Avi Kivity
2575a4602e Merge "Fix for snapshots/create_links and shared SSTables" from Glauber
"Those are fixes needed for the snapshotting process itself. I have bundled this
in the create_snapshot series before to avoid a rebase, but since I will have to
rewrite that to get rid of the snapshot manager (and go to the filesystem),
I am sending those out on their own."
2015-10-20 13:49:17 +03:00
Pekka Enberg
3a3c7f7e79 configure.py: Propagate CFLAGS to seastar config
We need to propagate CFLAGS to seastar config for things like
DEBUG_SHARED_PTR to work.
2015-10-20 10:57:26 +03:00
Calle Wilund
786d66cacf commitlog: Fix use-after-free
Remove "finally". Just use a then_wrapped. Which it was originally, before
"handle_exception" was introduced to seastar. Oh, the irony...
2015-10-20 09:56:40 +03:00
Avi Kivity
2ccb5feabd Merge "Support nodetool cfhistogram"
"This series adds the missing estimated histogram to the column family and to
the API so the nodetool cfhistogram would work."
2015-10-19 17:11:46 +03:00
Raphael S. Carvalho
28ef8feffa tests: fix test for leveled compaction
test_setup::do_with_test_directory is missing. For some reason,
the test wasn't failing without it until now. Adding it is the
correct thing to do anyway.

Signed-off-by: Raphael S. Carvalho <raphaelsc@scylladb.com>
2015-10-19 17:07:08 +03:00
Avi Kivity
f4706c7050 Merge "initial support to leveled compaction" from Raphael
"This patchset introduces leveled compaction to Scylla.
We don't handle all corner cases yet, but we already have the strategy
and compaction working as expected. Test cases were written and I also
tested the stability with a load of cassandra-stress.

Leveled compaction may output more than one sstable because there is
a limit on the size of sstables. 160M by default.
Related to handling of partial compaction, it's still something to be
worked on.

Anyway, it will not be a big problem. Why? Suppose that a leveled
compaction will generate 2 sstables, and scylla is interrupted after
the first sstable is completely written but before the second one is
completely written. The next boot will delete the second sstable,
because it was partially written, but will not do anything with the
first one as it was completely written.
As a result, we will have two sstables with redundant data."
2015-10-19 16:17:45 +03:00
Glauber Costa
218fdebbeb snapshot: do not allow exceptions in snapshot creation hang us
With the distribute-and-sync method we are using, if an exception happens in
the snapshot creation for any reason (think file permissions, etc), that will
just hang the server since our shard won't do the necessary work to
synchronize and note that we done our part (or tried to) in snapshot creation.

Make the then clause a finally, so that the sync part is always executed.

Signed-off-by: Glauber Costa <glommer@scylladb.com>
2015-10-19 13:37:02 +02:00
Glauber Costa
9083a0e5a7 snapshots: fix generation of snapshots with shared sstables
create_links will fail in one of the shards if one of the SSTables happen to be
shared. It should be fine if the link already exists, so let's just ignore that case.

Signed-off-by: Glauber Costa <glommer@scylladb.com>
2015-10-19 13:37:01 +02:00
Gleb Natapov
156f760663 storage_proxy: drop Origin's truncate code from comment
Drop already translated code.
2015-10-19 14:06:06 +03:00
Gleb Natapov
ae42ec7832 storage_proxy: actually sort endpoints in get_live_sorted_endpoints() 2015-10-19 13:38:37 +03:00
Avi Kivity
75ab27f683 Revert "Merge "move dependencies to /opt/scylladb" from Takuya"
This reverts commit c96b0453f2, reversing
changes made to b862165279e70300d29a075dc913523d56a616d2; there were some
extra commits on that branch.
2015-10-19 13:31:51 +03:00
Avi Kivity
c96b0453f2 Merge "move dependencies to /opt/scylladb" from Takuya
"This moves all dependency packages to /opt/scylladb."
2015-10-19 13:28:39 +03:00
Takuya ASADA
14fab1e36d dist: use scylla-* dependency packages on scylla-server.spec 2015-10-19 09:11:22 +00:00
Takuya ASADA
39e17e04bc dist: move antlr3-C++-devel package to /opt/scylladb 2015-10-19 09:11:22 +00:00
Takuya ASADA
71182a0a95 dist: move antlr3-tool package to /opt/scylladb 2015-10-19 09:11:22 +00:00
Takuya ASADA
1c7d8bc0e9 dist: move ragel package to /opt/scylladb 2015-10-19 09:11:22 +00:00
Takuya ASADA
95c67a3e2e dist: move ninja-build package to /opt/scylladb, remove unused dependency for re2c 2015-10-19 09:11:22 +00:00
Takuya ASADA
ab8fe49b4f dist: move boost package to /opt/scylladb 2015-10-19 09:11:22 +00:00
Takuya ASADA
2c7861b7ed dist: move gcc package to /opt/scylladb 2015-10-19 09:11:22 +00:00
Takuya ASADA
23b69d610c dist: move isl package to /opt/scylladb 2015-10-19 09:11:22 +00:00
Takuya ASADA
6db2ddc53b dist: move binutils package to /opt/scylladb 2015-10-19 09:11:22 +00:00
Takuya ASADA
f06e50a569 dist: add scylla-env package for CentOS, to use /opt/scylladb as prefix 2015-10-19 09:11:22 +00:00
Calle Wilund
b862165279 commitlog_test: Modify test_allocation_failure to not require huge segment
Explicitly use up all the memory in the system as best as we can instead
Still not super reliable, but should have less side effects. And work better
with pre-allocated segment files
2015-10-19 11:32:35 +03:00
Avi Kivity
eed43b276c tests: use workspace-local directory for commitlog
Can't rely on default /var/lib/scylla to be there or accessible.
2015-10-19 10:21:16 +02:00
Tomasz Grabiec
19d7d30e67 Replace references to 'urchin' with 'scylla' 2015-10-19 11:08:05 +03:00
Takuya ASADA
ca43a5f2ca dist: dependency fix for ninja-build 2015-10-19 06:59:15 +00:00
Takuya ASADA
721d0f9f64 dist: fix srpm not found error 2015-10-19 06:52:48 +00:00
Takuya ASADA
78813d9617 dist: create rpmbuild dirs 2015-10-19 06:51:03 +00:00
Vlad Zolotarov
7492b662c8 locator::gossiping_property_file_snitch: do_withicate file descriptor in property_file_was_modified()
file::stat() requires "this" to be valid will the end of the call.

Fixes issue #464

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2015-10-19 06:51:03 +00:00
Vlad Zolotarov
8c4ce0efee locator::production_snitch_base: fix production_snitch_base signature
Make production_snitch_base constructor signature consistent with
the rest of production snitches.

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2015-10-19 06:51:03 +00:00
Vlad Zolotarov
4b8b3e7841 locator::production_snitch_base: cleanup
Don't keep the file descriptor beyond load_property_file() scope.

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2015-10-19 06:51:03 +00:00
Vlad Zolotarov
9dfc08cf9f locator::gossiping_property_file_snitch: use empty string as a default config file name
A non-empty default value of a configuration file name was preventing
the db::config::get_conf_dir() to kick in when a default snitch constructor
was used (this is the way it's always used from scylla).

Fixes issue #459

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2015-10-19 06:51:03 +00:00
Avi Kivity
ce046d07da tests: create directories for user column families as well 2015-10-19 06:51:03 +00:00
Avi Kivity
f63002a75e tests: initialize system keyspace (and its directories) for cql_test_env
Now that columnb familiy directories are not created on demand, the tests
started to fail.
2015-10-19 06:51:03 +00:00
Raphael S. Carvalho
dfc95587d6 db: do not ignore compaction strategy class
When building the in-memory schema for a column family, we were
ignoring compaction strategy class because of a bug in the
existing code. Example: suppose that you create a column family
with leveled compaction strategy. This option would be ignored
and the default strategy (size-tiered) would be used instead.
Found this problem while working on leveled compaction.

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-10-19 06:51:03 +00:00
Glauber Costa
c8a6883987 sstables: remove outdated comment
We already write all components. The FIXME is fixed.

Signed-off-by: Glauber Costa <glommer@scylladb.com>
2015-10-19 06:51:03 +00:00
Avi Kivity
dd2bf81131 tests: disable collectd
No need to blast collectd metrics during test runs.
2015-10-19 09:05:48 +03:00
Avi Kivity
268f7acd11 Merge snitch fixes from Vlad
"This series cleans up a few places in the snitches
code that has been noticed during the work on issues #464
and #459.

The last patch actually fixes the issue #464"
2015-10-18 17:21:30 +03:00
Vlad Zolotarov
fe5e983152 locator::gossiping_property_file_snitch: do_withicate file descriptor in property_file_was_modified()
file::stat() requires "this" to be valid will the end of the call.

Fixes issue #464

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2015-10-18 16:58:27 +03:00
Vlad Zolotarov
15606fc8d3 locator::production_snitch_base: fix production_snitch_base signature
Make production_snitch_base constructor signature consistent with
the rest of production snitches.

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2015-10-18 16:58:27 +03:00
Vlad Zolotarov
5712aa4d48 locator::production_snitch_base: cleanup
Don't keep the file descriptor beyond load_property_file() scope.

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2015-10-18 16:58:27 +03:00
Vlad Zolotarov
f113a57ba1 locator::gossiping_property_file_snitch: use empty string as a default config file name
A non-empty default value of a configuration file name was preventing
the db::config::get_conf_dir() to kick in when a default snitch constructor
was used (this is the way it's always used from scylla).

Fixes issue #459

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2015-10-18 16:56:12 +03:00
Avi Kivity
bb67258c68 tests: create directories for user column families as well 2015-10-18 14:45:42 +03:00
Avi Kivity
9fd73417ae tests: initialize system keyspace (and its directories) for cql_test_env
Now that columnb familiy directories are not created on demand, the tests
started to fail.
2015-10-18 12:25:36 +03:00