Commit Graph

4359 Commits

Author SHA1 Message Date
Gleb Natapov
c81cf80d8a fix mutation forwarding for muti-DC setup
Forwarding lambda is reused, so we cannot move captures out of it
and we cannot pass references to them either since lambda can be
destroyed before send completes.
2015-07-02 15:30:21 +03:00
Nadav Har'El
53aa239865 sstables: remove some dead code
Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-07-02 12:13:22 +03:00
Tomasz Grabiec
a4d2946d20 Merge branch 'gleb/for_urchin' (read clustering) from seastar-dev.git
Read clustering from Gleb.
2015-07-01 13:31:02 +02:00
Gleb Natapov
4b9661c608 initial read clustering code
Works only if all replicas (participating in CL) has the same live
data. Does not detects mismatch in tombstones (no infrastructure yet).
Does not report timeout yet.
2015-07-01 13:36:30 +03:00
Gleb Natapov
730170ff1a serialize data structures needed for read clustering 2015-07-01 13:36:28 +03:00
Gleb Natapov
3d3d3a8627 implment query::result::digest() 2015-07-01 13:35:57 +03:00
Glauber Costa
0b0d0122fb thrift: create directory in the local shard only
The comment says the directory is created on the local shard only, but when
this code was converted, it ended up being moved inside the invoke_on_all lambda,
which means now it is called from all shards. Fix it by reorganizing the code.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-01 13:14:24 +03:00
Avi Kivity
e9c90060c4 Merge "Keyspace replication strategy options fixes" from Paweł
"These two patches fix handling of replication strategy options: maps are now
serialized and deserialized from json correctly and class name is not stored
together with other replication strategy options."
2015-07-01 13:12:19 +03:00
Avi Kivity
e6b88ae84a Merge "streaming updates" from Asias 2015-07-01 11:48:35 +03:00
Avi Kivity
1744caef70 Merge "serialization for streaming" from Asias 2015-07-01 11:12:30 +03:00
Paweł Dziepak
0a8c50bdf8 cql3: remove replication strategy class from replication options
The class name is stored separately and shouldn't be kept in the map
together with other options.

Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-06-30 18:44:24 +02:00
Paweł Dziepak
8565a22d33 json: fix (de)serialization of map
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-06-30 17:59:42 +02:00
Raphael S. Carvalho
c3372c36a2 sstables: keep track of compacted sstable's ancestors
In C*, every compacted sstable keeps track of its ancestors in the
statistics file. Supposedly, that info is used to discard sstable
files from ancestors which for some odd reason weren't deleted.

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-06-30 18:09:01 +03:00
Raphael S. Carvalho
8324ff990c sstables: add method add_generation
metadata_collector was made member of class sstable, such that the
compaction procedure will be able to use the method add_generation
from a sstable object.

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-06-30 18:09:01 +03:00
Nadav Har'El
c892228018 compaction: remove compacted sstables
After compaction, remove the source sstables. This cannot be done
immediately, as ongoing reads might be using them, so we mark the sstable
as "to be deleted", and when all references to this sstable are lost and
the object is destroy, we see this flag and delete the on-disk files.

This patch doesn't change the low-level compact_sstables() (which doesn't
mark its input sstables for deletion), but rather the higher-level example
"strategy" column_family::compact_all_sstables(). I thought we might want
to do this to allow in the future strategies that might only mark the input
sstables for deletion after doing perhaps other steps and to be sure it
doesn't want to abort the compaction and return to the old files. If we
decide this isn't needed, we can easily move the mark_for_deletion() call
to compact_sstables().

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-06-30 15:00:39 +03:00
Avi Kivity
d0589ef3cf Merge seastar upstream 2015-06-30 14:59:43 +03:00
Nadav Har'El
770e6b7816 future: add handle_exception() method
This patch adds a "class future" method for handling an exception result
of the future. It is impossible to discard a future's exception while passing
through the value of the result (what will we pass in the case of
exception?), so we discard the result as well.

An example of how this can be used, to log an error (but otherwise do
nothing) if removing a file fails:

  remove_file(filename).handle_exception(
    [] (std::exception_ptr eptr) {
      print("Exception when deleting file: %s", eptr);
    });

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-06-30 14:57:53 +03:00
Asias He
dec8bee44d streaming: Add stream_session::description 2015-06-30 17:12:37 +08:00
Asias He
1e5cfa89d1 streaming: Kill a FIXME in stream_session::plan_id 2015-06-30 17:08:45 +08:00
Asias He
7ec2ee6b86 streaming: Add stream_plan::listeners 2015-06-30 16:55:30 +08:00
Asias He
6f0994349a streaming: Add stream_plan::execute 2015-06-30 16:47:25 +08:00
Asias He
92dd0616fa streaming: Wire up stream_result_future in stream_session 2015-06-30 16:39:12 +08:00
Nadav Har'El
e88b7e3453 logging: conveniently log exception
This patch adds an output operator overload for std::exception_ptr, to
make it easy to log a caught exception. It always shows the exception's
exact type, and for some types of exceptions (subtypes of std::system_error
and std::exception) it prints more information.

For example, the code

  try {
    throw std::runtime_error("Hello world");
  } catch (...) {
    sstlog.warn("Exception: {}", std::current_exception());
  }

