Commit Graph

6153 Commits

Author SHA1 Message Date
Asias He
d7736062ef storage_service: Stub drain
Needed by API.
2015-09-01 14:31:44 +08:00
Asias He
ea691397f6 storage_service: Stub remove_node
Needed by API.
2015-09-01 14:31:44 +08:00
Asias He
a1ab9e60b7 storage_service: Stub decommission
Needed by API.
2015-09-01 14:31:44 +08:00
Asias He
babefbc47b storage_service: Stub is_native_transport_running
Needed by API.
2015-09-01 14:31:43 +08:00
Asias He
5df469517b storage_service: Stub stop_native_transport
Needed by API.
2015-09-01 14:31:43 +08:00
Asias He
4e765b06ef storage_service: Stub start_native_transport
Needed by API.
2015-09-01 14:31:43 +08:00
Asias He
d7d4217387 storage_service: Stub is_rpc_server_running 2015-09-01 14:31:43 +08:00
Asias He
4481b93524 storage_service: Stub stop_rpc_server
Needed by API.
2015-09-01 14:31:43 +08:00
Asias He
36e3b62f8b storage_service: Stub start_rpc_server
Needed by API.
2015-09-01 14:31:43 +08:00
Asias He
305a8461e6 unimplemented: Add STORAGE_SERVICE 2015-09-01 14:31:43 +08:00
Calle Wilund
9ba84e458a Commitlog: Handle partial writes in segment::cycle
* Fixes #247
* Re-introduce test_allocation_failure, but allow for the "failure" to not
  happen. I.e. if run with low memory settings, the test will check that
  allocation failure is graceful. With lots of memory it will check partial
  write.
2015-08-31 20:02:05 +03:00
Avi Kivity
203b349722 Merge seastar upstream
* seastar 5176352...68fee6c (1):
  > Merge "Memory reclamation infrastructure follow-up" from Tomasz

Adjusted logalloc::tracker's reclaimer to fit new API
2015-08-31 20:01:07 +03:00
Avi Kivity
f6bba39473 Merge "Optimize row::map_type" from Paweł
"This series optimizes rows for cases when the number of cells is small.
Instead of storing cells always in an intrusive set which isn't cache
friendly and have big memory overhead either managed_vector is used
are used, provided that the cell count is below cetrain threshold.

Fixes #130.

Below are the results of perf_mutation and perf_simple_query, medians
of 20 results are used.

perf_mutation (-c 1):
before: 3216314.09 tps
after:  3375013.94 tps
diff: +4.93%

perf_simple_query (read):
before: 535327.27 tps
after:  541866.17 tps
diff +1.22%

perf_simple_query (write):
before: 707144.21 tps
after:  749960.52 tps
diff: +6.05%"
2015-08-31 19:48:32 +03:00
Avi Kivity
72db8bdcfe Merge seastar upstream
* seastar 9cc5cd0...5176352 (6):
  > fstream: fix reads when starting offset is nonzero
  > memory: Reclaim memory synchronously with allocation
  > fstream: disable read-ahead for now
  > input_stream: require explicit close() on end-of-use
  > reactor: add statistics for disk bandwidth
  > Merge read ahead
2015-08-31 19:41:48 +03:00
Avi Kivity
22f87e4252 sstables: avoid passing zero-sized buffers to make_file_input_stream
With new seastar, it crashes.
2015-08-31 19:40:59 +03:00
Paweł Dziepak
9ab44d6754 database: log row::max_vector_size and internal_count
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-31 17:29:16 +02:00
Paweł Dziepak
8d0419b621 managed_bytes: simplify empty()
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-31 17:29:16 +02:00
Paweł Dziepak
0343fddeb0 managed_bytes: simplify default constructor
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-31 17:29:16 +02:00
Paweł Dziepak
87481c3f53 mutation_partition: row: store cells either in vector or set
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-31 17:29:16 +02:00
Paweł Dziepak
78eb61b38e tests: add test for managed_vector
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-31 17:29:16 +02:00
Paweł Dziepak
956c27e021 utils: add LSA-aware vector capable of internal storage
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-31 17:29:13 +02:00
Paweł Dziepak
c8b8136941 atomic_cell_or_collection: add cast to bool
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-31 17:27:20 +02:00
Paweł Dziepak
4f58f12cac atomic_cell_or_collection: make default constructor public
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-31 17:27:20 +02:00
Paweł Dziepak
b90d7128d7 mutation_partition: drop row::begin() and end()
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-31 17:27:20 +02:00
Paweł Dziepak
25dfd70bc6 mutation_partition: use row::_cells directly in operator<<
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-31 17:27:20 +02:00
Paweł Dziepak
f7e5ea0436 mutation_partition: drop rows_equal()
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-31 17:27:20 +02:00
Paweł Dziepak
7a9cc916a3 mutation_partition: add row::operator==()
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-31 17:27:20 +02:00
Paweł Dziepak
3758a6d0a9 atomic_cell_or_collection: add operator==()
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-31 17:27:20 +02:00
Paweł Dziepak
f2c6c0164e mutation_partition: use remove_if() in row::compact_and_expire()
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-31 17:27:20 +02:00
Paweł Dziepak
0c575aec53 mutation_partition: add row::remove_if()
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-31 17:26:55 +02:00
Paweł Dziepak
e0d5ab1459 mutation_partition: use row::merge() in apply()
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-31 17:26:55 +02:00
Paweł Dziepak
899b0eacc6 mutation_partition: add merge()
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-31 17:26:40 +02:00
Paweł Dziepak
4246c6b47a mutation_partition: use for_each_cell() in has_any_live_data()
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-31 17:26:35 +02:00
Paweł Dziepak
4896307597 mutation_partition_serializer: use for_each_cell()
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-31 17:26:29 +02:00
Paweł Dziepak
ee6ae2264c sstables: use for_each_cell() to iterate through mutation partition
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-31 17:26:25 +02:00
Paweł Dziepak
55a8467ac8 mutation_partition: add for_each_cell()
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-31 17:26:09 +02:00
Paweł Dziepak
f1167a594a tests/cql_env: make sure that value views are correct
Query options need to have correct _value_views in order to
get_value_at() to work. With this patch we switch to constructor that
generates value views from the passed values and sets remaining options
to their default values.

Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-31 17:25:36 +02:00
Paweł Dziepak
4b9791230a tests/perf/simple_query: fix write mode
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-08-31 17:25:32 +02:00
Avi Kivity
349015a269 Merge "Fix migration manager logging" from Pekka
"Fix migration manager logging to output what origin does. Fixes #112."
2015-08-31 16:27:49 +03:00
Avi Kivity
f2a79aa7f6 Merge Prepare for closing sstables, part 1
Read-ahead will require that we close input_streams.  As part of that
we have to close sstables, and mutation_readers (which encapsulate
input_streams).  This is part 1 of a patchset series to do that.

