Commit Graph

7891 Commits

Author SHA1 Message Date
Benoît Canet
7b5df973fa config: Mark ssl_storage_port as Used
Signed-off-by: Benoît Canet <benoit@scylladb.com>
Message-Id: <1452082041-6117-1-git-send-email-benoit@scylladb.com>
2016-01-06 20:20:59 +02:00
Pekka Enberg
c33815211f release: prepare for 0.15 2016-01-06 12:16:58 +02:00
Benoît Canet
e80c8b6130 config: Mark previously unused SSL client/server options as used
The previous SSL enablement patches do make uses of these
options but they are still marked as Unused.
Change this and also update the db/config.hh documentation
accordingly.

Syntax is now:

client_encryption_options:
   enabled: true
   certificate: <path-to-PEM-x509-cert> (default conf/scylla.crt)
   keyfile: <path-to-PEM-x509-key> (default conf/scylla.key)

Fixes: #756.

Signed-off-by: Benoît Canet <benoit@scylladb.com>
Message-Id: <1452032073-6933-1-git-send-email-benoit@scylladb.com>
2016-01-06 10:32:53 +02:00
Tomasz Grabiec
9d71e4a7eb Merge branch 'fix_to_issue_676_v4' from git@github.com:raphaelsc/scylla.git
Compaction fixes from Raphael:

There were two problems causing issue 676:
1) max_purgeable was being miscalculated (fixed by b7d36af).
2) empty row not being removed by mutation_partition::do_compact
Testcase is added to make sure that a tombstone will be purged under
certain conditions.
2016-01-05 15:19:22 +01:00
Raphael S. Carvalho
a81b660c0d tests: check that tombstone is purged under certain conditions
Signed-off-by: Raphael S. Carvalho <raphaelsc@scylladb.com>
2016-01-05 15:19:21 +01:00
Raphael S. Carvalho
03eee06784 remove empty rows in mutation_partition::do_compact
do_compact() wasn't removing an empty row that is covered by a
tombstone. As a result, an empty partition could be written to a
sstable. To solve this problem, let's make trim_rows remove a
row that is considered to be empty. A row is empty if it has no
tombstone, no marker and no cells.

Signed-off-by: Raphael S. Carvalho <raphaelsc@scylladb.com>
2016-01-05 15:19:21 +01:00
Pekka Enberg
800ed6376a Merge "Repair overhaul" from Nadav
"This is another version of the repair overhaul, to avoid streaming *all* the
 data between nodes by sending checksums of token ranges and only streaming
 ranges which contain differing data."
2016-01-05 16:05:44 +02:00
Pekka Enberg
f4bdec4d09 Merge "Support for deleting all snapshots" from Vlad
"Add support for deleting all snapshots of all keyspaces."

Fixes #639.
2016-01-05 15:42:44 +02:00
Nadav Har'El
f90e1c1548 repair: support "hosts" and "dataCenters" parameters
Support the "hosts" and "dataCenters" parameters of repair. The first
specifies the known good hosts to repair this host from (plus this host),
and the second asks to restrict the repair to the local data center (you
must issue the repair to a node in the data center you want to repair -
issuing the command to a data center other than the named one returns
an error).

For example these options are used by nodetool commands like:
nodetool repair -hosts 127.0.0.1,127.0.0.2 keyspace
nodetool repair -dc datacenter1

Signed-off-by: Nadav Har'El <nyh@scylladb.com>
2016-01-05 15:38:40 +02:00
Nadav Har'El
ac4e86d861 repair: use repair_checksum_range
The existing repair code always streamed the entire content of the
database. In this overhaul, we send "repair_checksum_range" messages to
the other nodes to verify whether they have exactly the same data as
this node, and if they do, we avoid streaming the identical code.

We make an attempt to split the token ranges up to contain an estimated
100 keys each, and send these ranges' checksums. Future versions of this
code will need to improve this estimation (and make this "100" a parameter)

Signed-off-by: Nadav Har'El <nyh@scylladb.com>
2016-01-05 15:38:40 +02:00
Nadav Har'El
9e65ecf983 repair: convenience function for syncing a range
This patch adds a function sync_range() for synchronizing all partitions
in a given token range between a set of replicas (this node and a list of
neighbors).
Repair will call this function once it has decided that the data the
replicas hold in this range is not identical.

