Commit Graph

7031 Commits

Author SHA1 Message Date
Raphael S. Carvalho
5cdc886f84 tests: add test to read_indexes
Signed-off-by: Raphael S. Carvalho <raphaelsc@scylladb.com>
2015-10-23 16:57:41 -02:00
Raphael S. Carvalho
af88a6864a sstables: fix read_indexes
read_indexes() will not work for a column family that minimum
index interval is different than sampling level or that sampling
level is lower than BASE_SAMPLING_LEVEl.
That's because the function was using sampling level to determine
the interval between indexes that are stored by index summary.
Instead, method from downsampling will be used to calculate the
effective interval based on both minimum_index_interval and
sampling_level parameters.

Fixes issue #474.

Signed-off-by: Raphael S. Carvalho <raphaelsc@scylladb.com>
2015-10-23 16:57:41 -02:00
Raphael S. Carvalho
e18cf96b01 sstables: convert Downsampling to C++
Signed-off-by: Raphael S. Carvalho <raphaelsc@scylladb.com>
2015-10-23 16:57:39 -02:00
Raphael S. Carvalho
19f2dc9ef9 import Downsampling.java
Signed-off-by: Raphael S. Carvalho <raphaelsc@scylladb.com>
2015-10-22 14:44:40 -02:00
Gleb Natapov
5b97604735 load_broadcaster: fix linkage error in debug mode
Also move it to service namespace.
2015-10-22 18:18:05 +02:00
Tomasz Grabiec
5bbc902eec mutation_partition: Drop now unnecessary unconst() usage
This change was actually promised by
f74c665671.
2015-10-22 17:12:03 +02:00
Tomasz Grabiec
c7be350961 mutation_partition: Rename reversion_traits to reversal_traits
As pointed out by Nadav, 'reversion' is from 'revert', 'reversal' is
from 'reverse'.
2015-10-22 18:09:07 +03:00
Tomasz Grabiec
f74c665671 mutation_partition: Add non-const-qualified version of range() and use it 2015-10-22 18:09:07 +03:00
Asias He
6c48ce065e storage_service: Make comment clearer in get_changed_ranges_for_leaving
We are not removing the range. Current node and new node will be
responsible for the range are calculated. We only need to stream data to
node = new node - current node. E.g,

Assume we have node 1 and node 2 in the cluster, RF=2. If we remove node2:

Range (3c 25 fa 7e d2 2a 26 b4 , 81 2a a7 32 29 e5 3a 7c ],
current_replica_endpoints={127.0.0.1, 127.0.0.2} new_replica_endpoints={127.0.0.1}

Range (3c 25 fa 7e d2 2a 26 b4 , 81 2a a7 32 29 e5 3a 7c ] already in all replicas

no data will be streamed to node 1 since it already has it.
2015-10-22 18:08:03 +03:00
Avi Kivity
a699bc20bc Merge "Adding the stream metrics API" from Amnon
"This series adds the stream metrics API, the swagger definition are based on
the StreamMetrics class in origin."
2015-10-22 17:18:01 +03:00
Amnon Heiman
5323b29699 API: Add compaction history to the API
This patch adds a definition and a stub for the compaction history. The
implementation should read fromt the compaction history table and return
an array of results.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-10-22 17:16:58 +03:00
Avi Kivity
5d37ee29f8 Merge "Adding log level support to the API" from Amnon
"This series adds an API to get and set the log level.
After this series it will be possible to use the folloing url:
GET/POST:
/system/logger
/system/logger/{name}"
2015-10-22 17:15:41 +03:00
Avi Kivity
b4e5b9dcf1 Merge "Add support to nodetool describecluster"
"This series adds the functionality that is required for nodetool
describecluster

It uses the gossiper for get cluster name and get partitioner.  The
describe_schema_versions functionality is missing and a workaround is used so
the command would work.

After this series an example for nodetool describecluster:
./bin/nodetool describecluster
Cluster Information:
	Name: Test Cluster
	Snitch: org.apache.cassandra.locator.SimpleSnitch
	Partitioner: org.apache.cassandra.dht.Murmur3Partitioner
	Schema versions:
		127.0.0.1: [48c4e6c8-5d6a-3800-9a3a-517d3f7b2f26]"