produces the output:
  Exception when deleting sstable file: std::runtime_error (Hello world)

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-06-30 11:23:01 +03:00
Asias He
212a70f42f streaming: Add constructor for stream_result_future 2015-06-30 16:08:53 +08:00
Asias He
60449c4b59 streaming: Convert StreamResultFuture to C++ 2015-06-30 16:00:56 +08:00
Asias He
ee1f4f022b streaming: Import StreamResultFuture.java 2015-06-30 15:48:21 +08:00
Asias He
abf24b3bfa streaming: Add flush_before_transfer to stream_plan 2015-06-30 15:38:18 +08:00
Asias He
878611beee streaming: Enable connect_all_stream_sessions 2015-06-30 15:25:53 +08:00
Asias He
fcecca89af streaming: Rename start to init_streaming_service
stream_session::start is used to start a session instead of
initialization on startup.
2015-06-30 15:07:19 +08:00
Asias He
e8156ca552 streaming: Implement serialize interface for file_message_header 2015-06-30 12:19:01 +08:00
Asias He
b35d29f91f streaming: Implement serialize interface for prepare_message 2015-06-30 11:43:29 +08:00
Asias He
3beb3e749d streaming: Implement serialize interface for stream_summary 2015-06-30 11:14:21 +08:00
Asias He
72394f3739 streaming: Implement serialize interface for stream_request 2015-06-30 11:07:04 +08:00
Asias He
237fedb1fc streaming: Implement serialize interface for received_message 2015-06-30 10:37:49 +08:00
Asias He
85ecd6b2f2 streaming: Implement serialize interface for retry_message 2015-06-30 10:33:13 +08:00
Asias He
8c67244a13 streaming: Implement serialize interface for stream_init_message 2015-06-30 10:33:13 +08:00
Asias He
c58829fa42 utils: Add serialize interface to UUID 2015-06-30 10:01:23 +08:00
Avi Kivity
5b00c72137 Merge "locator: network_topology_strategy" from Vlad
"This series aims to add the network_topology_strategy class.
It adds a few things that were missing in the token_metadata and
abstract_replication_strategy classes on the way:
   - Full topology (a.k.a. Topology) class implementation.
   - ring_range (a.k.a. TokenMetadata.ringIterator). The implementation
     is partial since we don't implement the "inclideMin" parameter.
   - endpoints caching in the abstract_replication_strategy.
   - Add-only Java's LinkedHashSet implementation - sequenced_set.

Then we add the network_topology_strategy class itself and the corresponding
unit test that validates the functionality of both the strategy class and of
the caching mechanism."

Conflicts:
	locator/token_metadata.hh
2015-06-29 18:54:40 +03:00
Avi Kivity
baed19b8ad Merge branch 'master' of github.com:cloudius-systems/urchin into db 2015-06-29 18:53:03 +03:00
Vlad Zolotarov
d1d8cae95e tests: network_topology_strategy_test
Unit test for NetworkTopologyStrategy class.
Creates a dummy cluster topology: token ring, token_metadata, snitch (RackInferringSnitch).
Then requests a natural endpoints for tokens that lay between each two adjacent ring tokens
and verifies the output.

It also checks the natural_endpoints caching:
   1) Verifies that the result is calculated when we query the specific token_ring point
      for the first time.
   2) Verifies that the result is taken from the cache when we query the specific token_ring
      point for the second time.
   3) Verifies that the results in (1) and (2) are identical.
   4) Verifies that the cache is invalidated after token_metadata::invalidate_cached_rings()
      is called.

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2015-06-29 18:50:55 +03:00
Vlad Zolotarov
9a6e6b4ae1 locator: added network_topology_strategy class
Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>

New in v2:
   - Use new location of a sequenced_set.
   - Indentation.
   - Use all caps in a FIXME word.
2015-06-29 18:50:49 +03:00
Vlad Zolotarov
5a19187802 locator: simple_strategy: use ring_range and sequenced_set in calculate_natural_endpoints()
Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>

New in v2:
   - Use new location of sequenced_set.
2015-06-29 18:45:09 +03:00
Vlad Zolotarov
a4041a81a3 locator: added a sequenced_set class
This class implements an add-only vector that ensures that the elements are
unique.
As long as items are only added this class does essentially the same what Java's
LinkedHashSet does.

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>

New in v2:
   - Moved sequenced_set to its own .hh file.
2015-06-29 18:44:19 +03:00
Vlad Zolotarov
310f4b6724 locator: abstract_replication_strategy: added a counter for natural endpoints cache hits
Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2015-06-29 18:43:58 +03:00
Vlad Zolotarov
d03122fdaf locator: abstract_replication_strategy: added natural endpoints caching
Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2015-06-29 18:43:58 +03:00
Vlad Zolotarov
314710b766 locator: abstract_replication_strategy: added replication_strategy_logger
Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2015-06-29 18:43:58 +03:00
Vlad Zolotarov
4b0cec624e locator: added abstract_replication_strategy::validate_replication_factor()
Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2015-06-29 18:43:58 +03:00
Vlad Zolotarov
f3dbdf758f locator: abstract_replication_strategy: Comment out an unused member
_keyspace back reference is not used at the moment.
Not deleting since we may need it when we add more code (quite soon).

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2015-06-29 18:43:58 +03:00
Vlad Zolotarov
214343036e locator: token_metadata: added ring_range() method
Returns an iterable range object to traverse the token ring

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>

New in v2:
   - Use boost::iterator_range instead of tokens_range class.
   - Make tokens_iterator inherit from std::iterator<std::input_iterator_tag, token>.
2015-06-29 18:43:45 +03:00
Avi Kivity
b27f93af97 Merge "Adding implementation to the storage_service" from Amnon
"The storage_service API contains many function, the actuall implementation will
be added gradually."
2015-06-29 14:57:45 +03:00