The implementation streams all the data in the given range, from each of
the neighbors to this node - so now this node contains the most up-to-date
data. It then streams the resulting data back to all the neighbors.

Signed-off-by: Nadav Har'El <nyh@scylladb.com>
2016-01-05 15:38:40 +02:00
Nadav Har'El
f5b2135a80 repair: repair_checksum_range message
This patch adds a new type of message, "REPAIR_CHECKSUM_RANGE" to scylla's
"messaging_service" RPC mechanism, for the use of repair:

With this message the repair's master host tells a slave host to calculate
the checksum of a column-family's partitions in a given token range, and
return that checksum.

The implementation of this message uses the checksum_range() function
defined in the previous patch.

Signed-off-by: Nadav Har'El <nyh@scylladb.com>
2016-01-05 15:38:40 +02:00
Nadav Har'El
e9d266a189 repair: checksum of partitions in range
This patch adds functions for calculating the checksum of all the
partitions in a given token range in the given column-family - either
in the current shard, or across all shards in this node.

Signed-off-by: Nadav Har'El <nyh@scylladb.com>
2016-01-05 15:38:40 +02:00
Nadav Har'El
0591fa7089 repair: partition-set checksum
This patch adds a mechanism for calculating a checksum for a set of
partitions. The repair process will use these checksums to compare the
data held by different replicas.

We use a strong checksum (SHA-256) for each individual partition in the set,
and then a simple XOR of those checksums to produce a checksum for the
entire set. XOR is good enough for merging strong checksums, and allows us
to independently calculate the checksums of different subsets of the
original sets - e.g., each shard can calculate its own checksum and we
can XOR the resulting checksums to get the final checksum.

Apache Cassandra uses a very similar checksum scheme, also using SHA-256
and XOR. One small difference in the implementation is that we include the
partition key in its checksum, while Cassandra don't, which I believe to
have no real justification (although it is very unlikely to cause problems
in practice). See further discussion on this in
https://issues.apache.org/jira/browse/CASSANDRA-10728.

Signed-off-by: Nadav Har'El <nyh@scylladb.com>
2016-01-05 15:38:40 +02:00
Nadav Har'El
faa87b31a8 fix to_partition_range() inclusiveness
A cut-and-paste accident in query::to_partition_range caused the wrong
end's inclusiveness to be tested.

Signed-off-by: Nadav Har'El <nyh@scylladb.com>
2016-01-05 15:38:40 +02:00
Shlomi Livne
846bf9644e dist/redhat: Increase scylla-server service start timeout to 15 min
Fixes #749

Signed-off-by: Shlomi Livne <shlomi@scylladb.com>
2016-01-05 15:30:22 +02:00
Pekka Enberg
67ccd05bbe api/storage_service: Wire up 'compaction_throughput_mb_per_sec'
The API is needed by nodetool compactionstats command.
2016-01-05 13:01:05 +02:00
Pekka Enberg
5db82aa815 Merge "Fix frozen collections" from Paweł
"This series prevents frozen collections from appearing in the schema
comparator.

Fixes #579."
2016-01-05 12:43:06 +02:00
Paweł Dziepak
284162c41b test/cql3: add test for frozen collections
Signed-off-by: Paweł Dziepak <pdziepak@scylladb.com>
2016-01-05 11:13:53 +01:00
Paweł Dziepak
a5a744655e schema: do not add frozen collections to compound name
Signed-off-by: Paweł Dziepak <pdziepak@scylladb.com>
2016-01-05 10:49:32 +01:00
Paweł Dziepak
ed7d9d4996 schema: change has_collections() to has_multi_column_collections()
All users of schema::has_collections() aren't really interested in
frozen ones.

Signed-off-by: Paweł Dziepak <pdziepak@scylladb.com>
2016-01-05 10:46:42 +01:00
Tomasz Grabiec
fecb1c92e7 Merge branch 'pdziepak/prepare-for-alter-table/v1' from seastar-dev.git 2016-01-05 10:30:46 +01:00
Paweł Dziepak
70f5ed6c64 cql3: enable ALTER TABLE in cql3 grammar definition
Signed-off-by: Paweł Dziepak <pdziepak@scylladb.com>
2016-01-05 09:49:04 +01:00
Paweł Dziepak
3ca4e27dba cql3: convert alter_table_statement to c++
Everything except alter_table_statement::announce_migration() is
translated. announce_migration() has to wait for multi schema support to
be merged.

