Commit Graph

128 Commits

Author SHA1 Message Date
Avi Kivity
28bb65525b Merge "API updates for storage_service" from Asias
"Added APIs like get_release_version, get_operation_mode, is_gossip_running and
so on."
2015-08-27 11:40:48 +03:00
Avi Kivity
0fff367230 Merge "test for compaction metadata's ancestors" from Raphael 2015-08-27 11:07:53 +03:00
Asias He
7f741f90eb api/storage_service: Add join_ring
$ curl -X POST --header "Content-Type: application/json" --header "Accept:
application/json" "http://127.0.0.1:10000/storage_service/join_ring"
2015-08-26 06:51:47 +08:00
Asias He
9528f27201 api/storage_service: Add is_joined
$ curl -X GET --header "Accept: application/json"
"http://127.0.0.1:10000/storage_service/join_ring"

true
2015-08-26 06:51:47 +08:00
Asias He
a145787afc api/storage_service: Add stop_gossiping
$ curl -X DELETE --header "Accept: application/json"
"http://127.0.0.1:10000/storage_service/gossiping"
2015-08-26 06:51:47 +08:00
Asias He
67768c5e1b api/storage_service: Add start_gossiping
$ curl -X POST --header "Content-Type: application/json" --header "Accept:
application/json" "http://127.0.0.1:10000/storage_service/gossiping"

btw, the description looks incorrect:
   POST /storage_service/gossiping
   allows a user to recover a forcibly 'killed' node
2015-08-26 06:51:47 +08:00
Asias He
6b4f27dc84 api/storage_service: Add is_gossip_running
$ curl -X GET --header "Accept: application/json"
"http://127.0.0.1:10000/storage_service/gossiping"

true
2015-08-26 06:51:47 +08:00
Asias He
5d5016f8d1 api/storage_service: Add is_starting
$ curl -X GET --header "Accept: application/json"
"http://127.0.0.1:10000/storage_service/is_starting"

false
2015-08-26 06:51:47 +08:00
Asias He
28a3eef9e3 api/storage_service: Add get_operation_mode
$ curl -X GET --header "Accept: application/json"
"http://127.0.0.1:10000/storage_service/operation_mode"

"NORMAL"
2015-08-26 06:51:47 +08:00
Asias He
cafdb99d23 api/storage_service: Add get_schema_version
$ curl -X GET --header "Accept: application/json"
"http://127.0.0.1:10000/storage_service/schema_version"

"59adb24e-f3cd-3e02-97f0-5b395827453f"
2015-08-26 06:51:47 +08:00
Asias He
33db0995b9 api/storage_service: Add get_release_version
$ curl -X GET --header "Accept: application/json"
"http://127.0.0.1:10000/storage_service/release_version"

"2.1.8"
2015-08-26 06:51:47 +08:00
Amnon Heiman
c92bd9b121 API: Adding the ownership implmentation to storage_service
This adds the ownwership method implementation to the storage_service
API. After the patch the following url will be supported:

GET /storage_service/ownership/{keyspace}
GET /storage_service/ownership/

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-08-25 19:39:14 +03:00
Amnon Heiman
2c5716dac3 API: storage_service Add the swagger definition for ownership
This adds the API for get_effective_ownership and
get_ownership in storage_service.

It is based on the StorageServiceMBean definition.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-08-25 19:39:13 +03:00
Amnon Heiman
f55c168ae7 API: Add column family mean row size
This adds the column family mean row size in the per column family and
the total version. I uses the ratio_helper class to calculate the mean
over all the shrades.
2015-08-25 15:48:25 +03:00
Amnon Heiman
db30a588b2 API: Break the async repair into two operations
This distinguish between the async repair that starts the repair, that
will now be a POST request and the method that check on the command
progress that will now be a GET command.

After the change each operation would get the parameters that it needs.

The GET will return an enum based on the repair_status.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-08-25 15:45:30 +03:00
Tomasz Grabiec
4c030bb597 api: Fix return type for /lsa/compact 2015-08-25 15:29:10 +03:00
Glauber Costa
ca2d058520 api/column family: bloom filter file size
Export information about on-disk space used by bloom filters.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-08-24 20:14:31 -05:00
Glauber Costa
3dc135c380 api/column family: bloom filter ratios
Just like the simple statistics, but composed derived from them.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-08-24 20:14:28 -05:00
Glauber Costa
c094ba22c8 api/column family: bloom filter statistics
This patch uses the now existing infrastructure to expose statistics about the bloom
filters hit/miss rates.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-08-24 19:18:54 -05:00
Raphael S. Carvalho
c65af6e188 api: add get_unleveled_sstables to column family api
Adding to API function to return count of sstables in L0 if leveled
compaction strategy is enabled, 0 otherwise. Currently, we don't
support leveled compaction strategy, so function to return count of
sstables in L0 always return zero.

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-08-24 11:56:31 -03:00
Avi Kivity
0afbdf4aa7 Merge "Add row related methods to the cache_service API" from Amnon
"This series expose statistics from the row_cache in the cache_service API.
After this series the following methods will be available:
get_row_hits
get_row_requests
get_row_hit_rate
get_row_size
get_row_entries"
2015-08-23 15:46:07 +03:00
Amnon Heiman
47ce728572 API: Adding a stub implementation for the storage_service metrics
This adds a stub implementation for the storge service metrics. The
implementation returns the currect type with a stub value.
After this patch the following url will be available:
/storage_service/metrics/load
/storage_service/metrics/exceptions
/storage_service/metrics/hints_in_progress
/storage_service/metrics/total_hints

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-08-18 11:19:52 +03:00
Amnon Heiman
34e60faaca API: Adding the storage service metrics definition
This adds the storage service metrics that is based on the
StorageServiceMetrics class.
The following command where added:
get_metrics_load
get_exceptions
get_total_hints_in_progress
get_total_hints

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-08-18 11:19:51 +03:00
Amnon Heiman
cae3de162c API: Remove empty line from empty parameters list in
storage_service.json

