Commit Graph

41 Commits

Author SHA1 Message Date
Gleb Natapov
cf10416786 Implement new_read_repair_decision() function. 2015-08-23 15:26:48 +03:00
Gleb Natapov
0b3d2de2f1 Fix mutation write timeout exception reporting
Make it compatible with CQL specification
2015-08-12 14:58:48 +03:00
Calle Wilund
b7c7c97295 StorageProxy: implement mutate_atomically
Atomically == add to batch log before doing actual mutate
2015-08-11 17:10:17 +02:00
Tomasz Grabiec
51b3bf38bb storage_proxy: Introduce make_local_reader() 2015-08-03 15:21:40 +02:00
Tomasz Grabiec
19851fb8db storage_proxy: Move stop() implementation to source file 2015-08-03 11:52:23 +02:00
Tomasz Grabiec
c2664c0d46 storage_proxy: Add query logging on log_level::trace 2015-07-28 11:31:08 +02:00
Amnon Heiman
c317e61f6d Adding histogrms to storage_proxy
The storage proxy needs to collect statistics about read, write and
range. For that the ihistogram object was added to its stats object.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-07-26 10:57:40 +03:00
Gleb Natapov
98fae1a010 storage_proxy: handle read timeout 2015-07-22 13:44:46 +03:00
Pekka Enberg
d4d2e2fa0e service/storage_proxy: add get_storage_proxy() helpers
Make storage proxy a singleton and add helpers to look up a reference.
This makes it easier to convert code from Origin in areas such as
storage service.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-07-22 11:57:00 +03:00
Gleb Natapov
ed0faffd12 storage_proxy: beginning of read implementation for ranges queries 2015-07-15 12:41:38 +03:00
Avi Kivity
bfe9d21808 Merge "Adding the storage proxy metrics" from Amnon
"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."
2015-07-13 11:55:50 +03:00
Tomasz Grabiec
bc0874d299 db: Move storage_proxy::query_local() to db::system_keyspace::query() 2015-07-13 10:27:02 +02:00
Amnon Heiman
0eeef904d7 Storage proxy: Adding a stats object
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>
2015-07-12 22:59:32 +03:00
Tomasz Grabiec
e35854b33c storage_proxy: Preserve partition order in range queries
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.
2015-07-12 12:54:38 +02:00
Tomasz Grabiec
ad99e84505 storage_proxy: Take schema_ptr in query()
It will be needed for reconciliation.
2015-07-12 12:54:38 +02:00
Tomasz Grabiec
4931d3fdcd storage_proxy: Implement query_mutations_locally() 2015-07-12 12:54:38 +02:00
Calle Wilund
5919e824c7 storage_proxy: add query_local 2015-07-06 08:21:15 +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
97a4b0ee40 Store frozen_mutation in shared pointer while processing it
If local mutation write takes longer then write timeout mutation will
be deleted while it is processed by database engine. Fix this by storing
mutation in shared pointer and hold to the pointer until mutation is
locally processed.
2015-06-24 12:51:34 +03:00
Gleb Natapov
67ea1b0ec8 Revert "db: hold onto write response handler until timeout handler is executed"
This reverts commit 52aa0a3f91.

After c9909dd183 this is no longer needed since reference to a
handler is not used in abstract_write_response_handler::wait() continuation.

Conflicts:
	service/storage_proxy.cc