Signed-off-by: Paweł Dziepak <pdziepak@scylladb.com>
2016-01-05 09:49:04 +01:00
Paweł Dziepak
35edda76c4 cql3: import AlterTableStatement.java
Signed-off-by: Paweł Dziepak <pdziepak@scylladb.com>
2016-01-05 09:49:04 +01:00
Paweł Dziepak
b615bfa47e cql3: add cf_prop_defs::get_default_time_to_live()
Signed-off-by: Paweł Dziepak <pdziepak@scylladb.com>
2016-01-05 09:49:04 +01:00
Paweł Dziepak
18747b21f2 map_difference: accept std::unordered_map
map_difference implementation doesn't need elements in the container to
be sorted.

Signed-off-by: Paweł Dziepak <pdziepak@scylladb.com>
2016-01-05 09:49:04 +01:00
Tomasz Grabiec
71d6e73ae3 map_difference: Define default value for key_comp 2016-01-05 09:49:04 +01:00
Paweł Dziepak
3693e77eec schema: add is_cql3_table()
Signed-off-by: Paweł Dziepak <pdziepak@scylladb.com>
2016-01-05 09:49:04 +01:00
Paweł Dziepak
4bd031d885 schema: add column_definition::is_part_of_cell_name()
Signed-off-by: Paweł Dziepak <pdziepak@scylladb.com>
2016-01-05 09:49:04 +01:00
Paweł Dziepak
f39f21ce02 schema: add column_definition::is_indexed()
Signed-off-by: Paweł Dziepak <pdziepak@scylladb.com>
2016-01-05 09:49:04 +01:00
Glauber Costa
74fbd8fac0 do not call open_file_dma directly
We have an API that wraps open_file_dma which we use in some places, but in
many other places we call the reactor version directly.

This patch changes the latter to match the former. It will have the added benefit
of allowing us to make easier changes to these interfaces if needed.

Signed-off-by: Glauber Costa <glauber@scylladb.com>
Message-Id: <29296e4ec6f5e84361992028fe3f27adc569f139.1451950408.git.glauber@scylladb.com>
2016-01-05 10:37:57 +02:00
Avi Kivity
e9400dfa96 Revert "sstable: Initialize super class of malformed_sstable_exception"
This reverts commit d69dc32c92d63057edf9f84aa57ca53b2a6e37e4; it does nothing
and does not address issue #669.
2016-01-05 10:21:00 +02:00
Benoît Canet
d69dc32c92 sstable: Initialize super class of malformed_sstable_exception
This exception was not caught properly as a std::exception
by report_failed_future call to report_exception because the
superclass std::exception was not initialized.

Fixes #669.

Signed-off-by: Benoît Canet <benoit@scylladb.com>
2016-01-05 09:54:36 +02:00
Lucas Meneghel Rodrigues
8ef9a60c09 dist/common/scripts/scylla_prepare: Change message to error
Recently, Scylla was changed to mandate the use of XFS
for its data directories, unless the flag --developer-mode true
is provided. So during the AMI setup stage, if the user
did not provide extra disks for the setup scripts to prepare,
the scylla service will refuse to start. Therefore, the
message in scylla_prepare has to be changed to an actual
error message, and the file name, to be changed to
something that reflects the event that happened.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@scylladb.com>
2016-01-05 09:23:57 +02:00
Tomasz Grabiec
cc6c35d45c Move seastar submodule head
Avi Kivity (1):
      Merge "rpc negotiation fixes" from Gleb

Gleb Natapov (3):
      rpc: fix peer address printing during logging
      rpc: make server send negotiation frame back before closing connection on error
      rpc: fix documentation for negotiation procedure.

Nadav Har'El (1):
      fix operator<<() for std::vector<T>

Tomasz Grabiec (1):
      core/byteorder: Add missing include
2016-01-04 15:07:21 +01:00
Shlomi Livne
f26a75f48b Fixing missing items in move from scylla-ami.sh to scylla_install
scylla-ami.sh moved some ami specific files. This parts have been
dropped when converging scylla-ami into scylla_install. Fixing that.

