Commit Graph

53948 Commits

Author SHA1 Message Date
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
Amnon Heiman
31916e6b50 Add unimplemented exception to the API
Not all the API command are implemented it would be better that the user
would receive an error if it tries to call an unimplmeneted API call.

This adds an unimplemented_exception that would be thrown when an API
call is not implemented.

The unimplemented method, simply throws the exception.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-09-08 04:56:16 +03:00
Amnon Heiman
c29f53888d API: Take the API doc directory from configuration
The API doc directory will now be taken from configuration instead of
been hard coded.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-09-08 03:08:01 +03:00
Amnon Heiman
d2556787d8 main: Take the http configuration from the configuration object
This replaces the http configuration to use the general configuration
object instead of the command line argument. This will allow to
configure the API from configuration file and not just from the command
line.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-09-08 03:07:39 +03:00
Amnon Heiman
8be2ee54aa configuration: Add the API configuration to the general configuration
This adds the API configuration parameters to the configurtion, so it
will be possible to take them from the configuration file or from the
command line.

The following configuration were defined:
api_port
api_address
api_ui_dir
api_doc_dir

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-09-08 02:56:47 +03:00
Amnon Heiman
f4de60a71d API: Add doc directory parameter to the http context
Adding a parameter to the http context so it will not be hard coded and
could be configured.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-09-08 02:49:17 +03: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
Paweł Dziepak
5fa42d6b5f tests/sstables: construct schema using schema_builder
schema_builder is necessary to set gc_grace_period.

Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-09-07 21:20:32 +02:00
Paweł Dziepak
23d931780a mutation_partition: add empty()
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-09-07 21:20:32 +02:00
Paweł Dziepak
1e5ed89009 mutation_partition: add compact_for_compaction()
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-09-07 21:19:29 +02:00
Paweł Dziepak
f45aceb436 mutation_partition: purge tombstones in compact_and_expire()
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-09-07 21:18:45 +02:00
Paweł Dziepak
64949e8339 schema: make gc_grace_seconds() return gc_clock::duration
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-09-07 21:14:41 +02:00
Calle Wilund
6b81845041 Database: Do a commitlog::sync_all first on stop.
Refs #293
IFF one desires to _not_ shutdown stuff cleanly, still running this first
in database::stop will at least ensure that mutations already in CL transit
will end up on disk and be replayable
2015-09-07 20:32:04 +02:00
Calle Wilund
256c0550bf Commitlog: Only delete segments on disk if they are marked clean
For #293 - i.e. allow more or less coherent shutdown/destruction of the
commitlog while retaining disk data.
(tests still clear stuff explicitly).
2015-09-07 20:32:01 +02:00
Calle Wilund
4ed95b7020 Commitlog: Add sync_all_segments()
For #293 - allows explicit flush to disk (not close!) of all active segments
2015-09-07 20:31:59 +02:00
Calle Wilund
d614143f5e Commitlog/database: Fixup series "Commit log flush request on disk overflow"
Also at seastar-dev: calle/commitlog_flush_v3
(And, yes, this time I _did_ update the remote!)

Refs #262

Commit of original series was done on stale version (v2) due to authors
inability to multitask and update git repos.

v3:
* Removed future<> return value from callbacks. I.e. flush callback is now
  only fully syncronous over actual call
2015-09-07 21:29:19 +03:00
Gleb Natapov
0149a22f69 storage_proxy: use parallel_for_each in mutate() instead of semaphore
If several mutation in a batch throw exceptions have_cl.broken() will be
called more then once. Fix this by dropping ad hoc have_cl and use
parallel_for_each() that does the same thing that current code is doing.

Fixes #297
2015-09-07 19:29:34 +03:00
Tomasz Grabiec
52828c2e84 test.py: Do not run release-mode only tests if release mode not selected 2015-09-07 19:27:33 +03:00
Avi Kivity
dee9060b12 Merge "Commit log flush request on disk overflow" from Calle
"Fixes #262

Handles CL disk size exceeding configured max size by calling flush handlers
for each dirty CF id / high replay_position mark. (Instead of uncontrolled
delete as previously).

* Increased default max disk size to 8GB. Same as Origin/scylla.yaml (so no
   real change, but synced).
* Divide the max disk size by cpus (so sum of all shards == max)
* Abstract flush callbacks in CL
* Handler in DB that initiates memtable->sstable writes when called.

Note that the flush request is done "syncronously" in new_segment() (i.e.
when getting a new segment and crossing threshold). This is however more or
less congruent with Origin, which will do a request-sync in the corresponding
case.
Actual dealing with the request should at least in production code however be
done async, and in DB it is, i.e. we initiate sstable writes. Hopefully
they finish soon, and CL segments will be released (before next segment is
allocated).

If the flush request does _not_ eventually result in any CF:s becoming
clean and segments released we could potentially be issuing flushes
repeatedly, but never more often than on every new segment."
2015-09-07 18:46:48 +03:00
Tomasz Grabiec
fecc87e601 lsa: stub allocation_section with default allocator
memory::stats() always returns 0 as free memory which confuses
guard::enter().
2015-09-07 17:23:02 +02:00
Gleb Natapov
da242146b6 do not pass storage_proxy reference across cpus
storage_proxy instances are per cpu, so they cannot be passed around to
other cpus.
2015-09-07 17:16:29 +02:00
Paweł Dziepak
03f5827570 logalloc: add missing methods to DEFAULT_ALLOCATOR version
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-09-07 16:59:27 +02:00
Paweł Dziepak
ac602b13b5 tests: fix signed/unsigned comparison
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-09-07 16:41:00 +02:00
Avi Kivity
e37dfab853 Merge "Stability improvements" from Tomasz
"Fixes #259 and other problems found along the way."
2015-09-07 16:45:44 +03:00