2015-06-23 15:43:59 +03:00
Gleb Natapov
52aa0a3f91 db: hold onto write response handler until timeout handler is executed
If last response comes after write timeout is triggered, but before
continuation, that suppose to handle it runs the handler can be removed
to earlier and be access from the continuation after deletion. Fix it by
making response handler to be shared pointer instead of unique and
holding to it in timeout continuation.
2015-06-21 13:09:43 +03:00
Gleb Natapov
a338407e29 make storage_proxy object distributed
storage_proxy holds per cpu state now to track clustering, so it has to
be distributed otherwise smp setup does not work.
2015-06-17 15:14:06 +02:00
Pekka Enberg
825588ed48 storage_proxy: Make clustering range configurable for query_local()
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-06-17 12:25:18 +03:00
Gleb Natapov
969134280a initial mutation clustering code 2015-06-15 12:53:10 +03:00
Gleb Natapov
fc6f6634fa support query of multiple singular ranges 2015-06-11 15:18:07 +03:00
Gleb Natapov
b7155ad862 pass partitions_ranges separately from from read_command
partitions_ranges will be manipulated upon to be split for different
destination, so provide it separately from read_command to not copy the
later for each destination.
2015-06-11 15:18:07 +03:00
Pekka Enberg
d3f9af7239 Make storage_proxy::query_local() return bare lw_shared_ptr<>
Don't return foreign_ptr<> which is not copyable so that we can use
map_difference for maps with result_set in them.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-05-12 13:18:56 +03:00
Tomasz Grabiec
4ab66de0ae db: Introduce frozen_mutation
The immediate motivation for introducing frozen_mutation is inability
to deserialize current "mutation" object, which needs schema reference
at the time it's constructed. It needs schema to initialize its
internal maps with proper key comparators, which depend on schema.

frozen_mutation is an immutable, compact form of a mutation. It
doesn't use complex in-memory strucutres, data is stored in a linear
buffer. In case of frozen_mutation schema needs to be supplied only at
the time mutation partition is visited. Therefore it can be trivially
deserialized without schema.
2015-05-08 09:19:01 +02:00
Pekka Enberg
dd8a08597f service: Add storage_proxy::query_local() helper
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-04-28 15:49:34 +03:00
Pekka Enberg
e2685f1fec service: add db accessor to storage proxy
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-04-27 10:38:48 +03:00
Tomasz Grabiec
5a7e3d3278 db: Order partitions by decorated_key
Partitions should be ordered using Origin's ordering, which is first
by token, then by Origin's representation of the key. That is the
natural ordering of decorated_key.

This also changes mutation class to hold decorated_key, to avoid
decoration overhead at different layers.
2015-04-24 18:01:01 +02:00
Tomasz Grabiec
00f99cefd4 db: split query.hh to reduce header dependencies 2015-04-15 20:44:59 +02:00
Gleb Natapov
47ac784425 replication strategy
This patch converts (for very small value of 'converts') some
replication related classes. Only static topology is supported (it is
created in keyspace::create_replication_strategy()). During mutation
no replication is done, since messaging service is not ready yet,
only endpoints are calculated.
2015-04-02 16:16:39 +02:00
Pekka Enberg
d20d835331 service: Add mutate_local() to storage proxy
Schema mutations are applied locally so add a mutate_local() function to
storage proxy.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-03-26 13:33:48 +02:00
Tomasz Grabiec
2f6d9a4113 db: Introduce query interface 2015-03-11 16:01:13 +01:00
Avi Kivity
70381a6da5 db: distribute database object
s/database/distributed<database>/ everywhere.

Use simple distribution rules: writes are broadcast, reads are local.
This causes tremendous data duplication, but will change soon.
2015-02-19 17:53:13 +02:00
Tomasz Grabiec
1b66f33455 db: Apply mutations locally from storage_proxy
Eventually we should rather send them to replicas, but for now we just
apply locally.
2015-02-09 10:28:44 +01:00
Tomasz Grabiec
9530a372cc cql3: Take reference to storage_proxy and call instance methods 2015-02-09 10:28:44 +01:00
Tomasz Grabiec
d5a7f37c45 db: Merge api.hh into database.hh 2015-02-09 10:28:44 +01:00
Tomasz Grabiec
800ba79efa db: Drop api:: namespace from mutation model classes
In preparation for merging into database.hh
2015-02-09 10:28:44 +01:00
Tomasz Grabiec
58677dc911 service: Convert StorageProxy 2015-01-29 19:40:58 +01:00