Commit Graph

8374 Commits

Author SHA1 Message Date
Raphael S. Carvalho
ee84f310d9 move deletion of sstables generated by interrupted compaction
This deletion should be handled by sstables::compact_sstables, which
is the responsible for creation of new sstables.
It also simplifies the code.

Signed-off-by: Raphael S. Carvalho <raphaelsc@scylladb.com>
Message-Id: <541206be2e910ab4edb1500b098eb5ebf29c6509.1454110234.git.raphaelsc@scylladb.com>
2016-01-31 12:39:20 +02:00
Glauber Costa
7214649b8a sstables: const where const is due
Some SSTable methods are not marked as const. But they should be.

Signed-off-by: Glauber Costa <glauber@scylladb.com>
Message-Id: <72cd3ef0157eb38e7fd48d0c989f2342cbc42f3c.1454103008.git.glauber@scylladb.com>
2016-01-31 12:36:36 +02:00
Avi Kivity
3434b8e7c6 Merge seastar upstream
* seastar fbd9b30...6623379 (1):
  > fstream: improve make_file_input_stream() for a subrange of a file
2016-01-31 12:01:46 +02:00
Avi Kivity
a3fa123070 Update scylla-ami submodule
* dist/ami/files/scylla-ami e284bcd...b2724be (2):
  > Revert "Run scylla.yaml construction only once"
  > Move AMI dependent part of scylla_prepare to scylla-ami-setup.service
2016-01-31 12:01:15 +02:00
Avi Kivity
f08f5858a8 Merge "Introduce scylla-ami-setup.service, fix bugs" from Takuya
"This moves AMI dependent part of scylla_prepare to scylla-ami repo, make it scylla-ami-setup.service which is independent systemd unit.
Also, it stopped calling scylla_sysconfig_setup on scylla_setup (called on AMI creation time), call it from scylla-ami-setup instead."
2016-01-31 12:00:32 +02:00
Takuya ASADA
111dc19942 dist: construct scylla.yaml on first startup of AMI instance, not AMI image creation time
Install scylla-ami-setup.service, stop calling scylla_sysconfig_setup on AMI.
scylla-ami-setup.service will call it instead.
Only works with scylla-ami fix.
Fixes #857

Signed-off-by: Takuya ASADA <syuu@scylladb.com>
2016-01-30 15:48:45 -05:00
Takuya ASADA
71a26e1412 dist: don't need AMI_KEEP_VERSION anymore, since we fixed the issue that 'yum update' mistakenly replaces scylla development version with release version
It actually doesn't called unconditionally now, (since $LOCAL_PKG is always empty) so we can safely remove this.

Signed-off-by: Takuya ASADA <syuu@scylladb.com>
2016-01-30 15:47:05 -05:00
Takuya ASADA
f9d32346ef dist: scylla_sysconfig_setup uses current sysconfig values as default value
Signed-off-by: Takuya ASADA <syuu@scylladb.com>
2016-01-30 15:46:21 -05:00
Takuya ASADA
4d5baef3e3 dist: keep original SCYLLA_ARGS when updating sysconfig
Since we dropped scylla_run, now default SCYLLA_ARGS parameter is not empty.
So we need to support it.

Signed-off-by: Takuya ASADA <syuu@scylladb.com>
2016-01-30 15:44:03 -05:00
Avi Kivity
3e4ce609ee Merge seastar upstream
* seastar ec468ba...fbd9b30 (9):
  > Add implementation of count_leading_zeros<LL>
  > Fix htonl usage for clang
  > Fix gnutls_error_category ctor for clang
  > Add header files required for libc++
  > Add clang warning suppressions
  > Switch to correct usage of std::abs
  > Fix the do_marshall(sic) function to init_list
  > Corrected sockaddr_in initialization
  > Remove unused const char misc_strings
2016-01-28 18:24:46 +02:00
Raphael S. Carvalho
3b7970baff compaction: delete generated sstables in event of an interrupt
Generated sstables may imply either fully or partially written.
Compaction is interrupted if it was deriberately asked to stop (stop API)
or it was forced to do so in event of a failure, ex: out of disk space.
There is a need to explicitly delete sstables generated by a compaction
that was interrupted. Otherwise, such sstables will waste disk space and
even worsen read performance, which degrades as number of generations
to look at increases.

Fixes #852.

Signed-off-by: Raphael S. Carvalho <raphaelsc@scylladb.com>
Message-Id: <49212dbf485598ae839c8e174e28299f7127f63e.1453912119.git.raphaelsc@scylladb.com>
2016-01-28 14:05:57 +02:00
Pekka Enberg
3c3c819280 Merge "api: Fix stream_manager" from Asias
"Fix the metrics for bytes sent and received"
2016-01-28 13:57:59 +02:00
Raphael S. Carvalho
ba4260ea8f api: print proper compaction type
There are several compaction types, and we should print the correct
one when listing ongoing compaction. Currently, we only support
compaction types: COMPACTION and CLEANUP.