2015-10-22 17:11:30 +03:00
Gleb Natapov
ece6c68288 convert loadBroadcaster 2015-10-22 17:10:20 +03:00
Avi Kivity
8362622eb8 Merge "Support Ubuntu 14.04LTS" from Takuya 2015-10-22 17:03:04 +03:00
Avi Kivity
0129e42b06 Merge "Mutation diff" from Paweł
"This series add code for computing mutation_partition difference.
For mutations A and B:

diffA = A.difference(B);
diffB = B.difference(A);
AB = A.apply(B);

diffA is the minimal mutation that when applied to B makes it equal
to AB and diffB is the minimal mutation that applied to A results in AB.

Fixes #430."
2015-10-22 16:38:25 +03:00
Avi Kivity
f7087da054 Merge "GET methods for snapshots" from Glauber
"The snapshots API need to expose GET methods so people can
query information on them. Now that taking snapshots is supported,
this relatively simple series implement get_snapshot_details, a
column family method, and wire that up through the storage_service."
2015-10-22 15:23:45 +03:00
Calle Wilund
05de462fa9 commitlog: Make flush/segment delete slightly mode defensive + test tolerant
Fix for (mainly) test failures (use-after free)
I.e. test case test_commitlog_delete_when_over_disk_limit causes
use-after free because test shuts down before a pending flush is done,
and the segment manager is actually gone -> crash writing stats.
Now, we could make the stats a shared pointer, but we should never
allow an operation to outlive the segment_manager.
In normal op, we _almost_ guarantee this with the shutdown() call,
but technically, we could have a flush continuation trailing somewhere.

* Make sure we never delete segments from segment_manager until they are
  fully flushed
* Make test disposal method "clear" be more defensive in flushing and
  clearing out segments
2015-10-22 15:19:24 +03:00
Avi Kivity
9dc8d98146 Merge "Make mutation queries respect reversed order" from Tomasz
"Affects CQL statements like the following one:

   select * from table order by ck desc;

Fixes #480."
2015-10-22 15:08:19 +03:00
Takuya ASADA
a03056a915 dist: add dependency packages and build script for ubuntu 2015-10-22 11:55:50 +00:00
Takuya ASADA
e0604b066a dist: add debian/ directory to build .deb package for Ubuntu 2015-10-22 11:55:50 +00:00
Takuya ASADA
592b64e478 dist: mount hugetlbfs on ubuntu 2015-10-22 11:55:50 +00:00
Takuya ASADA
830041d6be dist: share scripts both on redhat and ubuntu 2015-10-22 11:55:50 +00:00
Avi Kivity
a2577fefb9 Merge "Enable decommission support" from Asias
"Tested with:

- start node 1
- insert value
- start node 2
- insert value
- decommission node2

I can see from the log that data range belongs to node2 is streamed to node1
and cqlsh query node1 returns all the data, and node2 is not in the live node
list from node1's view."
2015-10-22 14:44:24 +03:00
Avi Kivity
5f3a46eabb Merge "load_new_sstables" from Glauber
"This patchset implements load_new_sstables, allowing one to move tables inside the
data directory of a CF, and then call "nodetool refresh" to start using them.

Keep in mind that for Cassandra, this is deemed an unsafe operation:
https://issues.apache.org/jira/browse/CASSANDRA-6245

It is still for us something we should not recommend - unless the CF is totally
empty and not yet used, but we can do a much better job in the safety front.

To guarantee that, the process works in four steps:

1) All writes to this specific column family are disabled. This is a horrible thing to
   do, because dirty memory can grow much more than desired during this. Throughout out
   this implementation, we will try to keep the time during which the writes are disabled
   to its bare minimum.

   While disabling the writes, each shard will tell us about the highest generation number
   it has seen.

2) We will scan all tables that we haven't seen before. Those are any tables found in the
   CF datadir, that are higher than the highest generation number seen so far. We will link
   them to new generation numbers that are sequential to the ones we have so far, and end up
   with a new generation number that is returned to the next step

3) The generation number computed in the previous step is now propagated to all CFs, which
   guarantees that all further writes will pick generation numbers that won't conflict with
   the existing tables. Right after doing that, the writes are resumed.

4) The tables we found in step 2 are passed on to each of the CFs. They can now load those
   tables while operations to the CF proceed normally."
