Commit Graph

6365 Commits

Author SHA1 Message Date
Tomasz Grabiec
b2c2eb6cd2 tests: Add test exploiting flush while scanning issue 2015-09-09 10:38:43 +02:00
Tomasz Grabiec
b5845e96e5 tests: Fix liveness issue in mutation_test 2015-09-09 10:38:43 +02:00
Tomasz Grabiec
a0c180ef49 memtable: Fix flush in the middle of scanning bug
Fixes #309.

When scanning memtable readers detect is was flushed, which means that
it started to be moved to cache, they fall back to reading from
memtable's sstable.

Eventually what we should do is to combine memtable and cache contents
so that as long as data is not evicted we won't do IO. We do not
support scanning in cache yet though, so there is no point in doing
this now, and it is not trivial.
2015-09-09 10:17:35 +02:00
Tomasz Grabiec
e0d81351fe range: Introduce split_after() 2015-09-09 10:08:24 +02:00
Tomasz Grabiec
320ff132f8 sstables: Relax header dependencies 2015-09-09 10:07:43 +02:00
Tomasz Grabiec
61d9158c0d sstables/hyperloglog: Rename VERSION to version
This fixes a mysterious compilation problem which popped up after
changing header order. It could be that the name "VERSION" picks up
some macro, but I haven't really figured that exactly.
2015-09-09 10:07:07 +02:00
Calle Wilund
ee2a479731 CQL Test Env: Fixup for test shutdown errors caused by shutdown patch
Refs #293

Even more horrible that the shutdown patch. Tests using cql_test_env
are dependant on init.cc functions, but then scylla stopped being shut down
properly, those tests did to -> assert in sharded.hh

Yet another temp patch, simply duplicating the init.cc code for clq_test_env
to ensure we get what we think.
2015-09-09 10:15:11 +03:00
Avi Kivity
8405aa1c95 Merge "Add decimal type" from Paweł
"These patches add support for decimal type.

Fixes #146."
2015-09-08 19:03:37 +03:00
Paweł Dziepak
a791e230b9 types: drop outdated comments and disabled code
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-09-08 16:37:29 +02:00
Paweł Dziepak
e1d4acdcf6 tests/cql: add decimal type to all types test
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-09-08 16:37:24 +02:00
Paweł Dziepak
8cae940d07 tests/types: add tests for decimal type
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-09-08 16:04:48 +02:00
Paweł Dziepak
39c29a3fb4 types: add decimal type
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-09-08 16:04:48 +02:00
Paweł Dziepak
026ecdb50f utils: add big_decimal class
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-09-08 16:04:30 +02:00
Calle Wilund
d46a95242a Config: Fix type where alias destination was copied instead of referenced
Fixes #310

Missing '&'.
(And no, cannot make the type non-copyable, since we want to copy config
 objects).
2015-09-08 16:54:04 +03:00
Avi Kivity
1a90d8659f Merge "Shutdown workarounds" from Calle
"Refs #293

* Disables all normal service shutdowns.
* Calls "stop()" explicitly for database (which in turn will also flush
  commitlog etc). Then just does a hard "_exit".
* Add shutdown() + gate to commitlog to prevent data from being added once
  system shutdown is initiated. Will and does cause exceptions in write
  paths during shutdown.

This is an explicitly asked for workaround series for the interdependency
issues making shutdown as formulated by at_exit + sharded::stop unreliable
right now.
Proper ways of doing this would be to
a.) Make services actually stop service when asked to (stop())
b.) Do shutdown in two steps; stop() and later delete.

Note: I've left the old "at_exit" calls commented in main.cc/init.cc as a
reminder that this is not a final solution."
2015-09-08 15:27:31 +03:00
Tomasz Grabiec
3b7dfbcc85 Fix whitespace errors 2015-09-08 14:10:56 +02:00
Avi Kivity
c3b2623f12 sstables: filter: speed up bloom filter read/write
Bloom filter loading and saving is slow with single-bit access to the bitmap,
causing latency spikes of ~100ms for 20MB sstables.  Larger sstables will be
much worse.

Fix by using the newly introduced large_bitmap bulk load/save methods.  With
this, the maximum observed task latency was 16ms.

