Commit Graph

18170 Commits

Author SHA1 Message Date
Piotr Sarna
92df1d5a6b storage_proxy: add endpoint_lifecycle_subscriber interface
Storage proxy is able to react to membership changes
in order to cancel long-standing operations for an endpoint.
2019-03-07 12:10:40 +01:00
Piotr Sarna
f9ff97511f storage_proxy: register view update handlers for view write type
View update handlers have a specialized class, so all writes
of type write_type::VIEW are now registered as such.
2019-03-07 12:10:40 +01:00
Piotr Sarna
75ec5fa876 storage_proxy: add intrusive list of view write handlers
In order to be able to iterate over view update write response handlers,
an intrusive list of them is added to storage proxy. This way
iteration can be easily yielded without invalidating operators and all
logic is moved to slow path.
2019-03-07 12:10:40 +01:00
Piotr Sarna
c2048a0758 storage_proxy: add view_update_write_response_handler
View update write response handler inherits from a regular write
response handler, but it's also possible to link it intrusively
in order to be able to induce timeouts on them later.
2019-03-07 12:10:40 +01:00
Piotr Sarna
e9bc2a7912 cql3: fix error message for lack of primary keys in JSON
When any primary key part is not present in INSERT JSON statement,
proper error message will be presented to the client.

Tests: unit (dev) 
Message-Id: <3aa99703523c45056396a0b6d97091da30206dab.1551797502.git.sarna@scylladb.com>
2019-03-05 16:54:46 +02:00
Avi Kivity
256b7d34e2 Update seastar submodule
* seastar ab54765...e640314 (10):
  > net: enable IP_BIND_ADDRESS_NO_PORT before binding a socket during connection
  > core: show address in error message for posix_listen failures
  > fmt: remove submodule
  > tests: fix loopback socket close() to not fail when the peer's side is already closed
  > Merge "Add suffixes to target names" from Jesse
  > temporary_buffer: improve documentation for alignment param requirements
  > docs: Fix dependencies for split tutorial target
  > deleter: prevent early memory free caused by deleter append.
  > doc/tutorial.md: introduce memory allocation foreign_ptr
  > Fix CLI help message (network & DPDK options)

Toolchain and configure.py updated for fmt submodule removal.
2019-03-05 15:51:38 +02:00
Botond Dénes
817490cda1 tests/multishard_mutation_query_test: fuzzy_test: replace BOOST_WARN_* with logger::debug()
fuzzy_test performs some checks that are expected to fail and whoose
failure does not influence the outcome of the test. For this it uses the
`BOOT_WARN_*` family of macros. These will just log a warning when their
predicate fails. This can however confuse someone looking at the logs
trying to determine the cause of a failure. Since these checks are
performed primarly to provide an aid in debugging failures, replace them
with a conditional debug-level log message.

Signed-off-by: Botond Dénes <bdenes@scylladb.com>
Message-Id: <f550a9d9ab1b5b4aeb4f81860cbd3d924fc86898.1551792035.git.bdenes@scylladb.com>
2019-03-05 15:24:53 +02:00
Botond Dénes
0ed0d3297a tests/multishard_mutation_query_test: test_abandoned_read: reduce querier TTL
The `test_abandoned_read` verifies that an abandoned read does a proper
cleanup. One of the things checked is that after the querier TTL
expires, the saved queriers are cleaned-up. This check however had a
very tight timing. The TTL was 2s and the test waited 2s before it did
the check, which is wrapped in an `eventually_true()` (max +1s).
The TTL timer scans the queriers with a period of TTL/2 so a querier
can live 1.5*TTL time. This means that the 2s + 1s wait time is just on
the limit and with some bad luck (and a slow machine) it can fail.
Reduce the TTL in this test to 1s to relax the dependence on timing.

Signed-off-by: Botond Dénes <bdenes@scylladb.com>
Message-Id: <ed0d45b5a07960b83b391d289cade9b9f60c7785.1551787638.git.bdenes@scylladb.com>
2019-03-05 14:10:04 +02:00
Avi Kivity
5993c05a1b Merge "partitioner: Futurize split_range_to_single_shard" from Asias
"
Futurize split_range_to_single_shard to fix reactor stall.