(The overarching goal is to enable read-ahead for sstables, see #244)

Conflicts:
	sstables/compaction.cc
2015-08-31 16:15:18 +03:00
Avi Kivity
702de43ce3 Merge "Commit log replay" from Calle
"Initial implementation/transposition of commit log replay.

* Changes replay position to be shard aware
* Commit log segment ID:s now follow basically the same scheme as origin;
  max(previous ID, wall clock time in ms) + shard info (for us)
* SStables now use the DB definition of replay_position.
* Stores and propagates (compaction) flush replay positions in sstables
* If CL segments are left over from a previous run, they, and existing
  sstables are inspected for high water mark, and then replayed from
  those marks to amend mutations potentially lost in a crash
* Note that CPU count change is "handled" in so much that shard matching is
  per _previous_ runs shards, not current.

Known limitations:
* Mutations deserialized from old CL segments are _not_ fully validated
  against existing schemas.
* System::truncated_at (not currently used) does not handle sharding afaik,
  so watermark ID:s coming from there are dubious.
* Mutations that fail to apply (invalid, broken) are not placed in blob files
  like origin. Partly because I am lazy, but also partly because our serial
  format differs, and we currently have no tools to do anything useful with it
* No replay filtering (Origin allows a system property to designate a filter
  file, detailing which keyspace/cf:s to replay). Partly because we have no
  system properties.

There is no unit test for the commit log replayer (yet).
Because I could not really come up with a good one given the test
infrastructure that exists (tricky to kill stuff just "right").
The functionality is verified by manual testing, i.e. running scylla,
building up data (cassandra-stress), kill -9 + restart.
This of course does not really fully validate whether the resulting DB is
100% valid compared to the one at k-9, but at least it verified that replay
took place, and mutations where applied.
(Note that origin also lacks validity testing)"

Fixes #98.
2015-08-31 15:58:12 +03:00
Avi Kivity
7090dffe91 mutation_reader: switch to a class based implementation
Using a lambda for implementing a mutation_reader is nifty, but does not
allow us to add methods.

Switch to a class-based implementation in anticipation of adding a close()
method.
2015-08-31 15:53:53 +03:00
Avi Kivity
a9b56133d6 sstables: close input_streams opened in random_access_reader
Read-ahead requires input_streams to be closed, so add a close() method
to random_access_reader() and use it.

We don't yet call actually input_stream::close(), because that is not yet
merged; this patch lays the groundwork.
2015-08-31 15:53:02 +03:00
Avi Kivity
6e4b9b57ca sstables: remove unused class shared_file_random_access_reader 2015-08-31 15:53:02 +03:00
Calle Wilund
1ba655d905 Main: Do commit log replay at startup 2015-08-31 14:29:51 +02:00
Calle Wilund
d3a01072af CommitLogReplayer: Java -> C++
Initial implementation
2015-08-31 14:29:50 +02:00
Calle Wilund
987454d012 Database: Add "flush_all_memtables" 2015-08-31 14:29:50 +02:00
Calle Wilund
a349fbe1e6 Compaction: propagate metadata replay position from compacted tables 2015-08-31 14:29:49 +02:00
Calle Wilund
c0018f85e9 SStables: put memtable replay_position in metadata on write 2015-08-31 14:29:49 +02:00
Calle Wilund
bbf82e80d0 Commitlog: Allow skipping X bytes in commit log reader
Also refactor reader into named methods for debugging sanity.
2015-08-31 14:29:49 +02:00