Just for styling, empty parameters list will not include an empty line.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-08-18 11:19:51 +03:00
Amnon Heiman
a43b3badaf API: Add row related method to cache_service API
This adds the implementation for get_row_hits, get_row_requests,
get_row_hit_rate, row_enries, row_size and row_capacity

The implementation is based on the column-family map reduce

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-08-17 20:09:07 +03:00
Amnon Heiman
98a05c3bb9 API: Add the ratio_holder helper struct to ratio calculation
Some of the APIs need to return a ratio.

The ratio_holder struct is a helper class that counts the total and the
sub totat, it implements the json::jsonable virtual class with a
to_json method that return the ratio.

The main usage of the sturct is with a map-reduce method.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-08-17 19:42:23 +03:00
Amnon Heiman
be0f0e0f04 API: Expose the map_reduce_cf from column_family
Other API need to use the map_reduce_cf, so it is expose in the
column_family.hh.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-08-17 19:42:23 +03:00
Avi Kivity
608c0b8460 Merge "initial work on compaction manager API" from Rapahel 2015-08-17 17:24:13 +03:00
Avi Kivity
9f9f435e9a Merge "Adding snitch_name and update_snitch" from Amnon
"This adds the get_snitch_name and update_snitch functionality to the API. After
this series it would be possible to return the snitch name and to update the
snitch."
2015-08-16 19:34:41 +03:00
Avi Kivity
7a14bcd66e Merge "API: add get estimated row size histogram to column family" from Amnon
"This series cleans the streaming_histogram and the estimated histogram that
were importad from origin, it then uses it to get the estimated min and max row
estimation in the API."
2015-08-16 17:31:23 +03:00
Avi Kivity
eb09eddee5 Merge "Adding sampled histogram" from Amnon
"Histograms are used to collect latency information, in Origin, many of the
operations are timed, this is a potential performance issue. This series adds
an option to sample the operations, where small amount will be timed and the
most will only be counted.

This will give an estimation for the statistics, while keeping an accurate
count of the total events and have neglectible performance impact.

The first to use the modified histogram are the column family for their read
and write."

Conflicts:
	database.hh