2015-10-22 13:42:24 +03:00
Avi Kivity
2b0a504cbc Merge "Adding row chache statistic to column family" from Amnon
"This series adds row cache statistic to the column family that will be expose
via the API."
2015-10-22 13:38:01 +03:00
Paweł Dziepak
740e2166c5 tests/mutation: add test for mutation diff
Signed-off-by: Paweł Dziepak <pdziepak@scylladb.com>
2015-10-22 12:08:53 +02:00
Paweł Dziepak
f78a80dfa3 mutation_partition: add method for computing difference
Signed-off-by: Paweł Dziepak <pdziepak@scylladb.com>
2015-10-22 12:08:53 +02:00
Paweł Dziepak
85edc3de07 mutation_partition: compute row difference
Signed-off-by: Paweł Dziepak <pdziepak@scylladb.com>
2015-10-22 12:08:53 +02:00
Paweł Dziepak
75df23dd3c types: add collection_type_impl::difference()
Signed-off-by: Paweł Dziepak <pdziepak@scylladb.com>
2015-10-22 12:08:53 +02:00
Paweł Dziepak
4440f9b85b mutation_partition: add row_marker::is_live()
Signed-off-by: Paweł Dziepak <pdziepak@scylladb.com>
2015-10-22 12:08:53 +02:00
Paweł Dziepak
2aa96eb00f mutation_partition: add insert_row()
Signed-off-by: Paweł Dziepak <pdziepak@scylladb.com>
2015-10-22 12:08:53 +02:00
Paweł Dziepak
a064181d7c mutation_partition: add row::with_both_ranges()
Signed-off-by: Paweł Dziepak <pdziepak@scylladb.com>
2015-10-22 12:08:53 +02:00
Paweł Dziepak
1c05d7b927 mutation_partition: fix row_marker::apply() for equal timestamps
Signed-off-by: Paweł Dziepak <pdziepak@scylladb.com>
2015-10-22 12:08:53 +02:00
Paweł Dziepak
7fab0ee867 mutation_partition: add compare_row_marker_for_merge()
A compare_atomic_cell_for_merge() equivalent intended to be used
with row markers.

Signed-off-by: Paweł Dziepak <pdziepak@scylladb.com>
2015-10-22 12:08:53 +02:00
Asias He
04291dec28 storage_service: Enable call to excise 2015-10-22 17:41:02 +08:00
Asias He
ee551d070f storage_service: Enable add_expire_time_if_found in excise and handle_state_removing 2015-10-22 17:41:02 +08:00
Asias He
2137ab5522 storage_service: Implement add_expire_time_if_found 2015-10-22 17:41:02 +08:00
Asias He
e2fbd146d7 storage_service: Print keyspace info unbootstrap in debug 2015-10-22 17:41:02 +08:00
Asias He
affab296b0 storage_service: Fix ranges in stream_hints
Use range = make_open_ended_both_sides to present the entire ring.
2015-10-22 17:41:02 +08:00
Asias He
0d2fb9c99d storage_service: Add extract_expire_time 2015-10-22 17:41:02 +08:00
Asias He
58225216b3 storage_service: Fix immediate return for get_changed_ranges_for_leaving
It is a leftover when get_changed_ranges_for_leaving is get stubbed.
2015-10-22 17:41:02 +08:00
Asias He
fb27d682ad storage_service: Fix use after free for stream_plan
sp is a stack variable, it is gone when the function returns.
Fix it using a shared pointer.
2015-10-22 17:41:02 +08:00
Asias He
69b7028f84 storage_service: Fix token contains in handle_state_leaving
std::includes requires sorted container. get_tokens_for returns
std::unordered_set. Fix by put tokens into std::set.
2015-10-22 17:41:02 +08:00
Asias He
4785798904 storage_service: Kill unimplemented in decommission 2015-10-22 17:41:02 +08:00
Asias He
ce6dd0f8f8 storage_service: Implement start_leaving 2015-10-22 17:41:02 +08:00
Paweł Dziepak
513ab87b47 row_cache: update hit and miss stats in scanning reader
Signed-off-by: Paweł Dziepak <pdziepak@scylladb.com>
2015-10-22 12:25:02 +03:00
Paweł Dziepak
b1b830bcbb row_cache: merge cache_entry::compare and ring_position_compare
Signed-off-by: Paweł Dziepak <pdziepak@scylladb.com>
2015-10-22 12:25:02 +03:00
Tomasz Grabiec
f1306d3771 tests: Add tests for reversed mutation queries 2015-10-22 10:32:08 +02:00
Tomasz Grabiec
cc5cc7117d mutation_query: Respect 'reversed' partition_slice option
Fixes #480
2015-10-22 10:32:08 +02:00