Signed-off-by: Raphael S. Carvalho <raphaelsc@scylladb.com>
Message-Id: <c96b1508a8216bf5405b1a0b0f8489d5cc4be844.1453851299.git.raphaelsc@scylladb.com>
2016-01-28 13:47:00 +02:00
Tomasz Grabiec
9fa62af96b database: Move implementation to .cc
Message-Id: <1453980679-27226-1-git-send-email-tgrabiec@scylladb.com>
2016-01-28 13:35:33 +02:00
Tomasz Grabiec
ca6bafbb56 canonical_mutation: Remove commented out junk 2016-01-28 12:29:20 +01:00
Tomasz Grabiec
41dc98bb79 Merge branch 'cleanup_improvements' from git@github.com:raphaelsc/scylla.git
Compaction cleanup improvements from Raphael.
2016-01-27 18:30:46 +01:00
Avi Kivity
873deb5808 Merge "move paging_state to use idl" from Gleb 2016-01-27 19:06:04 +02:00
Takuya ASADA
03caacaad0 dist: enable collectd client by default
Fixes #838

Signed-off-by: Takuya ASADA <syuu@scylladb.com>
Message-Id: <1453910311-24928-2-git-send-email-syuu@scylladb.com>
2016-01-27 18:45:45 +02:00
Takuya ASADA
f33656ef03 dist: eliminate startup script
Fixes #373

Signed-off-by: Takuya ASADA <syuu@scylladb.com>
Message-Id: <1453910311-24928-1-git-send-email-syuu@scylladb.com>
2016-01-27 18:45:35 +02:00
Gleb Natapov
b065e2003f Move paging_state to use idl 2016-01-27 18:39:43 +02:00
Raphael S. Carvalho
45c446d6eb compaction: pass dht::token by reference
Signed-off-by: Raphael S. Carvalho <raphaelsc@scylladb.com>
2016-01-27 13:25:41 -02:00
Raphael S. Carvalho
fc541e2f08 compaction: remove code to sort local ranges
storage_service::get_local_ranges returns sorted ranges, which are
not overlapping nor wrap-around. As a result, there is no need for
the consumer to do anything.

Signed-off-by: Raphael S. Carvalho <raphaelsc@scylladb.com>
2016-01-27 13:15:36 -02:00
Avi Kivity
c75d1c4eeb Merge "Ubuntu 'expect stop' related fixes" from Takuya 2016-01-27 17:00:23 +02:00
Gleb Natapov
65bd429a0b Add serialization helper to use outside of rpc. 2016-01-27 16:43:06 +02:00
Takuya ASADA
4162fb158c main: raise SIGSTOP only when scylla become ready
supervisor_notify() calls periodically, to log message on systemd.
So raise(SIGSTOP) will called multiple times, upstart doesn't expected that.
We need to call it just one time.

Fixes #846

Signed-off-by: Takuya ASADA <syuu@scylladb.com>
2016-01-27 23:30:26 +09:00
Takuya ASADA
851951d32d dist: run upstart job as 'scylla' user
Don't use sudo when launching scylla, run directly from upstart.

Signed-off-by: Takuya ASADA <syuu@scylladb.com>
2016-01-27 23:30:02 +09:00
Takuya ASADA
89f0fc89b4 dist: set ulimit in upstart job
Upstart job able to specify ulimit like systemd, so drop ubuntu's scylla_run and merge with redhat one.

Signed-off-by: Takuya ASADA <syuu@scylladb.com>
2016-01-27 23:29:52 +09:00
Takuya ASADA
b4accd8904 main: autodetect systemd/upstart
We can autodetect systemd/upstart by environment variables, don't need program argument.

Signed-off-by: Takuya ASADA <syuu@scylladb.com>
2016-01-27 23:29:32 +09:00
Takuya ASADA
559f913494 dist: use nightly for prebuilt 3rdparty packages (CentOS)
Developers probably wants to use latest dependency packages, so switch to nightly.

Signed-off-by: Takuya ASADA <syuu@scylladb.com>
Message-Id: <1453904521-2716-1-git-send-email-syuu@scylladb.com>
2016-01-27 16:24:49 +02:00
Gleb Natapov
19c55693fd idl: add missing header to serializer.hh 2016-01-27 15:49:29 +02:00
Amnon Heiman
7b53b99968 idl-compiler: split the idl list
Not all the idls are used by the messaging service, this patch removes
the auto-generated single include file that holds all the files and
replaes it with individual include of the generated fiels.
The patch does the following:
* It removes from the auto-generated inc file and clean the configure.py
  from it.
