Commit Graph

6539 Commits

Author SHA1 Message Date
Pekka Enberg
569efa2c4c dist/docker: ScyllaDB Docker image
Add a Dockerfile for building a ScyllaDB Docker image. The image is
based on Fedora 22 and ScyllaDB is installed from our RPM repository.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-09-22 00:22:01 +03:00
Takuya ASADA
83d05df9b7 dist: move ComboAMI related code to scylla-ami
Signed-off-by: Takuya ASADA <syuu@cloudius-systems.com>
2015-09-22 00:17:42 +03:00
Tomasz Grabiec
8085a04771 tests: Fix row_cache_alloc_stress
Since row_cache::populate() uses allocating_section now, the trick
with populating under relcaim lock no longer works, resulting in
assertion failure inside allocating_section:

row_cache_alloc_stress: utils/logalloc.hh:289: auto logalloc::allocating_section::operator()(logalloc::region&, Func&&) [with Func = row_cache::populate(const mutation&)::<lambda()>::<lambda()>]: Assertion `r.reclaiming_enabled()' failed.

Use the trick with populating until eviction is detected by comapring
region occupancy.
2015-09-21 23:01:52 +02:00
Shlomi Livne
0758117854 dist: remove conflicts with cassandra21 to allow side by side rpm installation
Signed-off-by: Shlomi Livne <shlomi@cloudius-systems.com>
2015-09-21 20:58:45 +02:00
Shlomi Livne
a2313bc7b6 dist: update ami base image id to one that supports enhanced networking
Signed-off-by: Shlomi Livne <shlomi@cloudius-systems.com>
2015-09-21 20:58:45 +02:00
Gleb Natapov
a15c062b5d transport: fix poller removal
During cql connection removal we wait for all outstanding sends to
complete by waiting for _ready_to_respond future to resolve, but if
at this point connection is in _pending_responders then poller my call
do_flush() and try to reuse same _ready_to_respond future that already has
a continuation attached to it. The fix is to remove connection from
the poller before waiting for _ready_to_respond. The special measures
should be taken to prevent the connection from been added to the poller
again, so we set _flush_requested to avoid exactly that.
2015-09-21 17:48:00 +02:00
Takuya ASADA
710442f9fa dist: Add CentOS packaging
Signed-off-by: Takuya ASADA <syuu@cloudius-systems.com>
2015-09-21 13:27:14 +03:00
Tomasz Grabiec
4712af2c21 row_cache: Use allocating_section in row_cache::populate()
Cache has a tendency to eat up all available memory. It is evicted
on-demand, but this happens at certain points in time (during large
allocation requests). Small allocations which are served from small
object pools won't usually trigger this. Large allocations happen for
example when LSA region needs a new segment, eg. when row cache is
populated. If large allocations happen for certain period only inside
row_cache::update(), then eviction will not be able to make forward
progress because cache's LSA region is locked inside
row_cache::update(). While it's locked, data can't be evicted from
it.

The solution is to use allocating_section.

Fixes #376.
2015-09-21 13:25:13 +03:00
Pekka Enberg
6cef7d8270 db/schema_tables: Fix calculate_schema_digest()
map_reduce() can run the reducer out-of-order which breaks the MD5 hash.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>

Fixes #357. [tgrabiec]
2015-09-21 11:51:17 +02:00
Nadav Har'El
1a4c8db71a scanning_reader: fix bug on still-being-written memtable
scanning_reader has a bug in its range support when it iterates over a
memtable which is still open, and thus might still be modified between
calls to the read function.

This caused, among other things, issue #368 - where repair was reading
a memtable which was still open and being written to (by a stream from a
a remote node).

The problem is that scanning_reader has an optimization so it can avoid
comparing the current partition with the range's end on every iteration:
It finds, once, a pointer to the element past the end of the range (the
so-called "upper bound"), and saves this pointer in _end. Then at every
iteration, we can just compare pointers.

But If partitions are added to the memtable, the _end we saved is no longer
relevant: It still points to a valid partition, but this partition which
was once the first partition *after* the range, may now be precedeed by
many new partitions, which may be now returned despite being after the
range's end.

The fix is to re-calculate "_end" if partitions were added to the memtable.
Moreover, we also need to re-calculate "_i" in this case - the current code
calculates in one iteration a pointer, _i, to the element to be returned in
the *next* iteration. If additional partitions were added in the meantime,
we may need to return them.

Because it's impossible to delete partitions from a memtable (just to
add new ones or modify existing ones), we can trivially figure out if
new partitions were added, using _memtable->partition_count(). Because
boost::intrusive::set defaults to constant_time_size(true), using this
count is efficient.

Fixes #368.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-09-20 15:08:08 +02:00
Avi Kivity
00299460f3 thrift: move connection closed error to logger, debug level 2015-09-20 15:48:45 +03:00
Avi Kivity
a87e591f5e Merge seastar upstream
* seastar 86ffe72...5c68145 (1):
  > reactor: add header to resolve FALLOC_FL_PUNCH_HOLE/FALLOC_FL_KEEP_SIZE on CentOS7
2015-09-20 13:15:33 +03:00
Takuya ASADA
f8ecd338b8 cql3: replace PRId32 with %d on sprint()
fixes #374

Signed-off-by: Takuya ASADA <syuu@cloudius-systems.com>
2015-09-20 13:15:24 +03:00
Nadav Har'El
6a655bc5a6 Fix typo in stream_init_message.hh
The debug build uncovered this typo. It was setting a class member with
itself (with an undefined value) instead from the parameter, which I was
surprised the compiler didn't catch at compile time.

Discovered in issue #368.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-09-20 11:42:50 +03:00
Gleb Natapov
6b300e517e rpm: set ulimits in systemd scylla config
According to https://bugzilla.redhat.com/show_bug.cgi?id=754285
limits.conf is ignored by systemd during service launch. Set limits
in systemd unit file instead.
2015-09-20 10:46:57 +03:00
Avi Kivity
afda54a083 Add the AGPL license 2015-09-20 10:45:35 +03:00
Avi Kivity
d5cf0fb2b1 Add license notices 2015-09-20 10:43:39 +03:00
Avi Kivity
9ff4cc8e7c configure.py: add copyright 2015-09-20 10:36:17 +03:00
Avi Kivity
bee1cf1352 consumer.hh: tidy up copyright 2015-09-20 10:35:41 +03:00
Avi Kivity
987294a412 Add missing copyrights 2015-09-20 10:16:11 +03:00
Asias He
eead846712 messaging_service: Make gossip use standalone tcp connection
For unknown reasons, I saw gossip syn message got rpc timeout erros when
the cluster is under heavy cassandra-strss stress.

Using a standalone tcp connection seems to fix the issue.
2015-09-19 10:17:42 +03:00
Shlomi Livne
4ba3580fa7 dist: aws ami install scylla-tools
Signed-off-by: Shlomi Livne <shlomi@cloudius-systems.com>
2015-09-19 10:16:33 +03:00
Avi Kivity
8f4eb7cc51 Merge "Fixes for building aws ami" from Shlomi 2015-09-19 10:15:42 +03:00
Raphael S. Carvalho
4d31e08299 conf: reenable partitioner in scylla.yaml
It's needed for compaction_delete_test dtest.
Otherwise, it will fail with:

Missing directive: partitioner
Fatal configuration error; unable to start. See log for stacktrace.

FAIL

======================================================================
FAIL: compaction_delete_test (compaction_test.TestCompaction_with_SizeTieredCompactionStrategy)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/urchin_world/urchin-dtest/compaction_test.py", line 50, in compaction_delete_test
    self.assertEqual(numfound, 10)
AssertionError: 0 != 10

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-09-19 10:04:05 +03:00
Avi Kivity
4c890fb207 Merge seastar upstream
* seastar 5ab7662...86ffe72 (1):
  > reactor: temporarily disable SO_REUSEPORT.
2015-09-19 09:28:15 +03:00
Avi Kivity
dcdc925b86 Revert "Commitlog: Pre-allocate "reserve" segments"
This reverts commit cbf3b63853, due to
reports of increased latency (instead of the opposite).
2015-09-19 09:26:39 +03:00
Avi Kivity
9dbe8ca1b5 row_cache: reduce cpu impact of memtable flush
Restrict the impact of flushing a memtable to row_cache to 20% of the
cpu.  This is accomplished by converting the code to a thread (with
bad indentation to improve patch readability) and using a thread
scheduling group.
2015-09-19 09:22:52 +03:00
Avi Kivity
93871e4392 tranport: more straightforward poller removal during connection close
Instead of calling do_flush(), just remove the connection from the poll
list directly.
2015-09-19 09:22:32 +03:00
Pekka Enberg
87d6ea940d transport/server: Improve "truncated frame" error message
Include expected size as well as frame length to improve debuggability.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-09-19 08:46:37 +03:00
Shlomi Livne
b820fa1e58 dist: aws ami workaround for packer throwing an error at build time
Using the base fedora22 image there are many updates - for an unknown
reason after doing all the rpm installs we are getting

    amazon-ebs:
    amazon-ebs: Complete!
    amazon-ebs: Failed to execute operation: Access denied
==> amazon-ebs: Terminating the source AWS instance...
==> amazon-ebs: No AMIs to cleanup
==> amazon-ebs: Deleting temporary keypair...
Build 'amazon-ebs' errored: Script exited with non-zero exit status: 1

The workaround is to create fedora22 image that already pulled the
updates

Signed-off-by: Shlomi Livne <shlomi@cloudius-systems.com>
2015-09-19 01:54:02 +03:00
Shlomi Livne
55dc4c2d83 dist: rpmbuild builds source rpm, mock builds binary rpm
- no need to create the binary rpm twice - we are using the mock version
- this is causing  issues on jenkins as we build rpms on it only via mock

Signed-off-by: Shlomi Livne <shlomi@cloudius-systems.com>
2015-09-19 01:53:59 +03:00
Shlomi Livne
18215e7a99 dist: fix a bug in ami build script
Need to copy the scylla-jmx.rpm into the ami build directory

Signed-off-by: Shlomi Livne <shlomi@cloudius-systems.com>
2015-09-19 01:48:53 +03:00
Avi Kivity
5f32c00f5f transport: fix removal of response batch poller when then connection terminates
We remove the poller too early; after _ready_to_respond becomes ready,
it is likely to have been inserted again.

Fix by moving it after _ready_to_respond.
2015-09-17 20:08:07 +02:00
Calle Wilund
cbf3b63853 Commitlog: Pre-allocate "reserve" segments
Refs #356

Pre-allocates N segments from timer task. N is "adaptive" in that it is
increased (to a max) every time segement acquisition is forced to allocate
a new instead of picking from pre-alloc (reserve) list. The idea is that it is
easier to adapt how many segments we consume per timer quanta than the timer
quanta itself.

Also does disk pressure check and flush from timer task now. Note that the
check is still only done max once every new segment.

Some logging cleanup/betterment also to make behaviour easier to trace.

Reserve segments start out at zero length, and are still deleted when finished.
This is because otherwise we'd still have to clear the file to be able to
properly parse it later (given that is can be a "half" file due to power fail
etc). This might need revisiting as well.

With this patch, there should be no case (except flush starvation) where
"add_mutation" actually waits for a (potentially) blocking op (disk).
Note that since the amount of reserve is increased as needed, there will
be occasional cases where a new segment is created in the alloc path
until the system finds equilebrium. But this should only be during a breif
warmup.
2015-09-17 19:54:28 +03:00
Shlomi Livne
536f557c22 dist: ami script will build jmx rpm if not available
v2
- add an error message if scylla-jmx is not checked out

Signed-off-by: Shlomi Livne <shlomi@cloudius-systems.com>
2015-09-17 18:21:15 +03:00
Avi Kivity
1719a8a43a Merge seastar upstream
* seastar 680f37d...5ab7662 (4):
  > reactor: replace "idle" metric by "load"
  > net::dpdk: workaround for a lack of RSS bits information.
  > rpc: wait for write buffer close during client destruction
  > rpc: remove unused future/promise
2015-09-17 18:19:44 +03:00
Avi Kivity
cc857c0e81 Merge "API: Adding functionaly to column family" from Amnon
"This series is part of a few serieses that adds functionality to column family
command and statistic."
2015-09-17 14:50:07 +03:00
Amnon Heiman
b91013957e API: Flush should wait before returning
This address issue #154

Flush command should wait for the commmand completion before returning.

This change replaces the for loop with a parallel_for_each, it will now
wait for all the flushes to complete before returning.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-09-17 14:48:51 +03:00
Avi Kivity
bad268c25e Update scylla-swagger-ui submodule name 2015-09-17 13:34:53 +03:00
Shlomi Livne
30d216e77e dist: fix generating archive with wrong file name for rpm
the tar file prefix needs to be only the version without the release
without this bug I get
.
.
.

Finish: build setup for scylla-server-0.8-20150917.2d99476.fc21.src.rpm
Start: rpmbuild scylla-server-0.8-20150917.2d99476.fc21.src.rpm
Building target platforms: x86_64
Building for target x86_64
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.fA7nBm
+ umask 022
+ cd /builddir/build/BUILD
+ cd /builddir/build/BUILD
+ rm -rf scylla-server-0.8
+ /usr/bin/tar -xf
/builddir/build/SOURCES/scylla-server-0.8-20150917.2d99476.tar
+ cd scylla-server-0.8
/var/tmp/rpm-tmp.fA7nBm: line 33: cd: scylla-server-0.8: No such file or
directory

RPM build errors:
error: Bad exit status from /var/tmp/rpm-tmp.fA7nBm (%prep)
    Bad exit status from /var/tmp/rpm-tmp.fA7nBm (%prep)
ERROR:
Exception(build/rpmbuild/SRPMS/scylla-server-0.8-20150917.2d99476.fc21.src.rpm)
Config(fedora-21-x86_64) 4 minutes 17 seconds

Signed-off-by: Shlomi Livne <shlomi@cloudius-systems.com>
2015-09-17 12:50:47 +03:00
Avi Kivity
c7a66b7ab2 Merge seastar upstream
* seastar dc5f2f5...680f37d (2):
  > reactor: reset inline continuation counter when starting a scheduler run
  > future: force inline more functions
2015-09-17 11:59:16 +03:00
Pekka Enberg
246df4e325 dist/redhat: Fix RPM package home page URL
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-09-17 11:51:29 +03:00
Asias He
0f5df4476c gossip: Make the timeout longer for gossip syn and echo message
When the cluster is under heavy load, the time to exchange a gossip
message might take longer than 1s. Let's make the timeout longer for now
before we can solve the large delay of gossip message issue.
2015-09-17 11:35:31 +03:00
Asias He
2d99476bb1 storage_service: Fix schedule_schema_pull
It might block for a very long time. Don't wait for it otherwise it will
block the whole gossip round.
2015-09-17 09:13:20 +03:00
Calle Wilund
ca0dac72b1 commitlog_test: fix test sync in test_commitlog_delete_when_over_disk_limit
Patch "Fix some timing/latency issues with sync" changed new_segment to
_not_ wait for flush to finish. This means that checking actual files on
disk in the test case might race.
Lucklily, we can more or less just check the segment list instead
(added recently-ish)
2015-09-16 20:38:59 +03:00
Calle Wilund
b512192b3b Commitlog: Fix some timing/latency issues with sync
Refs #356

* Move sync time setting to sync initiate to help prevent double syncs
* Change add_mutation to only do explicit sync with wait if time elapsed
  since last is 2x sync window
* Do not wait for sync when moving to new segment in alloc path
* Initiate _sync_time properly.
* Add some tracing log messages to help debug
2015-09-16 20:07:25 +03:00
Raphael S. Carvalho
461ecc55e3 sstable: fix race condition when deleting a partial sstable
Race condition happens when two or more shards will try to delete
the same partial sstable. So the problem doesn't affect scylla
when it boots with a single shard.
To fix this problem, shard 0 will be made the responsible for
deleting a partial sstable.

fixes #359.

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-09-16 19:58:44 +03:00
Tomasz Grabiec
6fa49e8fbc Merge tag 'avi/cql-batching/v2' from seastar-dev.git
From Avi:

We currently send out each cql transport response in its own packet, which
is very inefficient.

Use a poller to schedule responses to be flushed out, which allows multiple
responses to be sent out in one packet, reducing tcp stack overhead.

I see ~50% improvement with this on my desktop (single core).
2015-09-16 16:56:47 +02:00
Raphael S. Carvalho
8b6319702e compaction_manager: recreate gate when task is stopped
Otherwise, a gate_closed_exception would be triggered when
resuming the task.

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-09-16 17:54:43 +03:00
Avi Kivity
e3987eecd9 Merge seastar upstream
* seastar 8f8cfe9...dc5f2f5 (1):
  > core/reactor: Avoid idle time over-estimation
2015-09-16 17:40:33 +03:00