"Some of the system tables will set gc_grace_seconds, or default_time_to_live
but right now we are commenting them out.
The best way to do it would have been to somehow save the fields so we don't need to
set it all the time - as this function is effectively doing.
However, those fields would feel very spurious in the constructor, and it is not
like there isn't a lot of other things for us to set. More importantly, calling
those schema functions is a very rare event. We usually call it once and store
the pointer somewhere.
With that, we're very close to implementing everything that the system tables
needs set, missing only COMPACT STORAGE and information about compaction
strategy."
This patch adds a general assignment operator to the json_list object.
It can accept any data structure that support const range iteration and
that its contained object can be assigned to the json_list object.
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
We have been leaving all the setter functions in the schema_builder, which is
usually fine.
The system tables, however, are not built this way, which means we need set
properties needed by them in some other way.
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
We have been leaving all the setter functions in the schema_builder, which is
usually fine.
The system tables, however, are not built this way, which means we need set
properties needed by them in some other way.
Most properties are right there in the constructor, but I argue that this one
does not belong there.
Instead, provide a set method so that the system tables which need it can call.
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
The connection reset code posted an exception on the _data_received promise
to break a waiter (if any), but left the optional<promise<>> engaged. This
caused the connection destructor to attempt to post a new exception on the
same promise, which is not legal.
Fix by disengaging the optional promise, and give the same treatment to
_all_data_acked_promise.
"This series adds the storage proxy metrics API. The definition are based on the
StorageProxyMetrics definition. This series also adds stats object to the
storage_proxy a getter function for it and an implementation based on it, but
it is currently does not adds the code to manipulate the counters."
The function is currently just a simple wrapper over
storage_proxy::query(). The comment has description of details which
are much lower level than this interface.
sstring_view::data() can return a pointer to a string that isn't null
terminated.
Fixes#19.
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
This adds an implementation to the storage_service counters. The
implementation uses the stats object inside the storage_proxy.
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
A common scenario in the API is to get a sigle value from a distributed
object that has a get_stats method.
The helper function would get the object and a function that return a
single value from the stat object and would perform the map_reduce.
It would return a future that can be used as a return value from the
API.
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
The API needs to call the storage_proxy, for that a reference to the
distribute storage_proxy is added to the context and is set in main.
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
This adds a stat object with counters that will be used by the API. The
stat object instance will be return with a get_stats method.
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
query::range::serialized_size() calls a template method (also
called serialized_size()) within a lambda, however it is called with
a const 'this' while the template is non-const-qualified. gcc 5
rightly rejects it (nicely annotating the template as a near miss).
Fix by making the template static; it doesn't need 'this' anyway.
Right now when we initiate the database, we exist with just an exception if the
data directory does not exist. That does not tell much to the user about what
is going on.
It would be nice to at the very least catch the exception and turn it into a
user friendly message. But we can obviously do much better and create the
directory.
If we fail, then we can capture and tell the user why.
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
Often a single file is used in multiple fibers, and so it is wrapped in a
lw_shared_ptr. Remove the need for this by making files internally reference
counted.
Often, when we create a directory, it is useful to make sure that the path
leading to it exists.
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
This patch series adds partial implementation of ByteOrderedPartitioner
and allows choosing it in configuration file.
While ByteOrderedPartitioner is generally not recommended it is used by
some tests in DTEST due to its order guarantees.
We don't really handle expiration of entrie rows yet, due to issue #17.
Fixing a bug in 'insert' made this test start to fail because the
expired row started to appear in the results. Until #17 is fixed,
let's use 'update' to create the row, so that the expectations are
met.
Fixes#18.
The problem was that the row entry was not getting created for tables
without clustering key. The empty prefix was mistakenly taken as a
belonging to a static row.
"Node interface is:
storage_proxy::query_mutations_locally()
Shard interface is:
database::query_mutations()
Query results are returned in a form of reconcilable_result object, which
contains a vector of frozen_mutation."
This adds a stub implementation to the metrics of the storage proxy.
After this patch the following URL will be available:
/storage_service/metrics/cas_write/contention
/storage_service/metrics/cas_write/condition_not_met
/storage_service/metrics/cas_read/unfinished_commit
/storage_service/metrics/cas_read/contention
/storage_service/metrics/cas_read/condition_not_met
/storage_service/metrics/read/timeouts
/storage_service/metrics/read/unavailables
/storage_service/metrics/range/timeouts
/storage_service/metrics/range/unavailables
/storage_service/metrics/write/timeouts
/storage_service/metrics/write/unavailables
The implementation returns 0 for all queries.
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
This adds the storage definition to the storage proxy swagger definition
file.
It adds the definitions for the following command:
get_cas_write_metrics_unfinished_commit
get_cas_write_metrics_contention
get_cas_write_metrics_condition_not_met
get_cas_read_metrics_unfinished_commit
get_cas_read_metrics_contention
get_cas_read_metrics_condition_not_met
get_read_metrics_timeouts
get_read_metrics_unavailables
get_range_metrics_timeouts
get_range_metrics_unavailables
get_write_metrics_timeouts
get_write_metrics_unavailables
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
In Origin, partitions in range query results are ordered using
decorated_key ordering. This allows the use of token() function for
incremental iterating over results, as mentioned here:
http://www.datastax.com/dev/blog/client-side-improvements-in-cassandra-2-0
We may also need this to implement paging.
The old code didn't preserve ordering, because it didn't merge-sort
data coming from different shards. The fix relies on
query_mutations_locally(), which already preserves the ordering. We're
going to use mutation queries for range queries anyway.