* It places an explicit include for each generated file in
  messaging_serivce.
* It add dependency of the generated code in the idl-compiler, so a
change in the compiler will trigger recreation of the generated files.

Signed-off-by: Amnon Heiman <amnon@scylladb.com>
Message-Id: <1453900241-13053-1-git-send-email-amnon@scylladb.com>
2016-01-27 15:23:00 +02:00
Pekka Enberg
86173fb8cc db/commitlog: Fix debug log format string in commitlog_replayer::recover()
I saw the following Boost format string related warning during commitlog
replay:

  INFO  [shard 0] commitlog_replayer - Replaying node3/commitlog/CommitLog-1-72057594289748293.log, node3/commitlog/CommitLog-1-90071992799230277.log, node3/commitlog/CommitLog-1-108086391308712261.log, node3/commitlog/CommitLog-1-251820357.log, node3/commitlog/CommitLog-1-54043195780266309.log, node3/commitlog/CommitLog-1-36028797270784325.log, node3/commitlog/CommitLog-1-126100789818194245.log, node3/commitlog/CommitLog-1-18014398761302341.log, node3/commitlog/CommitLog-1-126100789818194246.log, node3/commitlog/CommitLog-1-251820358.log, node3/commitlog/CommitLog-1-18014398761302342.log, node3/commitlog/CommitLog-1-36028797270784326.log, node3/commitlog/CommitLog-1-54043195780266310.log, node3/commitlog/CommitLog-1-72057594289748294.log, node3/commitlog/CommitLog-1-90071992799230278.log, node3/commitlog/CommitLog-1-108086391308712262.log
  WARN  [shard 0] commitlog_replayer - error replaying: boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::io::too_many_args> > (boost::too_many_args: format-string referred to less arguments than were passed)

While inspecting the code, I noticed that one of the error loggers is
missing an argument. As I don't know how the original failure triggered,
I wasn't able to verify that that was the only one, though.

Message-Id: <1453893301-23128-1-git-send-email-penberg@scylladb.com>
2016-01-27 13:40:19 +02:00
Pekka Enberg
c4dafe24f5 Update scylla-ami submodule
* dist/ami/files/scylla-ami 77cde04...e284bcd (2):
  > Run scylla.yaml construction only once
  > Revert "Run scylla.yaml construction only once"
2016-01-27 13:30:04 +02:00
Asias He
9fee1cc43a api: Use get_bytes_{received,sent} in stream_manager
The data in session_info is not correctly updated.

Tested while decommission a node:

$ curl -X GET  --silent --header "Accept: application/json"
"http://127.0.0.$i:10000/stream_manager/metrics/incoming";echo

$ curl -X GET --silent --header "Accept: application/json"
"http://127.0.0.$i:10000/stream_manager/metrics/outgoing";echo
2016-01-27 18:17:36 +08:00
Asias He
03aced39c4 streaming: Account number of bytes sent and received per session
The API will consume it soon.
2016-01-27 18:16:58 +08:00
Asias He
36829c4c87 api: Fix stream_manager total_incoming/outgoing bytes
Any stream, no matter initialized by us or initialized by a peer node,
can send and receive data. We should audit incoming/outgoing bytes in
the all streams.
2016-01-27 18:15:09 +08:00
Asias He
08f703ddf6 streaming: Add get_all_streams in stream_manager
Get all streams both initialized by us or initialized by peer node.
2016-01-27 18:15:09 +08:00
Tomasz Grabiec
c971544e83 bytes_ostream: Adapt to Output concept used in serializer.hh
Message-Id: <1453888242-2086-1-git-send-email-tgrabiec@scylladb.com>
2016-01-27 12:13:34 +02:00
Gleb Natapov
6a581bb8b6 messaging_service: replace rpc::type with boost::type
RPC moved to boost::type to make serializers less rpc centric. Scylla
should follow.

Message-Id: <20160126164450.GA11706@scylladb.com>
2016-01-27 11:57:45 +02:00
Gleb Natapov
6f6b231839 Make serializer use new simple stream location
Message-Id: <20160127093045.GG9236@scylladb.com>
2016-01-27 11:37:37 +02:00
Raphael S. Carvalho
d54c77d5d0 change abstract_replication_strategy::get_ranges to not return wrap-arounds
The main motivation behind this change is to make get_ranges() easier for
consumers to work with the returned ranges, e.g. binary search to find a
range in which a token is contained. In addition, a wrap-around range
introduces corner cases, so we should avoid it altogether.