2015-08-16 17:15:24 +03:00
Nadav Har'El
5a02eeaba9 v2: repair: track ongoing repairs
[in v2: 1. Fixed a few small bugs.
        2. Added rudementary support parallel/sequential repair.
	3. Verified that code works correctly with Asias's fix to streaming]

This patch adds the capability to track repair operations which we have
started, and check whether they are still running or completed (successfully
or unsuccessfully).

As before one starts a repair with the REST api:

   curl -X GET --header "Content-Type: application/json" --header "Accept: application/json" "http://127.0.0.1:10000/storage_service/repair_async/try1"

where "try1" is the name of the keyspace. This returns a repair id -
a small integer starting with 0. This patch adds support for similar
request to *query* the status of a previously started repair, by adding
the "id=..." option to the query, which enquires about the status of the
repair with this id: For example.,

    curl -i -X GET --header "Content-Type: application/json" --header "Accept: application/json" "http://127.0.0.1:10000/storage_service/repair_async/try1?id=0"

gets the current status of this repair 0. This status can be RUNNING,
SUCCESSFUL or FAILED, or a HTTP 400 "unknown repair id ..." in case an
invalid id is passed (not the id of any real repair that was previously
started).

This patch also adds two alternative code-paths in the main repair flow
do_repair_start(): One where each range is repaired one after another,
and one where all the ranges are repaired in parallel. At the moment, the
enabled code is the parallel version, just as before this patch. But the
will also be useful for implementing the "parallel" vs "sequential" repair
options of Cassandra.

Note that if you try to use repair, you are likely to run into a bug in
the streaming code which results in Scylla either crashing or a repair
hanging (never realising it finished). Asias already has a fix this this bug,
and will hopefully publish it soon, but it is unrelated to the repair code
so I think this patch can independently be committed.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-08-16 14:23:02 +03:00
Amnon Heiman
eee3094197 API: Add the get_snitch command
This adds the get_snitch_name command.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-08-16 12:15:38 +03:00
Amnon Heiman
524e0a00df API: Adding the update snitch API
The update snitch API reset the snitch with a new class.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-08-16 12:15:14 +03:00
Raphael S. Carvalho
43a876d745 api: implementing some ops of compaction manager api
Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-08-12 15:10:27 -03:00
Amnon Heiman
773106b90e API: add get estimated row size histogram to column family
This adds the implementation to in the API to the row size histogram.

It adds a map_cf method that perform a map operation over all column
family on the different shards.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-08-12 13:10:18 +03:00
Amnon Heiman
0ca7189664 API: Adding the estimated_histogram to the utils definition file
This adds the estimated_histogram to the utils definition file.

The estimated_histogram holds a list of buckets and a list of buckets
offsets.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-08-12 13:10:18 +03:00
Amnon Heiman
ae34ba32fa API: Adding min row and max row support to column_family
This adds the implementation for min and max row size in column family.

It uses the column family map redudce helper function with the addtional
function to get the min and max row size.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-08-12 13:10:18 +03:00
Amnon Heiman
ba5b1db618 API: Add a wrapper function for min and max
This helper function wraps the std min and max template for int64_t, it
makes it easier to pass them as a value in need.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-08-12 13:10:18 +03:00
Amnon Heiman
dab068dde9 API: modify column family API to use the histogram
With the change in column_family stats, the API needs to get the counter
from the read and write histogram.

It also adds the implementation for the read and write latency histogram.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-08-11 10:21:22 +03:00
Amnon Heiman
17ebebf268 API: When combining histogram, return zeroed histogram on empty
This change make sure that when there are no results (ie. all the
histogram that are summed are empty) the return result will be a zerroed
histogram and not an empty object.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-08-11 10:21:22 +03:00
Amnon Heiman
3ef36681cc API: Adding read, write latency histogram to column_family
This adds the latency histogram to the column_family swagger
definitions.
The definitions are based on the ColumnFamilyMetrics.
It adds the following commands:

get_read_latency_histogram
get_all_read_latency_histogram
get_write_latency_histogram
get_all_write_latency_histogram

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-08-11 10:21:22 +03:00
Raphael S. Carvalho
1e335006e7 api: add missing stats to column family api
addresses issue #84

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-08-10 12:31:38 +03:00
Tomasz Grabiec
e3592a4a04 api: lsa: Invoke compaction on all shards 2015-08-07 22:05:53 +02:00
Tomasz Grabiec
6ae0747fe5 lsa: Use size_t for sizes 2015-08-06 18:40:06 +02:00
Tomasz Grabiec
5d7500d648 api: lsa: Make logger static 2015-08-06 18:40:06 +02:00
Tomasz Grabiec
9a1ee1b96a api: Introduce RESTful API for LSA
To force compaction, invoke:

  $ curl -X POST http://localhost:10000/lsa/compact
2015-08-06 16:50:15 +02:00
Tomasz Grabiec
1046ee6e80 memtable: Remove all_partitions()
Preferred way to access the memtable is via reader.
2015-08-06 14:05:16 +02:00
Nadav Har'El
34b1cc42cd Initial repair support
This patch adds the beginning of node repair support. Repair is initiated
on a node using the REST API, for example to repair all the column families
in the "try1" keyspace, you can use:

curl -X GET --header "Content-Type: application/json" --header "Accept: application/json" "http://127.0.0.1:10000/storage_service/repair_async/try1"

I tested that the repair already works (exchanges mutations with all other
replicas, and successfully repairs them), so I think can be committed,
but will need more work to be completed

 1. Repair options are not yet supported (range repair, sequential/parallel
    repair, choice of hosts, datacenters and column families, etc.).

 2. *All* the data of the keyspace is exchanged - Merkle Trees (or an
    alternative optimization) and partial data exchange haven't been
    implemented yet.

 3. Full repair for nodes with multiple separate ranges is not yet
    implemented correctly. E.g., consider 10 nodes with vnodes and RF=2,
    so each vnode's range has a different host as a replica, so we need
    to exchange each key range separately with a different remote host.

 4. Our repair operation returns a numeric operation id (like Origin),
    but we don't yet provide any means to use this id to check on ongoing
    repairs like Origin allows.

 5. Error hangling, logging, etc., needs to be improved.

 6. SMP nodes (with multiple shards) should work correctly (thanks to
    Asias's latest patch for SMP mutation streaming) but haven't been
    tested.

 7. Incremental repair is not supported (see
    http://www.datastax.com/dev/blog/more-efficient-repairs)

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-08-05 13:26:36 +03:00
Amnon Heiman
cea73277ca API: Add read, write, and flush statistic to column_family
This adds the API implementation for the read, write, number of
panding flushes and memtable switch count.

The implementation uses a helper function to perform map and map_reduce
on column_family.

The get_uuid helper method now supports both colon notations (i.e.
either as a ":" or as %3A)

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-08-03 11:36:40 +03:00