Fixes #299 (partially at least; larger bitmaps may require more work still).
2015-09-08 14:09:59 +02:00
Avi Kivity
d590e327c0 large_bitmap: support for loading and saving the bitmap to raw ints
Single-bit accessors are very slow, especially because we don't support
setting a bit to a value (just set to 1 and clear to 0).  This causes
loading and retrieving the contents of a bitmap to be painfully slow.

Fix by providing iterator-based load() and save() methods.  The methods
support partial load/save so that access to very large bitmaps can be
split over multiple tasks.
2015-09-08 14:09:59 +02:00
Tomasz Grabiec
b4835756fd tests: Fix compilation error
Introdued in 920fe4278a
2015-09-08 12:52:30 +02:00
Calle Wilund
1004e090f8 Database: Use commitlog::shutdown to help making shutdown more coherent
Should more or less mean that data in sstables + stuff in CL is the
actual DB state.
2015-09-08 11:55:21 +02:00
Calle Wilund
456246dfd5 Commitlog: Add a gate + shutdown method
* Gate ensures we don't add data into a segment after close
* Shutdown closes all segments for business and prohibits new segments
2015-09-08 11:53:41 +02:00
Calle Wilund
d666c747e3 Commitlog: Just add some more verbosity 2015-09-08 11:16:38 +02:00
Calle Wilund
945d2f73b3 Main: Do not actually stop any services on exit.
* Issue the "stop" method on DB (flushed CL + tables (partially))
* Do hard exit (_exit) to escape destructors and sanity checks.

This patch is horrible but sort of a workaround for various interdepdency
shutdown issues. Until services can actually be turned off, this might be
a viable option.

Refs #293. I will not call it a fix.
2015-09-08 11:13:34 +02:00
Tomasz Grabiec
d52853c4fe database: Restore indentation 2015-09-08 10:19:19 +02:00
Tomasz Grabiec
c623fbe1f7 database: Keep sstable as lw_shared_ptr<> from the beginning
Allows us to save on indentation, and we need it as shared anyway later.
2015-09-08 10:19:19 +02:00
Tomasz Grabiec
820a50a36e db: Move FIXME to a more appropriate place
From column_family's point of view, calling write_components() is all
it needs. The FIXME belongs more to an implementation of
write_components().
2015-09-08 10:19:19 +02:00
Tomasz Grabiec
ecf4841953 Fix typo in 'attempt' 2015-09-08 10:19:19 +02:00
Tomasz Grabiec
920fe4278a Cleanup leftovers after compaction_counter to reclaim_counter rename 2015-09-08 10:19:19 +02:00
Avi Kivity
a95d3f9cf5 Merge "Commitlog shutdown" from Calle
"Refs #293

* Add a commitlog::sync_all_segments, that explicitly forces all pending
  disk writes
* Only delete segments from disk IFF they are marked clean. Thus on partial
  shutdown or whatnot, even if CL is destroyed (destructor runs) disk files
  not yet clean visavi sstables are preserved and replayable
* Do a sync_all_segments first of all in database::stop.

Exactly what to not stop in main I leave up to others discretion, or at least
another patch."
2015-09-08 11:11:18 +03:00
Gleb Natapov
031f6e1aeb storage_proxy: do not capture storage_proxy reference in rpc callback
Callback may be called on different cpus so shared pointer cannot be
captured.
2015-09-08 09:55:23 +02:00
Tomasz Grabiec
a55c8375f9 Bump up seastar submodule HEAD
Changes:

  sharded: add local_shared() accessor
2015-09-08 09:55:13 +02:00
Gleb Natapov
a223c33278 storage_proxy: remove unused variable 2015-09-08 09:53:32 +02:00
Avi Kivity
86d33a90ac Merge "fixes on AMI support" from Takuya 2015-09-08 10:39:10 +03:00
Tomasz Grabiec
15ae1a92cb Merge branch 'pdziepak/compaction-remove-items/v4' from seastar-dev.git
From Pawel:

This series makes compaction remove items that are no longer items:
 - expired cells are changed into tombstones
 - items covered by higher level tombstones are removed
 - expired tombstones are removed if possible