Suppose that a node owns three tokens: -5, 6, 8

get_ranges() would return the following ranges:
(8, -5], (-5, 6], (6, 8]
get_ranges() will now return the following ranges:
(-inf, -5], (-5, 6], (6, 8], (8, +inf)

Signed-off-by: Raphael S. Carvalho <raphaelsc@scylladb.com>
Message-Id: <4bda1428d1ebbe7c8af25aa65119edc5b97bc2eb.1453827605.git.raphaelsc@scylladb.com>
2016-01-27 09:48:31 +01:00
Avi Kivity
b9ab28a0e6 Merge "storage_service: add drain on shutdown logic & fix" from Asias
"Fixes:
- storage_service::handle_state_removing() doesn't call drain() #825
https://github.com/scylladb/scylla/issues/825

- nodetool gossipinfo is out of sync #790
https://github.com/scylladb/scylla/issues/790"
2016-01-27 10:38:56 +02:00
Avi Kivity
1d7144ac14 Merge seastar upstream
* seastar bdb273a...ec468ba (1):
  > Move simple streams used for serialization into separate header
2016-01-27 10:38:09 +02:00
Amnon Heiman
fd94009d0e Fix API init process
The last patch of the API init process had a bug, that the wrong init
function was called.

This solve the issue.

Signed-off-by: Amnon Heiman <amnon@scylladb.com>
Message-Id: <1453879042-26926-1-git-send-email-amnon@scylladb.com>
2016-01-27 10:03:24 +02:00
Asias He
8b4275126d storage_service: Shutdown messaging_service in decommission
It is commented out.
2016-01-27 11:48:49 +08:00
Asias He
b2f2c1c28c storage_service: Add drain on shutdown logic
We register engine().at_exit() callbacks when we initialize the services. We
do not really call the callbacks at the moment due to #293.

It is pretty hard to see the whole picture in which order the services
are shutdown. Instead of for each services to register a at_exit()
callbacks, I proposal to have a single at_exit() callback which do the
shutdown for all the services. In cassandra, the shutdown work is done
in storage_service::drain_on_shutdown callbacks.

In this patch, the drain_on_shutdown is executed during shutdown.

As a result, the proper gossip shutdown is executed and fixes #790.

With this patch, when Ctrl-C on a node, it looks like:

INFO  [shard 0] storage_service - Drain on shutdown: starts
INFO  [shard 0] gossip - Announcing shutdown
INFO  [shard 0] storage_service - Node 127.0.0.1 state jump to normal
INFO  [shard 0] storage_service - Drain on shutdown: stop_gossiping done
INFO  [shard 0] storage_service - CQL server stopped
INFO  [shard 0] storage_service - Drain on shutdown: shutdown rpc and cql server done
INFO  [shard 0] storage_service - Drain on shutdown: shutdown messaging_service done
INFO  [shard 0] storage_service - Drain on shutdown: flush column_families done
INFO  [shard 0] storage_service - Drain on shutdown: shutdown commitlog done
INFO  [shard 0] storage_service - Drain on shutdown: done
2016-01-27 11:45:52 +08:00
Asias He
e733930dff storage_service: Call drain inside handle_state_removing
Now that drain is implemented, call it.

Fixes #825
2016-01-27 11:45:52 +08:00
Asias He
5003c6e78b config: Introduce shutdown_announce_in_ms option
Time a node waits after sending gossip shutdown message in milliseconds.

Reduces ./cql_query_test execution time

from
   real    2m24.272s
   user    0m8.339s
   sys     0m10.556s

to
   real    1m17.765s
   user    0m3.698s
   sys     0m11.578
2016-01-27 11:19:38 +08:00
Paweł Dziepak
490201fd1c row_cache: protect against stale entries
row_cache::update() does not explicitly invalidate the entries it failed
to update in case of a failure. This could lead to inconsistency between
row cache and sstables.

In paractice that's not a problem because before row_cache::update()
fails it will cause all entries in the cache to be invalidated during
memory reclaim, but it's better to be safe and explicitly remove entries
that should be updated but it was not possible to do so.

Signed-off-by: Paweł Dziepak <pdziepak@scylladb.com>
Message-Id: <1453829681-29239-1-git-send-email-pdziepak@scylladb.com>
2016-01-26 20:34:41 +01:00
Takuya ASADA
9b66d00115 dist: fix scylla_bootparam_setup for Ubuntu
Signed-off-by: Takuya ASADA <syuu@scylladb.com>
Message-Id: <1453836012-6436-1-git-send-email-syuu@scylladb.com>
2016-01-26 21:24:20 +02:00