Fixes: #3846
"

* tag 'asias/split_range_to_single_shard/v4' of github.com:scylladb/seastar-dev:
  partitioner: Futurize split_range_to_single_shard
  tests: Use SEASTAR_THREAD_TEST_CASE for partitioner_test.cc
2019-03-05 11:25:36 +02:00
Asias He
58fae5f4c1 partitioner: Futurize split_range_to_single_shard
We saw reactor stalls when closing SSTables. The backtrace looks like:

Oct 12 19:00:51 dell-1 scylla[435045]: Backtrace:[Backtrace #0]
void seastar::backtrace<seastar::backtrace_buffer::append_backtrace()::{lambda(seastar::frame)#1}>(seastar::backtrace_buffer::append_backtrace()::{lambda(seastar::frame)#1}&&) at /home/sylla/scylla/seastar/util/backtrace.hh:56
seastar::backtrace_buffer::append_backtrace() at /home/sylla/scylla/seastar/core/reactor.cc:410
 (inlined by) print_with_backtrace at /home/sylla/scylla/seastar/core/reactor.cc:431
seastar::reactor::block_notifier(int) at /home/sylla/scylla/seastar/core/reactor.cc:749
_L_unlock_13 at funlockfile.c:?
std::experimental::fundamentals_v1::_Optional_base<range_bound<dht::ring_position>, true>::_Optional_base(std::experimental::fundamentals_v1::_Optional_base<range_bound<dht::ring_position>, true>&&) at /opt/scylladb/include/c++/7/experimental/optional:247
 (inlined by) std::experimental::fundamentals_v1::optional<range_bound<dht::ring_position> >::optional(std::experimental::fundamentals_v1::optional<range_bound<dht::ring_position> >&&) at /opt/scylladb/include/c++/7/experimental/optional:493
 (inlined by) wrapping_range<dht::ring_position>::wrapping_range(wrapping_range<dht::ring_position>&&) at /home/sylla/scylla/./range.hh:61
 (inlined by) nonwrapping_range<dht::ring_position>::nonwrapping_range(nonwrapping_range<dht::ring_position>&&) at /home/sylla/scylla/./range.hh:430
 (inlined by) void __gnu_cxx::new_allocator<nonwrapping_range<dht::ring_position> >::construct<nonwrapping_range<dht::ring_position>, nonwrapping_range<dht::ring_position> >(nonwrapping_range<dht::ring_position>*, nonwrapping_range<dht::ring_position>&&) at /opt/scylladb/include/c++/7/ext/new_allocator.h:136
 (inlined by) void std::allocator_traits<std::allocator<nonwrapping_range<dht::ring_position> > >::construct<nonwrapping_range<dht::ring_position>, nonwrapping_range<dht::ring_position> >(std::allocator<nonwrapping_range<dht::ring_position> >&, nonwrapping_range<dht::ring_position>*, nonwrapping_range<dht::ring_position>&&) at /opt/scylladb/include/c++/7/bits/alloc_traits.h:475
 (inlined by) nonwrapping_range<dht::ring_position>& std::deque<nonwrapping_range<dht::ring_position>, std::allocator<nonwrapping_range<dht::ring_position> > >::emplace_back<nonwrapping_range<dht::ring_position> >(nonwrapping_range<dht::ring_position>&&) at /opt/scylladb/include/c++/7/bits/deque.tcc:167
 (inlined by) std::deque<nonwrapping_range<dht::ring_position>, std::allocator<nonwrapping_range<dht::ring_position> > >::push_back(nonwrapping_range<dht::ring_position>&&) at /opt/scylladb/include/c++/7/bits/stl_deque.h:1558
 (inlined by) dht::split_range_to_single_shard(dht::i_partitioner const&, schema const&, nonwrapping_range<dht::ring_position> const&, unsigned int) at /home/sylla/scylla/dht/i_partitioner.cc:454
dht::split_range_to_single_shard(schema const&, nonwrapping_range<dht::ring_position> const&, unsigned int) at /home/sylla/scylla/dht/i_partitioner.cc:464
create_sharding_metadata at /home/sylla/scylla/sstables/sstables.cc:2075
 (inlined by) sstables::sstable::write_scylla_metadata(seastar::io_priority_class const&, unsigned int, sstables::sstable_enabled_features) at /home/sylla/scylla/sstables/sstables.cc:2435
sstables::sstable_writer_m::consume_end_of_stream() at /home/sylla/scylla/sstables/sstables.cc:3483
sstables::compaction::finish_new_sstable(std::experimental::fundamentals_v1::optional<sstables::sstable_writer>&, seastar::lw_shared_ptr<sstables::sstable>&) at /home/sylla/scylla/sstables/compaction.cc:338
 (inlined by) sstables::regular_compaction::stop_sstable_writer() at /home/sylla/scylla/sstables/compaction.cc:579
 (inlined by) sstables::regular_compaction::finish_sstable_writer() at /home/sylla/scylla/sstables/compaction.cc:585
sstables::compacting_sstable_writer::consume_end_of_stream() at /home/sylla/scylla/sstables/compaction.cc:494
 (inlined by) auto compact_mutation_state<(emit_only_live_rows)0, (compact_for_sstables)1>::consume_end_of_stream<sstables::compacting_sstable_writer>(sstables::compacting_sstable_writer&) at /home/sylla/scylla/./mutation_compactor.hh:292
 (inlined by) compact_mutation<(emit_only_live_rows)0, (compact_for_sstables)1, sstables::compacting_sstable_writer>::consume_end_of_stream() at /home/sylla/scylla/./mutation_compactor.hh:397
 (inlined by) stable_flattened_mutations_consumer<compact_for_compaction<sstables::compacting_sstable_writer> >::consume_end_of_stream() at /home/sylla/scylla/./mutation_reader.hh:366
 (inlined by) auto flat_mutation_reader::impl::consume_in_thread<stable_flattened_mutations_consumer<compact_for_compaction<sstables::compacting_sstable_writer> >, std::function<bool (dht::decorated_key const&)> >(stable_flattened_mutations_consumer<compact_for_compaction<sstables::compacting_sstable_writer> >, std::function<bool (dht::decorated_key const&)>, std::chrono::time_point<seastar::lowres_clock, std::chrono::duration<long, std::ratio<1l, 1000l> > >) at /home/sylla/scylla/./flat_mutation_reader.hh:288
 (inlined by) auto flat_mutation_reader::consume_in_thread<stable_flattened_mutations_consumer<compact_for_compaction<sstables::compacting_sstable_writer> >, std::function<bool (dht::decorated_key const&)> >(stable_flattened_mutations_consumer<compact_for_compaction<sstables::compacting_sstable_writer> >, std::function<bool (dht::decorated_key const&)>, std::chrono::time_point<seastar::lowres_clock, std::chrono::duration<long, std::ratio<1l, 1000l> > >) at /home/sylla/scylla/./flat_mutation_reader.hh:370
 (inlined by) operator() at /home/sylla/scylla/sstables/compaction.cc:757
 (inlined by) apply at /home/sylla/scylla/seastar/core/apply.hh:35
 (inlined by) apply<sstables::compaction::run(std::unique_ptr<sstables::compaction>)::<lambda()> > at /home/sylla/scylla/seastar/core/apply.hh:43
 (inlined by) apply<sstables::compaction::run(std::unique_ptr<sstables::compaction>)::<lambda()> > at /home/sylla/scylla/seastar/core/future.hh:1309
 (inlined by) operator() at /home/sylla/scylla/./seastar/core/thread.hh:315
 (inlined by) _M_invoke at /opt/scylladb/include/c++/7/bits/std_function.h:316
std::function<void ()>::operator()() const at /opt/scylladb/include/c++/7/bits/std_function.h:706
 (inlined by) seastar::thread_context::main() at /home/sylla/scylla/seastar/core/thread.cc:313

The call chain is:

sstable_writer_k_l::consume_end_of_stream and mc::writer::consume_end_of_stream
-> sstable::write_scylla_metadata -> create_sharding_metadata -> dht::split_range_to_single_shard

Since sstable writer assumes a thread context. We can futurize dht::split_range_to_single_shard.

Fixes: #3846
Tests: dtest + build/dev/tests/partitioner_test
2019-03-05 17:21:27 +08:00
Benny Halevy
1021eb29c9 distributed_loader: fix old format counters exception
table::load_sstable: fix missing arg in old format counters exception

Properly catch and log the exception in load_new_sstables.
Abort when the exception is caught to keep current behavior.

Seen with migration_test:TestMigration_with_2_1_x.migrate_sstable_with_counter_test
without enable_dangerous_direct_import_of_cassandra_counters.

Signed-off-by: Benny Halevy <bhalevy@scylladb.com>
Message-Id: <20190301091235.2914-1-bhalevy@scylladb.com>
2019-03-04 17:36:09 +01:00
Avi Kivity
026821fb59 Merge "Record large rows in the system.large_rows table" from Rafael
"
This fixes #3988.

We already have a system.large_partitions, but only a warning for
large rows. These patches close the gap by also recording large rows
into a new system.large_rows.
"

* 'espindola/large-row-add-table-v6' of https://github.com/espindola/scylla:
  Add a testcase for large rows
  Populate system.large_rows.
  Create a system.large_rows table
  Extract a key_to_str helper
  Don't call record_large_rows if stopped
  Add a delete_large_rows_entries method to large_data_handler
  db::large_data_handler::(maybe_)?record_large_rows: Return future<> instead of void
  Rename maybe_delete_large_partitions_entry
  Rename log_large_row to record_large_rows
  Rename maybe_log_large_row to maybe_record_large_rows
2019-03-04 18:31:10 +02:00
Avi Kivity
da0a25859b Merge "Improvements to commitlog logs" from Paweł
"
This series contains minor improvements to commitlog log messages that
have helped investigating #4231, but are not specific to that bug.
"

* tag 'improve-commitlog-logs/v1' of https://github.com/pdziepak/scylla:
  commitlog: use consistent chunk offsets in logs
  commitlog: provide more information in logs
  commitlog: remove unnecessary comment
2019-03-04 14:52:46 +02:00
Paweł Dziepak
00b33de25c commitlog: use consistent chunk offsets in logs
Logs in commitlog writer use offset in the file of the chunk header to
identify chunks. However, the replayer is using offset after the header
for the same purpose. This causes unnecessary confusion suggesting that
the replayer is reading at the wrong position.

This patch changes the replayer so that it reports chunk header offsets.
2019-03-04 12:15:50 +00:00
Paweł Dziepak
813b00a1a6 commitlog: provide more information in logs
This commits adds some more information to the logs. Motivated, by
experiences with investigating #4231.

 * size of each write
 * position of each write
 * log message for final write
2019-03-04 12:15:50 +00:00
Paweł Dziepak
1a657e9c5f commitlog: remove unnecessary comment 2019-03-04 12:15:50 +00:00
Avi Kivity
d95dec22d9 Merge "Fix commitlog chunks overwriting each other" from Paweł
"
This series fixes a problem in the commitlog cycle() function that
confused in-memory and on-disk size of chunks it wrote to disk. The
former was used to decide how much data needs to be actually written,
and the latter was used to compute the offset of the next chunk. If two
chunk writes happened concurrently one the one positioned earlier in
the file could corrupt the header of the next one.

Fixes #4231.

Tests: unit(dev), dtest(commitlog_test.py:TestCommitLog.test_commitlog_replay_on_startup,test_commitlog_replay_with_alter_table)
"

* tag 'fix-commitlog-cycle/v1' of https://github.com/pdziepak/scylla:
  commitlog: write the correct buffer size
  utils/fragmented_temporary_buffer_view: add remove suffix
2019-03-04 14:14:32 +02:00
Tomasz Grabiec
58e7ad20eb sstable/compaction: Use correct schema in the writing consumer
Introduced in 2a437ab427.

regular_compaction::select_sstable_writer() creates the sstable writer
when the first partition is consumed from the combined mutation
fragment stream. It gets the schema directly from the table
object. That may be a different schema than the one used by the
readers if there was a concurrent schema alter duringthat small time
window. As a result, the writing consumer attached to readers will
interpret fragments using the wrong version of the schema.

One effect of this is storing values of some columns under a different
column.

This patch replaces all column_family::schema() accesses with accesses
to the _schema memeber which is obtained once per compaction and is
the same schema which readers use.

Fixes #4304.

Tests:

  - manual tests with hard-coded schema change injection to reproduce the bug
  - build/dev/scylla boot
  - tests/sstable_mutation_test

Message-Id: <1551698056-23386-1-git-send-email-tgrabiec@scylladb.com>
2019-03-04 13:27:19 +02:00
Paweł Dziepak
434023425d commitlog: write the correct buffer size
Commitlog files contain multiple chunks. Each chunk starts as a single
(possibly, fragmented buffer). The size of that buffer in memory may be
larger than the size in the file.

cycle() was incorrectly using the in-memory size to write the whole
buffer to the file. That sometimes caused data corruption, since a
smaller on-file size was used to compute the offset of the next chunk
and there could be multiple chunk writes happening at the same time.

This patch solves the issue by ensuring that only the actual on-file
size of the chunk is written.
2019-03-04 10:25:48 +00:00
Paweł Dziepak
ca8d1025c0 utils/fragmented_temporary_buffer_view: add remove suffix
This patch adds fragmented_temporary_buffer_view::remove_suffix(). It is
also necessary to adjust remove_prefix() since now the total size of all
fragments may be larger than the size of the view if both those
operations are performed.
2019-03-04 10:23:45 +00:00
Asias He
3861f538dc tests: Use SEASTAR_THREAD_TEST_CASE for partitioner_test.cc
We are going to convert split_range_to_single_shard to return a future.
2019-03-04 09:41:09 +08:00
Avi Kivity
8f71e7ffd4 Merge "auth: Prevent disallowed roles from logging in" from Jesse
"
This series heavily refactors `auth_test` in anticipation of
the last patch, which fixes a bug and which should be backported.

Branches: branch-3.0, branch-2.3
"

Fixes #4284

* 'jhk/check_can_login/v2' of https://github.com/hakuch/scylla:
  auth: Reject logins from disallowed roles
  tests: Restrict the scope of a variable
  tests: Simplify boolean assertions in `auth_test`
  tests: Abstract out repeated assertion checking
  tests: Do not use the `auth` namespace
  tests: Validate authentication correctly
  tests: Ensure test roles are created and dropped
  tests: Use `static` variables in `auth_test`
  tests: Remove non-useful test
2019-03-02 17:13:06 +02:00
Asias He
a949ccee82 repair: Reject combination of -dc and -hosts options
4 nodes in the cluster
n1, n2 in dc1
n3, n4 in dc2

dc1 RF=2, dc2 RF=2.

If we run

    nodetool repair -hosts 127.0.0.1,127.0.03 -dc "dc1,dc2" multi

on n1.

The -hosts option will be ignored and only the -dc option
will be used to choose which hosts to repair. In this case, n1 to n4
will be repaired.

If user wants to select specific hosts to repair with, there is no need
to specify the -dc option. Use the -hosts option is enough.

Reject the combination and not to surprise the user.

In https://issues.apache.org/jira/browse/CASSANDRA-9876, the same logic
is introduced as well.

Refs #3836
Message-Id: <e95ac1099f98dd53bb9d6534316005ea3577e639.1551406529.git.asias@scylladb.com>
2019-03-02 16:42:29 +02:00
Juliana Oliveira
6322293263 dist/docker: add ssh server
Scylla Manager communicates through SSH, so this patch adds SSH server
to Scylla's docker image in order for it to be configurable by Scylla
Manager.

Message-Id: <20190301161428.GA12148@shenzou.localdomain>
2019-03-01 19:11:35 +02:00
Avi Kivity
41078de096 tools: toolchain: update image for gcc-8.3.1-2.fc29.x86_64
tests: unit (debug, dev, release)
2019-03-01 16:42:18 +02:00
Duarte Nunes
44966d0a66 Merge 'Fix view update generation optimizations' from Piotr
"
This series aims to fix inconsistencies in recent view update generation series (435447998).

First of all, it checks view row marker liveness instead of that of a base row marker
when deciding if optimizations can be applied or not.

Secondly, tests based on creating mutations directly are removed. Instead:
 - dtest case which detected inconsistencies in previous series is ported to be a unit test
 - the above case is also expanded to cover views with regular base column in their key
 - additional test for TTL and timestamps is added and it's based on CQL

Tests: unit (dev)
dtest: materialized_views_test.TestMaterializedViews.test_no_base_column_in_view_pk_complex_timestamp_without_flush

Fixes: #4271
"

* 'fix_virtual_columns_liveness_checks_in_update_optimization_5' of https://github.com/psarna/scylla:
  tests: add view update optimization case for TTL
  database: add view_stats getter
  tests: port complex timestamp view test from dtest
  db,view: fix virtual columns liveness checks
  tests: remove update generating test case
2019-03-01 10:58:39 -03:00
Jesse Haber-Kucharsky
a139afc30c auth: Reject logins from disallowed roles
When the `LOGIN` option for a role is set to `false`, Scylla should not
permit the role to log in.

Fixes #4284

Tests: unit (debug)
2019-02-28 15:02:53 -05:00
Jesse Haber-Kucharsky
320b4a7b99 tests: Restrict the scope of a variable 2019-02-28 15:02:53 -05:00
Jesse Haber-Kucharsky
f8764a12e6 tests: Simplify boolean assertions in auth_test 2019-02-28 15:02:53 -05:00
Jesse Haber-Kucharsky
879217ccaf tests: Abstract out repeated assertion checking 2019-02-28 15:02:53 -05:00
Jesse Haber-Kucharsky
3c8eeb0e86 tests: Do not use the auth namespace 2019-02-28 15:02:53 -05:00
Jesse Haber-Kucharsky
afed9c7bee tests: Validate authentication correctly
There are additional validation steps that the server executes in
addition to simply invoking the authenticator, so we adapt the tests to
also perform that validation.

We also eliminate lots of code duplication.
2019-02-28 15:01:14 -05:00
Jesse Haber-Kucharsky
baefde0f6c tests: Ensure test roles are created and dropped
Since the role manager and authenticator work in tandem, the test cases
should use the wrapper for `auth::service` to create and drop users
instead of just doing it through the authenticator.
2019-02-28 15:00:20 -05:00
Jesse Haber-Kucharsky
fd88d59ad9 tests: Use static variables in auth_test
This way, we avoid copies and alleviate resource-management concerns.
2019-02-28 14:59:38 -05:00
Jesse Haber-Kucharsky
f274982522 tests: Remove non-useful test
Password handling is verified in its own test suite, and this test not
only makes a number of assumptions about implementation details, but
also tries to verify a hashing scheme (bcrypt) which is not supported on
most Linux distributions.
2019-02-28 14:58:27 -05:00
Avi Kivity
7c968f4a9e build: move XXH_PRIVATE_API and SEASTAR_TESTING_MAIN non-mode-specific
These defines are global, so they can be in the mode-agnostic cxxflags
rather than the mode-specific cxxflags_{mode}.
Message-Id: <20190228081247.20116-1-avi@scylladb.com>
2019-02-28 09:51:02 +00:00
Piotr Sarna
032f8e2893 tests: add view update optimization case for TTL
This test case checks whether redundant updates are omitted
and the essential ones are still generated.
2019-02-28 10:47:20 +01:00
Piotr Sarna
67e63d4dd7 database: add view_stats getter
It will be used for testing purposes
2019-02-28 10:47:20 +01:00
Piotr Sarna
09b8d2e9d6 tests: port complex timestamp view test from dtest
This test was useful in discovering corner cases for TTLs of virtual
columns, so it's ported to unit test suite from dtest.

The test is also extended with a mirrored case for base regular column
that *is* included in view pk.
2019-02-28 10:47:20 +01:00
Piotr Sarna
5f85a7a821 db,view: fix virtual columns liveness checks
When looking for optimization paths, columns selected in a view
are checked against multiple conditions - unfortunately virtual
columns were erroneously skipped from that check, which resulted
in ignoring their TTLs. That can lead to overoptimizing
and not including vital liveness info into view rows,
which can then result in row disappearing too early.
2019-02-28 10:47:19 +01:00
Piotr Sarna
b963543762 tests: remove update generating test case
This test case should have been based on CQL instead of creating
artificial update scenarios. It also contains invalid cases
regarding base and view row marker, so it's removed here
and replaced with CQL-based test in this same series.
2019-02-28 10:40:47 +01:00
Avi Kivity
20eadb2c39 relocatable-package: package and redirect gnutls configuration
gnutls requires a configuration file, and the configuration file must match
the one used by the library. Since we ship our own version of the library with
the relocatable package, we must also ship the configuration file.

Luckily, it is possible to override the location of the configuration file via
an environment variable, so all we need to do is to copy the file to the archive
and provide the environment variable in the thunk that adjusts the library path.

Reviewed-by: Nadav Har'El <nyh@scylladb.com>
Message-Id: <20190227110529.14146-1-avi@scylladb.com>
2019-02-28 10:57:32 +02:00
Avi Kivity
4022a919f6 test: allocate at least one logical core per unit test
Currently, we only allocate memory for concurrent unit test runs. This can cause
CPU overcommit when running test.py on machines with a log of memory but few cores.
This overcommit can cause timeouts in tests that are time-sensitive (bad practice,
but can happen) and makes the desktop sluggish.

Improve by allocating at least one logical core per running test.

Reviewed-by: Benny Halevy <bhalevy@scylladb.com>
Message-Id: <20190227132516.22147-1-avi@scylladb.com>
2019-02-28 10:34:33 +02:00
Dan Yasny
6dbb48a12a node_health_check: collect scylla.d contents with node_health_check
We are missing data for CPU conf files and potentially other
information when collecting node data.

Fixes #4094

Message-Id: <20190225204727.20805-5-dyasny@scylladb.com>
2019-02-28 10:23:19 +02:00
Dan Yasny
9055e7a49e node_health_check: Add redhat-release to health check if present
Collect /etc/redhat-release as well as os-release from relevant
hosts. The problem with os-release is that it doesn't contain the
minor version of the EL OS family. Since this is only present in
Red Hat distributions and derivatives, it will not be collected
in Debian derivatives.

Another approach is to use lsb_release -a but it will not provide
anything more useful than os-release on Debian and lsb needs to be
installed on EL derivatives first.

Fixes #4093

Message-Id: <20190225204727.20805-4-dyasny@scylladb.com>
2019-02-28 10:23:12 +02:00
Dan Yasny
2f26390f52 node_health_check: Use clear hostname instead of -i for filenames and report names
Hostname -i produces a garbled output on new systems with ipv6
enabled, better to use the clean hostname instead, for the file
names.

Message-Id: <20190225204727.20805-3-dyasny@scylladb.com>
2019-02-28 10:23:06 +02:00
Dan Yasny
f483c594ee node_health_check: Detect the address for the CQL (port 9042) listener and use it
The script relies on hostname -i for host address, which can be
wrong in some systems. This patch checks for where the defined
CQL_PORT is listening, and uses the correct IP address instead.

Message-Id: <20190225204727.20805-2-dyasny@scylladb.com>
2019-02-28 10:22:58 +02:00
Avi Kivity
632c7c303a Merge "auth: Restructure SASL code" from Jesse
"
This series restructures the SASL code that was previously internal
to the `password_authenticator` so that it can be used in other contexts.
"

* 'jhk/restructure_sasl/v1' of https://github.com/hakuch/scylla:
  auth: Rename SASL challenge class for "PLAIN"
  auth: Make a ctor `explicit`
  auth: Move `sasl_challenge` to its own file
  auth: Decouple SASL code from its parent class
2019-02-28 10:19:41 +02:00
Jesse Haber-Kucharsky
f2d92f81e8 auth: Report a more specific error with bad creds
Without this change, the resulting error message for an invalid password
is "authentication failed".

With this change, we report "Username and/or password are incorrect".

Fixes #4285

Signed-off-by: Jesse Haber-Kucharsky <jhaberku@scylladb.com>
Message-Id: <32d00be8af5075ee10d2c14f85b76843a9adac10.1551306914.git.jhaberku@scylladb.com>
2019-02-28 09:53:57 +02:00
Jesse Haber-Kucharsky
3d883e8cf2 auth: Rename SASL challenge class for "PLAIN" 2019-02-27 18:36:58 -05:00