Signed-off-by: Shlomi Livne <shlomi@scylladb.com>
2016-01-04 15:23:14 +02:00
Shlomi Livne
cec6e6bc20 Invoke scylla_bootparam_setup with/without ami flag
Signed-off-by: Shlomi Livne <shlomi@scylladb.com>
2016-01-04 15:23:08 +02:00
Shlomi Livne
aebeb95342 Fix error: no integer expression expected in AMI creation
The script imports the /etc/sysconfig/scylla-server for configuration
settings (NR_PAGES). The /etc/sysconfig/scylla-server iincludes an AMI
param which is of string value and called as a last step in
scylla_install (after scylla_bootparam_setup has been initated).

The AMI variable is setup in scylla_install and is used in multiple
scripts. To resolve the conflict moving the import of
/etc/sysconfig/scylla-server after the AMI variable has been compared.

Fixes: #744

Signed-off-by: Shlomi Livne <shlomi@scylladb.com>
2016-01-04 15:23:01 +02:00
Pekka Enberg
24809de44f dist/docker: Switch to CentOS 7 as base image
Switch to CentOS 7 as the Docker base image. It's more stable and
updated less frequently than Fedora. As a bonus, it's Thrift package
doesn't pull the world as a dependency which reduces image size from 700
MB to 380 MB.

Suggested by Avi.
Message-Id: <1451911969-26647-1-git-send-email-penberg@scylladb.com>
2016-01-04 14:53:53 +02:00
Tomasz Grabiec
5a9d45935a Merge tag 'asias/fix_cql_query_test/v1' from seastar-dev.git
Fixes for cql_query_test and gossip_test from Asias.
2016-01-04 12:28:49 +01:00
Avi Kivity
c559008915 transport: protect against excessive memory consumption
If requests are delayed downstream from the cql server, and the client is
able to generate unrelated requests without limit, then the transient memory
consumed by the requests will overflow the shard's capacity.

Fix by adding a semaphore to cap the amount of transient memory occupied by
requests.

Fixes #674.
2016-01-04 12:11:00 +01:00
Avi Kivity
78429ad818 types: implement collection compatibility checks
compatible: can be cast, keeps sort order
value-compatible: can be cast, may change sort order

frozen: values participate in sort order
unfrozen: only sort keys participate in sort order

Fixes #740.
2016-01-04 11:02:21 +01:00
Avi Kivity
33fd044609 Merge "Event notification exception safety" from Pekka
"Fix both migration manager and storage service to catch and log
exceptions for listeners to ensure all listeners are notified.

Spotted by Avi."
2016-01-04 11:03:01 +02:00
Pekka Enberg
f646241f1c service/storage_service: Make event notification exception safe
If one of the listeners throws an exception, we must ensure that other
listeners are still notified.

Spotted by Avi.
2016-01-04 10:40:02 +02:00
Pekka Enberg
1e29b07e40 service/migration_manager: Make event notification exception safe
If one of the listeners throws an exception, we must ensure that other
listeners are still notified.

Spotted by Avi.
2016-01-04 10:39:49 +02:00
Asias He
7c9f9f068f cql_server: Do not ignore future in stop
Now connection.shutdown() returns future, we can not ignore it.
Plus, add shutdown process info for debug.

Message-Id: <b2d100bf9c817d7a230c6cd720944ba4fae416e2.1451894645.git.asias@scylladb.com>
2016-01-04 10:17:44 +02:00
Amnon Heiman
6942b41693 API: rename the map of string, double to map_string_double
This replaces the confusing name to a more meaningful name.

Signed-off-by: Amnon Heiman <amnon@scylladb.com>
Message-Id: <1451466952-405-1-git-send-email-amnon@scylladb.com>
2016-01-03 19:10:49 +02:00
Avi Kivity
0d93aa8797 Merge "revert redundant use of gate in messaging_service" from Gleb
"Messaging service inherits from seastar::async_sharded_service which
guaranties that sharded<>::stop() will not complete until all references
to the service will not go away. It was done specifically to avoid using
more verbose gate interface in sharded<> services since it turned out
that almost all of them need one eventually. Unfortunately patches to
add redundant gate to messaging_service sneaked pass my review. The series
reverts them."
2016-01-03 16:48:40 +02:00
Gleb Natapov
fae98f5d67 Revert "messaging_service: wait for outstanding requests"
This reverts commit 9661d8936b.
Message-Id: <1450690729-22551-3-git-send-email-gleb@scylladb.com>
2016-01-03 16:06:39 +02:00