Fixes #70.
Fixes #71.
2015-09-08 09:23:00 +02:00
Glauber Costa
2a7aa1f0d8 sstables: avoid asserts
It's great to have statistics, but assert is too big of a hammer. We don't need
to crash due to the lack of it, and can try our best to continue.

We currently have a problem (described in 265), in which we, for some reason,
fail to read the Statistics file. Throwing an exception will still cause us to
fail to boot, but at least it will be more informative.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-09-08 10:06:05 +03:00
Avi Kivity
e3e13878d1 Merge "Fix storage_service and gossip API" from Asias 2015-09-08 10:05:16 +03:00
Avi Kivity
6d0a2b5075 logalloc: don't invalidate merged region
A region being merged can still be in use; but after merging, compaction_lock
and the reclaim counter will no longer work.  This can lead to
use-after-compact-without-re-lookup errors.

Fix by making the source region be the same as the target region; they
will share compaction locks and reclaim counters, so lookup avoidance
will still work correctly.

Fixes #286.
2015-09-08 08:55:44 +02:00
Asias He
89f2959536 gossip: Rework stop() and shutdown()
Consolidate stop() and shutdown() into one function.

Fix crash:

scylla: urchin/seastar/core/future.hh:315: void
future_state<>::set(): Assertion `_u.st == state::future' failed.

=== stop gossip
$ curl -X DELETE --header "Accept: application/json"
"http://127.0.0.1:10000/storage_service/gossiping"

=== start gossip
$ curl -X POST --header "Content-Type: application/json" --header
"Accept: application/json"
"http://127.0.0.1:10000/storage_service/gossiping"
2015-09-08 12:20:53 +08:00
Asias He
247e9109d9 gossip: Introduce uninit_messaging_service_handler
It is useful in gossip shutdown process.
2015-09-08 12:19:06 +08:00
Asias He
312daed342 storage_service: Fix is_starting API
Query _operation_mode on CPU 0.

$ curl -X GET --header "Accept: application/json"
"http://127.0.0.1:10000/storage_service/is_starting"
2015-09-08 11:07:13 +08:00
Asias He
5e3d8a56b2 storage_service: Fix get_operation_mode API
Route request to CPU 0. _operation_mode is not replicated to other CPUS.

Without this:

$ curl -X GET --header "Accept: application/json"
"http://127.0.0.1:10000/storage_service/operation_mode"

returns "NORMAL" and "STARTING" randomly.
2015-09-08 10:55:50 +08:00
Asias He
0d88570286 storage_service: Fix is_gossip_running API and friends
Only cpu 0 instance of gossip has the correct information, route request
to cpu 0.

Fix a bug where

$ curl -X GET --header "Accept: application/json"
 "http://172.31.5.77:10000/storage_service/gossiping"

returns true and false randomly.
2015-09-08 10:45:25 +08:00
Takuya ASADA
27c325503d dist: configure rpc_address and seeds to local ip address
Signed-off-by: Takuya ASADA <syuu@cloudius-systems.com>
2015-09-07 22:53:28 +00:00
Takuya ASADA
96bfa9c326 dist: logging to syslog
Signed-off-by: Takuya ASADA <syuu@cloudius-systems.com>
2015-09-07 22:53:28 +00:00
Takuya ASADA
a49aee5083 dist: drop --datadir and --commitlog-directory, set /var/lib/scylla as default in scylla.yaml
Signed-off-by: Takuya ASADA <syuu@cloudius-systems.com>
2015-09-07 22:53:28 +00:00
Takuya ASADA
b97884286a dist: build rpms in build/ dir
Signed-off-by: Takuya ASADA <syuu@cloudius-systems.com>
2015-09-07 22:53:28 +00:00
Paweł Dziepak
b17f5c442f tests/sstable: uncomment part of compaction test
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-09-07 21:21:38 +02:00
Paweł Dziepak
e827a1a311 sstables: add compacting mutation reader
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-09-07 21:21:32 +02:00
Paweł Dziepak
a4a71932e1 sstables: make {max, min}_timestamp signed
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-09-07 21:20:32 +02:00
Paweł Dziepak
969fe6b878 sstables: make compact_sstables() take ref to column_family
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-09-07 21:20:32 +02:00