Commit Graph

3060 Commits

Author SHA1 Message Date
Asias He
af579a055b gossip: Get rid of the gms::get_local_failure_detector static object
Store the failure_detector object inside gossiper object.

- No more the global object sharded<failure_detector>

- No need to initialize sharded<failure_detector> manually which
simplifies the code in tests/cql_test_env.cc and init.cc.
2019-03-22 09:08:51 +08:00
Asias He
9dbc4af1dd tests: Fix stop snitch in gossip_test.cc
It should stop snitch not failure detector. Fix it up. We are going to
remove the static failure_detector object soon.
2019-03-22 08:26:47 +08:00
Asias He
ee1227b3ae gossiper: Pass db::config object to gossiper class
Gossiper calls service::get_local_storage_service() to get cfg options.
To avoid cyclic dependency, pass the cfg object to gossiper directly.
2019-03-22 08:25:16 +08:00
Tomasz Grabiec
69775c5721 row_cache: Fix abort in cache populating read concurrent with memtable flush
When we're populating a partition range and the population range ends
with a partition key (not a token) which is present in sstables and
there was a concurrent memtable flush, we would abort on the following
assert in cache::autoupdating_underlying_reader:

     utils::phased_barrier::phase_type creation_phase() const {
         assert(_reader);
         return _reader_creation_phase;
     }

