Commit Graph

8028 Commits

Author SHA1 Message Date
Tomasz Grabiec
e88f41fb3f messaging_service: Move REPAIR_CHECKSUM_RANGE verb out of the streaming verbs group
Message-Id: <1452620321-17223-1-git-send-email-tgrabiec@scylladb.com>
2016-01-12 20:17:08 +02:00
Calle Wilund
8de95cdee8 paging bugfix: Allow reset/removal of "specific ck range"
Refs #752

Paged aggregate queries will re-use the partition_slice object,
thus when setting a specific ck range for "last pk", we will hit
an exception case.
Allow removing entries (actually only the one), and overwriting
(using schema equality for keys), so we maintain the interface
while allowing the pager code to re-set the ck range for previous
page pass.

[tgrabiec: commit log cleanup, fixed issue ref]

Message-Id: <1452616259-23751-1-git-send-email-calle@scylladb.com>
2016-01-12 17:45:57 +01:00
Calle Wilund
e50d8b6895 paging bugfix: Ensure limit for single page is min(page size, limit left)
Fixes #752

We set row limit for query to be min of page size/remaining in limit,
but if we have a multinode query we might end up with more rows than asked
for, so must do this again in post-processing.

Message-Id: <1452606935-12899-2-git-send-email-calle@scylladb.com>
2016-01-12 17:23:04 +02:00
Vlad Zolotarov
9232ad927f messaging_service::get_rpc_client(): fix the encryption logic
According to specification
(here https://wiki.apache.org/cassandra/InternodeEncryption)
when the internode encryption is set to `dc` the data passed between
DCs should be encrypted and similarly, when it's set to `rack`
the inter-rack traffic should encrypted.

Currently Scylla would encrypt the traffic inside a local DC in the
first case and inside the local RACK in the later one.

This patch fixes the encryption logic to follow the specification
above.

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
Message-Id: <1452501794-23232-1-git-send-email-vladz@cloudius-systems.com>
2016-01-12 16:22:26 +02:00
Avi Kivity
4693197e37 Merge seastar upstream
* seastar fe7a49c...43e64c2 (1):
  > resource: fix failures on low-memory machines

Fixes #734.
2016-01-12 14:45:43 +02:00
Avi Kivity
39f81b95d6 main: make --developer-mode relax dma requirements
With Docker we might be running on a filesystem that does not support DMA
(aufs; or tmpfs on boot2docker), so let --developer-mode allow running
on those file systems.
Message-Id: <1452593083-25601-1-git-send-email-avi@scylladb.com>
2016-01-12 13:34:46 +02:00
Avi Kivity
d68026716e Merge seastar upstream
* seastar ad3577b...fe7a49c (2):
  > reactor: workaround tmpfs O_DIRECT vs O_EXCL bug
  > rpc: fix reordering between sending client's negotiation frame and user's data
2016-01-12 13:27:16 +02:00
Takuya ASADA
a1d1d0bd06 Revert "dist: prevent 'local rpm' AMI image update to older version of scylla package by yum update"
This reverts commit b28b8147a0.

Signed-off-by: Takuya ASADA <syuu@scylladb.com>
Message-Id: <1452592877-29721-2-git-send-email-syuu@scylladb.com>
2016-01-12 12:26:09 +02:00
Takuya ASADA
5459df1e9e dist: renumber development version as 666.development
yum command think "development-xxxx.xxxx" is older than "0.x", so nightly package mistakenly update with release version.
To prevent this problem, we should add greater number prior to "development".
Also same on Ubuntu package.

Signed-off-by: Takuya ASADA <syuu@scylladb.com>
Message-Id: <1452592877-29721-1-git-send-email-syuu@scylladb.com>
2016-01-12 12:26:08 +02:00
Avi Kivity
5809ed476f Merge "Orderly service startup for systemd"
Use systemd Type=notify to tell systemd about startup progress.

We can now use 'systemctl status scylla-server' to see where we are
in service startup, and 'systemctl start scylla-server' will wait until
either startup is complete, or we fail to start up.
2016-01-12 12:01:32 +02:00
Avi Kivity
3d5f6de683 main: notify systemd of startup progress
Send current startup stage via sd_notify STATUS variable; let it know that
startup is complete via READY=1.

Fixes #760.
2016-01-12 11:58:24 +02:00
Calle Wilund
7f4985a017 commit log reader bugfix: Fix tried to read entries across chunk bounds
read_entry did not verify that current chunk has enough data left
for a minimal entry. Thus we could try to read an entry from the slack
left in a chunk, and get lost in the file (pos > next, skip very much
-> eof). And also give false errors about corruption.
Message-Id: <1452517700-599-1-git-send-email-calle@scylladb.com>
2016-01-12 10:29:07 +02:00
Tzach Livyatan
c5b332716c Fix AMI prompt from "nodetool --help" to "nodetool help"
Fixes #775

Signed-off-by: Tzach Livyatan <tzach@scylladb.com>
Message-Id: <1452586945-28738-1-git-send-email-tzach@scylladb.com>
2016-01-12 10:27:05 +02:00
Takuya ASADA
fc13b9eb66 dist: yum install epel-release before installing CentOS dependencies
Fixes #779

Signed-off-by: Takuya ASADA <syuu@scylladb.com>
Message-Id: <1452586442-19777-1-git-send-email-syuu@scylladb.com>
2016-01-12 10:24:56 +02:00
Avi Kivity
678bdd5c79 Merge "Change AMI base image to CentOS7, use systemd-coredump for Fedora/CentOS, make AMI rootfs as XFS" from Takuya 2016-01-11 18:43:57 +02:00
Tzach Livyatan
8a4f7e211b Add REST API server ip:port parameters to scylla.yaml
api_port and api_address are already valid configuration options.
Adding them to scylla.yaml, let user know they exists.

solve issue #704

Signed-off-by: Tzach Livyatan <tzach@cloudius-systems.com>
Message-Id: <1452527028-13724-1-git-send-email-tzach@cloudius-systems.com>
2016-01-11 18:00:48 +02:00
Avi Kivity
f917f73616 Merge "Handling of schema changes" from Tomasz
"Our domain objects have schema version dependent format, for efficiency
reasons. The data structures which map between columns and values rely on
column ids, which are consecutive integers. For example, we store cells in a
vector where index into the vector is an implicit column id identifying table
column of the cell. When columns are added or removed the column ids may
shift. So, to access mutations or query results one needs to know the version
of the schema corresponding to it.

In case of query results, the schema version to which it conforms will always
be the version which was used to construct the query request. So there's no
change in the way query result consumers operate to handle schema changes. The
interfaces for querying needed to be extended to accept schema version and do
the conversions if necessary.

Shard-local interfaces work with a full definition of schema version,
represented by the schema type (usually passed as schema_ptr). Schema versions
are identified across shards and nodes with a UUID (table_schema_version
type). We maintain schema version registry (schema_registry) to avoid fetching
definitions we already know about. When we get a request using unknown schema,
we need to fetch the definition from the source, which must know it, to obtain
a shard-local schema_ptr for it.

Because mutation representation is schema version dependent, mutations of
different versions don't necessarily commute. When a column is dropped from
schema, the dropped column is no longer representable in the new schema. It is
generally fine to not hold data for dropped columns, the intent behind
dropping a column is to lose the data in that column. However, when merging an
incoming mutation with an existing mutation both of which have different
schema versions, we'd have to choose which schema should be considered
"latest" in order not to loose data. Schema changes can be made concurrently
in the cluster and initiated on different nodes so there is not always a
single notion of latest schema. However, schema changes are commutative and by
merging changes nodes eventually agree on the version.  For example adding
column A (version X) on one node and adding column B (version Y) on another
eventually results in a schema version with both A and B (version Z). We
cannot tell which version among X and Y is newer, but we can tell that version
Z is newer than both X and Y. So the solution to the problem of merging
conflicting mutations could be to ensure that such merge is performed using
the schema which is superior to schemas of both mutations.

The approach taken in the series for ensuring this is as follows. When a node
receives a mutation of an unknown schema version it first performs a schema
merge with the source of that mutation. Schema merge makes sure that current
node's version is superior to the schema of incoming mutation. Once the
version is synced with, it is remembered as such and won't be synced with on
later mutations. Because of this bookkeeping, schema versions must be
monotonic; we don't want table altering to result in any earlier version
because that would cause nodes to avoid syncing with them. The version is a
cryptographically-secure hash of schema mutations, which should fulfill this
purpose in practice.

TODO: It's possible that the node is already performing a sync triggered by
broadcasted schema mutations. To avoid triggering a second sync needlessly, the
schema merging should mark incoming versions as being synced with.

Each table shard keeps track of its current schema version, which is
considered to be superior to all versions which are going to be applied to it.
All data sources for given column family within a shard have the same notion
of current schema version. Individual entries in cache and memtables may be at
earlier versions but this is hidden behind the interface. The entries are
upgraded to current version lazily on access. Sstables are immutable, so they
don't need to track current version. Like any other data source, they can be
queried with any schema version.

Note, the series triggered a bug in demangler:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68700"
2016-01-11 17:59:14 +02:00
Avi Kivity
3092c1ebb5 Update scylla-ami submodule
* ami/files/scylla-ami 07b7118...eb1fdd4 (2):
  > move log file to /var/lib/scylla
  > move config file to /etc/scylla
2016-01-11 17:58:47 +02:00
Avi Kivity
9182ce1f61 Merge seastar upstream
* seastar d0bf6f8...ad3577b (9):
  > httpd: close connection before deleting it
  > reactor: support for non-O_DIRECT capable filesystems
  > tests: modernize linecount
  > IO queues: destruct within reactor's destructor
  > tests: Use dnsdomainname in mkcert.gmk
  > tests: memcached: workaround a possible race between flush_all and read
  > apps: memcached: reduce the error during the expiration time translation
  > timer: add missing #include
  > core: do not call open_file_dma directly

Fixes #757.
2016-01-11 17:41:39 +02:00
Takuya ASADA
6a457da969 dist: add ignore files for AMI 2016-01-11 14:22:20 +00:00
Takuya ASADA
b28b8147a0 dist: prevent 'local rpm' AMI image update to older version of scylla package by yum update
Since yum command think development version is older than release version, we need it.
2016-01-11 14:22:13 +00:00
Takuya ASADA
dd9894a7b6 dist: cleanup build directory before creating rpms for AMI
To prevent AMI build fail, cleanup build directory first.
2016-01-11 14:21:02 +00:00
Takuya ASADA
8886fe7393 dist: use systemd-coredump on Fedora/CentOS, create symlink /var/lib/scylla/coredump -> /var/lib/systemd/coredump when we mounted RAID
Use systemd-coredump for coredump if distribution is CentOS/RHEL/Fedora, and make symlink from RAID to /var/lib/systemd/coredump if RAID is mounted.
2016-01-11 14:20:50 +00:00
Takuya ASADA
927957d3b9 dist: since AMI uses XFS rootfs, we don't need to warn extra disks not attached to the AMI instance
Even extra disks are not supplied, it's stil valid since we have XFS rootfs now.
2016-01-11 14:19:35 +00:00
Takuya ASADA
47be3fd866 dist: split scylla_install script to two parts, scylla_install_pkg is for installing .rpm/.deb packages, scylla_setup is for setup environment after package installed
This enables to setup RAID/NTP/NIC after .rpm/.deb package installed.
2016-01-11 14:19:29 +00:00
Takuya ASADA
76f0191382 dist: remove scylla_local.json, merge it to scylla.json
We can share one packer config file for both build settings.
2016-01-11 14:18:55 +00:00
Takuya ASADA
8721e27978 dist: fetch CentOS dependencies from our yum repository by default
Only rebuild dependencies when passing -R option to build_rpm.sh
2016-01-11 14:18:49 +00:00
Takuya ASADA
b3c85aea89 dist: switch AMI base image from Fedora to CentOS
Move AMI to CentOS, use XFS for rootfs
2016-01-11 14:18:30 +00:00
Takuya ASADA
202389b2ec dist: don't need yum install and mv scylla-ami before scylla_install
This fixes 'amazon-ebs: mv: cannot stat ‘/home/fedora/scylla-ami’: No such file or directory' on build_ami_local.sh
2016-01-11 14:18:08 +00:00
Takuya ASADA
f3c32645d3 dist: add build time dependency to scylla-libstdc++-static for CentOS
This fixes link error on CentOS

Signed-off-by: Takuya ASADA <syuu@scylladb.com>
2016-01-11 14:17:52 +00:00
Takuya ASADA
780d9a26b2 configure.py: add --python option to specify python3 command path, for CentOS
Since python3 path is /usr/bin/python3.4 on CentOS, we need modify it's path
2016-01-11 14:17:27 +00:00
Takuya ASADA
b0980ef0c4 dist: use scylla-boost instead of boost to fix compile error on CentOS
boost package doesn't usable on CentOS, use scylla-boost instead.
2016-01-11 14:17:02 +00:00
Lucas Meneghel Rodrigues
94c3c5c1e9 dist/ami: Print newline at the end of MOTD banner
The MOTD banner now printed upon .bash_profile execution,
if scylla is running, ends with a 'tput sgr0'. That command
appends an extra '[m' at the beginning of the output of any
following command. The automation scripts don't like this.

So let's add an 'echo' at the end of that path to add a newline,
avoiding the condition described above, and another one at the
'ScyllaDB is not started' path, for symmetry. I'm doing this
as it seems easier than having to develop heuristics to know
whether to remove or not that character.

CC: Shlomi Livne <slivne@scylladb.com>
Signed-off-by: Lucas Meneghel Rodrigues <lmr@scylladb.com>
Message-Id: <1452216044-28374-1-git-send-email-lmr@scylladb.com>
2016-01-11 15:40:43 +02:00
Vlad Zolotarov
0ed210e117 storage_proxy::query(): intercept exceptions coming from trace()
Exceptions originated by an unimplemented to_string() methods
may interrupt the query() flow if not intercepted. Don't let it
happen.

Fixes issue #768

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2016-01-11 12:29:50 +01:00
Tomasz Grabiec
e62857da48 schema_tables: Wait for make_directory_for_column_family() to finish in merge_tables() 2016-01-11 10:34:55 +01:00
Tomasz Grabiec
71bbbceced schema_tables: Notify about table creation after it is fully inited
I'm not aware of any issues it could cause, but it makes more sense
that way.
2016-01-11 10:34:55 +01:00
Tomasz Grabiec
b6c6ee5360 tests: Add test for statement invalidation 2016-01-11 10:34:55 +01:00
Tomasz Grabiec
036eec295f query_processor: Invalidate statements synchronously
We want the statements to be removed before we ack the schema change,
otherwise it will race with all future operations.

Since the subscriber will be invoked on each shard, there is no need
to broadcast to all shards, we can just handle current shard.
2016-01-11 10:34:55 +01:00
Tomasz Grabiec
8deb3f18d3 query_processor: Invalidate prepared statements when columns change
Replicates https://issues.apache.org/jira/browse/CASSANDRA-7910 :

"Prepare a statement with a wildcard in the select clause.
2. Alter the table - add a column
3. execute the prepared statement
Expected result - get all the columns including the new column
Actual result - get the columns except the new column"
2016-01-11 10:34:55 +01:00
Tomasz Grabiec
facc549510 schema: Introduce equal_columns() 2016-01-11 10:34:55 +01:00
Tomasz Grabiec
0ea045b654 tests: Add notification test to schema_change_test 2016-01-11 10:34:54 +01:00
Tomasz Grabiec
d80ffc580f schema_tables: Notify about table schema update 2016-01-11 10:34:54 +01:00
Tomasz Grabiec
40858612e5 db: Make column_family::schema() return const& to avoid copy 2016-01-11 10:34:54 +01:00
Tomasz Grabiec
8817e9613d migration_manager: Simplify notifications
Currently the notify_*() method family broadcasts to all shards, so
schema merging code invokes them only on shard 0, to avoid doubling
notifications. We can simplify this by making the notify_*() methods
per-instance and thus shard-local.
2016-01-11 10:34:54 +01:00
Tomasz Grabiec
5d38614f51 tests: Add test for column drop 2016-01-11 10:34:54 +01:00
Tomasz Grabiec
5689a1b08b tests: Add test for column drop 2016-01-11 10:34:54 +01:00
Paweł Dziepak
21bbc65f3f tests/cql: add tests for ALTER TABLE
Signed-off-by: Paweł Dziepak <pdziepak@scylladb.com>
2016-01-11 10:34:54 +01:00
Paweł Dziepak
0276919819 cql3: complete translation of alter table statement
Signed-off-by: Paweł Dziepak <pdziepak@scylladb.com>
2016-01-11 10:34:54 +01:00
Paweł Dziepak
f24f677dde db/schema_tables: simplify column difference computation
Signed-off-by: Paweł Dziepak <pdziepak@scylladb.com>
2016-01-11 10:34:54 +01:00
Paweł Dziepak
ae3acd0f9c system_tables: store sechma::dropped_columns in system tables
Signed-off-by: Paweł Dziepak <pdziepak@scylladb.com>
2016-01-11 10:34:54 +01:00