That's because autoupdating_underlying_reader::move_to_next_partition()
clears the _reader field when it tries to recreate a reader but it finds
the new range to be empty:

         if (!_reader || _reader_creation_phase != phase) {
            if (_last_key) {
                auto cmp = dht::ring_position_comparator(*_cache._schema);
                auto&& new_range = _range.split_after(*_last_key, cmp);
                if (!new_range) {
                    _reader = {};
                    return make_ready_future<mutation_fragment_opt>();
                }

Fix by not asserting on _reader. creation_phase() will now be
meaningful even after we clear the _reader. The meaning of
creation_phase() is now "the phase in which the reader was last
created or 0", which makes it valid in more cases than before.

If the reader was never created we will return 0, which is smaller
than any phase returned by cache::phase_of(), since cache starts from
phase 1. This shouldn't affect current behavior, since we'd abort() if
called for this case, it just makes the value more appropriate for the
new semantics.

Tests:

  - unit.row_cache_test (debug)

Fixes #4236
Message-Id: <1553107389-16214-1-git-send-email-tgrabiec@scylladb.com>
2019-03-21 12:46:00 -03:00
Avi Kivity
a9cf07369f Merge "Add local indexes" from Piotr
"
This series adds support for local indexing, i.e. when the index table
resides on the same partition as base data.
It addresses the performance issue of having an indexed query
that also specifies a partition key - index will be queried
locally.
"

* 'add_local_indexing_11' of https://github.com/psarna/scylla: (30 commits)
  tests: add cases for local index prefix optimization
  tests: add create/drop local index test case
  tests: add non-standard names cases to local index tests
  tests: add multi pk case for local index tests
  tests: add test for malformed local index definitions
  tests: add local index paging test
  tests: add local indexing test
  cql3: add CREATE INDEX syntax for local indexes
  cql3: use serialization function to create index target string
  index: add serialization function for index targets
  index: use proper local index target when adding index
  index: add parsing target column name from local index targets
  db: add checking for local index in schema tables
  index: add checking if serialized target implies local index
  index: enable parsing multi-key targets
  index: move target parser code to .cc file
  json: add non-throwing overload for to_json_value
  cql3: add checking for local indexes in has_supporting_index()
  cql3: move finding index restrictions to prepare stage
  cql3: add picking an index by score
  ...
2019-03-21 12:46:00 -03:00
Nadav Har'El
561c640ed1 materialized views: allow view without clustering columns
When a materialized view was created, the verification code artificially
forbade creating a view without a clustering key column. However, there
is no real reason to forbid this. In the trivial case, the original base
table might not have had a clustering key, and the view might want to use
the exact same key. In a more complex case, a view may want to have all the
primary key columns as *partition* key columns, and that should be fine.

The patch also includes a regression test, which failed before this patch,
and succeeds with it (we test that we can create materialized views in both
aforementioned scenarios, and these materialized views work as expected).

Duarte raised the opinion that the "trivial" case of a view table with
a key identical to that of the base should be disallowed. However, this
should be done, if at all (I think it shouldn't), in a follow-up patch,
which will implement the non-triviality requirement consistently (e.g.,
require view primary key to be different from base's, regardless of
the existance or non-existance of clustering columns).

Fixes #4340.

Signed-off-by: Nadav Har'El <nyh@scylladb.com>

Message-Id: <20190320122925.10108-1-nyh@scylladb.com>
2019-03-21 12:45:52 -03:00
Avi Kivity
eddb98e8c6 Merge "sstables: mc: Write and read static compact tables the same way as Cassandra" from Tomasz
"
Static compact tables are tables with compact storage and no
clustering columns.

Before this patch, Scylla was writing rows of static compact tables as
clustered rows instead of as static rows. That's because in our in-memory
model such tables have regular rows and no static row. In Cassandra's
schema (since 3.x), those tables have columns which are marked as
static and there are no regular columns.

This worked fine as long as Scylla was writing and reading those
sstables. But when importing sstables from Cassandra, our reader was
skipping the static row, since it's not present in our schema, and
returning no rows as a result. Also, Cassandra, and Scylla tools,
would have problems reading those sstables.

Fix this by writing rows for such tables the same way as Cassandra
does. In order to support rolling downgrade, we do that only when all
nodes are upgraded.

Fixes #4139.

Tests:

  - unit (dev)
"

* tag 'static-compact-mc-fix-v3.1' of github.com:tgrabiec/scylla:
  tests: sstables: Test reading of static compact sstable generated by Cassandra
  tests: sstables: Add test for writing and reading of static compact tables
  sstables: mc: Write static compact tables the same way as Cassandra
  sstable: mc: writer: Set _static_row_written inside write_static_row()
  sstables: Add sstable::features()
  sstables: mc: writer: Prepare write_static_row() for working with any column_kind
  storage_service: Introduce the CORRECT_STATIC_COMPACT feature flag
  sstables: mc: writer: Build indexed_columns together with serialization_header
  sstables: mc: writer: De-optimize make_serialization_header()
  sstable: mc: writer: Move attaching of mc-specific components out of generic code
2019-03-21 12:45:51 -03:00
Piotr Sarna
41679de13e tests: add cases for local index prefix optimization
The cases check if incorporating clustering key prefix into
the indexed query works fine (i.e. does not require filtering
and returns proper rows).
2019-03-20 10:51:27 +01:00
Piotr Sarna
56a0e6d992 tests: add create/drop local index test case 2019-03-20 10:51:27 +01:00
Piotr Sarna
3c61c8e18a tests: add non-standard names cases to local index tests
New test cases cover case-sensitive column/table names and names with
non-alphanumeric characters like commas and parentheses.
2019-03-20 10:51:27 +01:00
Piotr Sarna
d664e0e522 tests: add multi pk case for local index tests 2019-03-20 10:51:27 +01:00
Piotr Sarna
3b39029924 tests: add test for malformed local index definitions 2019-03-20 10:51:27 +01:00
Piotr Sarna
4b82011cd3 tests: add local index paging test 2019-03-20 10:51:27 +01:00
Piotr Sarna
8836500fcd tests: add local indexing test
A test case for local indexing is added to the SI suite.
2019-03-20 10:51:27 +01:00
Glauber Costa
7119440cbc tests: make sure that commitlog replay works after truncate.
Tomek and I recently had a discussion about whether or not a commitlog
replay would be safe after we dropped or truncated a table that is not
flushed (durable, but auto_snapshots being false).

While we agreed that would be the safe, we both agreed we would feel
better with a unit test covering that.

This patch adds such a test (btw, it passes)

Signed-off-by: Glauber Costa <glauber@scylladb.com>
Message-Id: <20190318223811.6862-1-glauber@scylladb.com>
2019-03-19 11:30:51 +01:00
Tomasz Grabiec
33f15aa1b5 tests: sstables: Test reading of static compact sstable generated by Cassandra 2019-03-18 11:18:33 +01:00
Tomasz Grabiec
c78568daef tests: sstables: Add test for writing and reading of static compact tables 2019-03-18 11:18:33 +01:00
Piotr Jastrzebski
2b0437a147 sstables: Add test for sstable::validate_partitioner
Make sure the exception is thrown when Scylla
tries to load an SSTable created with non-compatible partitioner.

Signed-off-by: Piotr Jastrzebski <piotr@scylladb.com>
2019-03-15 10:47:47 +01:00
Rafael Ávila de Espíndola
f983570ac8 Add a test for large cells
Signed-off-by: Rafael Ávila de Espíndola <espindola@scylladb.com>
2019-03-12 13:19:04 -07:00
Rafael Ávila de Espíndola
63251b66c1 db: Record large cells
Fixes #4234.

Large cells are now recorded in system.large_cells.

Signed-off-by: Rafael Ávila de Espíndola <espindola@scylladb.com>
2019-03-12 13:19:04 -07:00
Rafael Ávila de Espíndola
d7f263d334 db: Rename (maybe_)?update_large_partitions
This renames it to record_large_partitions, which matches
record_large_rows. It also changes the signature to be closer to
record_large_rows.

Signed-off-by: Rafael Ávila de Espíndola <espindola@scylladb.com>
2019-03-12 13:16:04 -07:00
Rafael Ávila de Espíndola
f254664fe6 db: refactor large data deletion code
The code for deleting entries from system.large_partitions was almost
a duplicate from the code for deleting entries from system.large_rows.

This patch unifies the two, which also improves the error message when
we fail to delete entries from system.large_partitions.

Signed-off-by: Rafael Ávila de Espíndola <espindola@scylladb.com>
2019-03-12 13:16:04 -07:00
Piotr Sarna
ae52b3baa7 tests: fix complex timestamp test flakiness
Complex timestamp tests were ported from dtest and contained a potential
race - rows were updated with TTL 1 and then checked if the row exists
in both base and view replicas in an eventually() loop.
During this loop however, TTL of 1 second might have already passed
and the row could have been deleted from base.
This patch changes the mentioned TTL to 30 seconds, making the tests
extremely unlikely to be flaky.
Message-Id: <6b43fe31850babeaa43465eb771c0af45ee6e80d.1552041571.git.sarna@scylladb.com>
2019-03-08 13:34:27 -03:00
Tomasz Grabiec
eb5506275b Merge "Further enhancements to perf_fast_forward" from Paweł
This series contains several improvements to perf_fast_forward that
either address some of the problems seen in the automated runs or help
understanding the results.

The main problem was that test small-partition-slicing had a preparation
stage disproportionally long compared to the actual testing phase. While
the fragments per second results wasn't affected by that, it restricted
the number of iterations of the test that we were able to run, and the
test which single iterations is short (and more prone to noise) was
executed only four times. This was solved by sharing the preparation
stage with all iterations, thus enabling the test to be run many times
and improving the stability of the results.

Another, improvement is the ability to dump all test results and process
them producing histograms. This allows us to see how the distribution of
particular statistics looks like and if there are some complications.

Refs #4278.

* https://github.com/pdziepak/scylla.git more-perf_fast_forward/v1:
  tests/perf_fast_forward: print number of iterations of each test
  tests/perf_fast_forward: reuse keys in small partition slicing test
  tests/perf_fast_forward: extract json result file writing logic
  tests/perf_fast_forward: add an option to dump all results
  tests/perf_fast_forward: add script for analysing full results
2019-03-07 12:22:13 -03:00
Paweł Dziepak
0ba7a3c55a tests/perf_fast_forward: add script for analysing full results
perf_fast_forward with flag --dump-all-results reports the results of
every test iteration that was executed. This patch introduces a python
script that can analyse those results (in json format) and present them
in a more human-friendly way.

For now, the only option is to plot histograms of selected statistics.
2019-03-06 15:48:49 +00:00
Paweł Dziepak
4220b90b22 tests/perf_fast_forward: add an option to dump all results
perf_fast_forward runs each test case multiple times and reports a
summary of those results (median, min, max, and median absolute
deviation).

While very convenient the summary may hide some important information
(e.g. the distribution of the results). This patch adds an option to
report results of every single executed iteration.
2019-03-06 15:48:48 +00:00
Paweł Dziepak
55ed8b2472 tests/perf_fast_forward: extract json result file writing logic
We are about to report, depending on flags, both full results as well as
the results summary written now. Most of the logic is going to be
identical.
2019-03-06 15:48:45 +00:00
Paweł Dziepak
daafde21c5 tests/perf_fast_forward: reuse keys in small partition slicing test 2019-03-06 15:48:42 +00:00
Paweł Dziepak
0eb1e570aa tests/perf_fast_forward: print number of iterations of each test 2019-03-06 15:48:38 +00:00
Duarte Nunes
a29ec4be76 Merge 'Update system.large_partitions during shutdown' from Rafael
"
Currently any large partitions found during shutdown are not
recorded. The reason is that the database commit log is already off,
so there is nowhere to record it to.

One possible solution is to have an independent system database. With
that the regular db is shutdown first and writes can continue to the
system db.

That is a pretty big change. It would also not allow us to record
large partitions in any system tables.

This patch series instead tries to stop the commit log later. With
that any large partitions are recorded to the log and moved to a
sstable on the next startup.
"

* 'espindola/shutdown-order-patches-v7' of https://github.com/espindola/scylla:
  db: stop the commit log after the tables during shutdown
  db: stop the compaction manager earlier
  db: Add a stop_database helper
  db: Don't record large partitions in system tables
2019-03-06 10:36:38 -03:00
Rafael Ávila de Espíndola
765d8535f1 db: Add a stop_database helper
This reduces code duplication. A followup patch will add more code to
stop_database.

Signed-off-by: Rafael Ávila de Espíndola <espindola@scylladb.com>
2019-03-05 18:04:45 -08:00
Tomasz Grabiec
c584f48c32 Merge "transport: sort bound ranges in read reques in order to conform to cql definitions" from Eliran
According to the cql definitions, if no ORDER BY clause is present,
records should be returned ordered by the clustering keys. Since the
backend returns the ranges according to their order of appearance
in the request, the bounds should be sorted before sending it to the
backend. This kind of sorting is needed in queries that generates more
than one bound to be read, examples to such queris are:
1. a SELECT query with an IN clause.
2. a SELECT query on a mixed order tupple of columns (see #2050).
The assumption this commit makes is the correctness of the bounds
list, that is, the bounds are non overlapping. If this wasn't true, multiple
occurences of the same reccord could have returned for certain queries.

Tests:
1. Unit tests release
2. All dtest that requires #2050 and #2029

Fixes #2029
2019-03-05 21:07:15 +01:00
Avi Kivity
3cfbd682ec Merge "Add JSON support to tuples and UDT" from Piotr
"
Fixes #3708

This series adds JSON serialization and deserialization procedures
to tuples and user defined types.

Tests: unit (dev)
"

* 'add_tuple_and_udt_json_support_2' of https://github.com/psarna/scylla:
  tests: add test cases for JSON and UDT
  types: add JSON support to UDT
  tests: add JSON tuple tests
  types: add JSON support for tuples
2019-03-05 20:06:15 +02:00
Piotr Sarna
a5c66d5ce1 tests: add test cases for JSON and UDT 2019-03-05 16:25:18 +01:00
Piotr Sarna
c2064d152d tests: add JSON tuple tests 2019-03-05 16:08:05 +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
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
Eliran Sinvani
eeb0845be0 unit test: validate order instead of just content in the mixed order token test
This change ammends on the functionality of the result generation,
it changes the behaviour to return the expected results vector sorted
in the expected order of appearance in the result set. Then the
result set is validated for both, content and also order.

Tests: unit tests (Release)
Signed-off-by: Eliran Sinvani <eliransin@scylladb.com>
2019-03-05 13:51:17 +02:00
Eliran Sinvani
13284d9272 unit test: change IN clause tests to validate with ordering_spec
Whenever a query with an IN clause on clustering keys is executed,
assuming only one partition, the rows are ordered according to the
clustering keys. This commit adds the order validation to the content
validation whenever possible (which means removing the
ignore order part).

Tests: unit tests (Release)
Signed-off-by: Eliran Sinvani <eliransin@scylladb.com>
2019-03-05 13:51:17 +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
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
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
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