Commit Graph

28732 Commits

Author SHA1 Message Date
Botond Dénes
18599f26fa mutation_writer/partition_based_splitting_writer: add memtable-based segregator
The current method of segregating partitions doesn't work well for huge
number of small partitions. For especially bad input, it can produce
hundreds or even thousands of buckets. This patch adds a new segregator
specialized for this use-case. This segregator uses a memtable to sort
out-of-order partitions in-memory. When the memtable size reaches the
provided max-memory limit, it is flushed to disk and a new empty one is
created. In-order partitions bypass the sorting altogether and go to the
fast-path bucket.

The new method is not used yet, this will come in the next patch.
2021-11-02 08:23:16 +02:00
Avi Kivity
bd0b573a92 Merge 'Partition based splitting writer exception safety' from Botond Dénes
The partition based splitting writer (used by scrub) was found to be exception-unsafe, converting an `std::bad_alloc` to an assert failure. This series fixes the problem and adds a unit test checking the exception safety against `std::bad_alloc`:s fixing any other related problems found.

Fixes: https://github.com/scylladb/scylla/issues/9452

Closes #9453

* github.com:scylladb/scylla:
  test: mutation_writer_test: add exception safety test for segregate_by_partition()
  mutation_writer: segregate_by_partition(): make exception safe
  mutation_reader: queue_reader_handle: make abandoned() exception safe
  mutation_writer: feed_writers(): make it a coroutine
  mutation_writer: partition_based_splitting_writer: erase old bucket if we fail to create replacement
2021-10-31 21:15:19 +02:00
Takuya ASADA
c9499230c3 docker: add stopwaitsecs
We need stopwaitsecs just like we do TimeoutStpSec=900 on
scylla-server.service, to avoid timeout on scylla-server shutdown.

Fixes #9485

Closes #9545
2021-10-31 20:38:10 +02:00
Vlad Zolotarov
79b0654d60 time_window_compaction_strategy: put expired sstables in a separate compaction task
It's much more efficient to have a separate compaction task that consists
completely from expired sstables and make sure it gets a unique "weight" than
mixing expired sstables with non-expired sstables adding an unpredictable
latency to an eviction event of an expired sstable.

This change also improves the visibility of eviction events because now
they are always going to appear in the log as compactions that compact into
an empty set.

Fixes #9533

Signed-off-by: Vlad Zolotarov <vladz@scylladb.com>

Closes #9534
2021-10-31 17:54:40 +02:00
Nadav Har'El
6ae0ea0c48 alternator: return the correct Content-Type header
Although the DynamoDB API responses are JSON, additional conventions apply
to these responses - such as how error codes are encoded in JSON. For this
reason, DynamoDB uses the content type `application/x-amz-json-1.0` instead
of the standard `application/json` in its responses.

Until this patch, Scylla used `application/json` in its responses. This
unexpected content-type didn't bother any of the AWS libraries which we
tested, but it does bother the aiodynamo library (see HENNGE/aiodynamo#27).

Moreover, we should return the x-amz-json-1.0 content type for future
proofing: It turns out that AWS already defined x-amz-json-1.1 - see:
https://awslabs.github.io/smithy/1.0/spec/aws/aws-json-1_1-protocol.html
The 1.1 content type differs (only) in how it encodes error replies.
If one day DynamoDB starts to use this new reply format (it doesn't yet)
and if DynamoDB libraries will need to differenciate between the two
reply formats, Alternator better return the right one.

This patch also includes a new test that the Content-Type header is
returned with the expected value. The test passes on DynamoDB, and
after this patch it starts to pass on Alternator as well.

Fixes #9554.

Signed-off-by: Nadav Har'El <nyh@scylladb.com>
Message-Id: <20211031094621.1193387-1-nyh@scylladb.com>
2021-10-31 10:50:25 +01:00
Raphael S. Carvalho
2bf47c902e cql: set configurable restriction of DateTieredCompactionStrategy to warn by default
Setting a value of "warn" will still allow the create or alter commands,
but will warn the user, with a message that will appear both at the log
and also at cqlsh for example.

This is another step towards deprecating DTCS. Users need to know we're
moving towards this direction, and setting the default value to warn
is needed for this. Next step is to set it to false, and finally remove
it from the code base.

Refs #8914.

Signed-off-by: Raphael S. Carvalho <raphaelsc@scylladb.com>
Message-Id: <20211029184503.102936-1-raphaelsc@scylladb.com>
2021-10-31 09:28:17 +02:00
Nadav Har'El
034f79cfb4 alternator: make api_error an std::exception
Objects of type "api_error" are used in Alternator when throwing an
error which will be reported as-is to the user as part of the official
DynamoDB protocol.

Although api_error objects are often thrown, the api_error class was not
derived from std::exception, because that's not necessary in C++.
However, it is *useful* for this exception to derive from std::except,
so this is what this patch does. It is useful for api_error to inherit
from std::exception because then our logging and debugging code knows
how to print this exception with all its details. All we need to do is
to implement a what() virtual function for api_error.

Before this patch, logging an api_error just logs the type's name
(i.e., the string "api_error"). After this patch, we get the full
information stored in the api_error - the error's type and its message.

Signed-off-by: Nadav Har'El <nyh@scylladb.com>
Message-Id: <20211017150555.225464-1-nyh@scylladb.com>
2021-10-29 10:23:55 +03:00
Nadav Har'El
666017f2f0 Merge 'Convert last uses of sprint() to fmt::format()' from Avi Kivity
sprint() uses the printf-style formatting language while most of our
code uses the Python-derived format language from fmt::format().

The last mass conversion of sprint() to fmt (in 1129134a4a)
missed some callers (principally those that were on multiple lines, and
so the automatic converter missed them). Convert the remainder to
fmt::format(), and some sprintf() and printf() calls, so we have just
one format language in the code base. Seastar::sprint() ought to be
deprecated and removed.

Test: unit (dev)

Closes #9529

* github.com:scylladb/scylla:
  utils: logalloc: convert debug printf to fmt::print()
  utils: convert fmt::fprintf() to fmt::print()
  main: convert fprint() to fmt::print()
  compress: convert fmt::sprintf() to fmt::format()
  tracing: replace seastar::sprint() with fmt::format()
  thrift: replace seastar::sprint() with fmt::format()
  test: replace seastar::sprint() with fmt::format()
  streaming: replace seastar::sprint() with fmt::format()
  storage_service: replace seastar::sprint() with fmt::format()
  repair: replace seastar::sprint() with fmt::format()
  redis: replace seastar::sprint() with fmt::format()
  locator: replace seastar::sprint() with fmt::format()
  db: replace seastar::sprint() with fmt::format()
  cql3: replace seastar::sprint() with fmt::format()
  cdc: replace seastar::sprint() with fmt::format()
  auth: replace seastar::sprint() with fmt::format()
2021-10-28 22:33:23 +03:00
Piotr Sarna
0b11771731 alternator: decouple auth from CQL query processor
Alternator auth module used to piggy-back on top of CQL query processor
to retrieve authentication data, but it's no longer the case.
Instead, storage proxy is used directly.

Closes #9538
2021-10-28 21:55:56 +03:00
Benny Halevy
a2fc3345bd storage_service: futurize storage_service::describe_ring
Convert storage_service::describe_ring to a coroutine
to prevent reactor stalls as seen in #9280.

Fixes #9280
Closes #9282

Signed-off-by: Benny Halevy <bhalevy@scylladb.com>

Closes #9282
2021-10-28 16:51:57 +03:00
Avi Kivity
1e1e4f4934 Update abseil submodule
* abseil 9c6a50f...f70eada (122):
  > Fix over-aligned layout test with older gcc compilers (#1049)
  > Export of internal Abseil changes
  > Initial support for Haiku (#1045)
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Remove bazelbuild/rules_cc dependency (#1038)
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Use FreeBSD macro definition for ElfW macro for compatibility. (#1037)
  > Export of internal Abseil changes
  > Fix hashing on big endian platforms (#1028)
  > Fix typedef of sig_t on AIX (#1030)
  > Export of internal Abseil changes
  > Fixed typo `constuct` to `construct` in 3 places. (#1022)
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Initial support for AIX (#1021)
  > Export of internal Abseil changes
  > Update from_chars documentation with regard to whitespace (#1020)
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Include immintrin.h instead of wmmintrin.h (#1015)
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Add -Wno-unknown-warning-option to ABSL_LLVM_FLAGS to disable warnings on unknown warning flags. (#1008)
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Add missing ABSL_DLL for a few functions (#1002)
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Simplifies the construction of the value returned by GenerateRealFromBits() (#994)
  > CMake: option to use cxx_std_11 (minimum) that propagates. (#986)
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Fix Bazel build on aarch64 (#984)
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > CMake: add option to use Google Test already installed on system (#969)
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Use CMAKE_INSTALL_FULL_{LIBDIR,INCLUDEDIR}. (#963)
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Uses alignas for portability in dynamic_annotations.h (#947)
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Call FailureSignalHandlerOptions.writenfn with nullptr at the end (#938)
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Add missing `add_subdirectory()` call for "cleanup" (#925)
  > Allowing to change the MSVC runtime (#921)
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Fix C++/CLI build problem (#916)
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Add support for more Linux architectures (#904)
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Add support for m68k (#900)
  > Add support for sparc and sparc64 (#899)
  > Fix uc_mcontext register access on 32-bit PowerPC (#898)
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Export of internal Abseil changes
  > Export of internal Abseil changes
2021-10-28 16:22:18 +03:00
Benny Halevy
531e32957d compaction: time_window_compaction_strategy: get_reshaping_job: consider disjointness only when trimming
With 062436829c,
we return all input sstables in strict mode
if they are dosjoint even if they don't need reshaping at all.

This leads to an infinite reshape loop when uploading sstables
with TWCS.

The optimization for disjoint sstables is worth it
also in relaxed mode, so this change first makes sorting of the input
sstables by first_key order independent of reshape_mode,
and then it add a check for sstable_set_overlapping_count
before trimming either the multi_window vector or
any single_window bucket such that we don't trim the list
if the candidates are disjoint.

Adjust twcs_reshape_with_disjoint_set_test accordingly.

And also add some debug logging in
time_window_compaction_strategy::get_reshaping_job
so one can figure out what's going on there.

Test: unit(dev)
DTest: cdc_snapshot_operation.py:CDCSnapshotOperationTest.test_create_snapshot_with_collection_list_with_base_rows_delete_type

Signed-off-by: Benny Halevy <bhalevy@scylladb.com>
Message-Id: <20211025071828.509082-1-bhalevy@scylladb.com>
2021-10-28 14:35:51 +03:00
Pavel Emelyanov
3c0a48ac38 Merge 'cdc stream generation: dont abandon stream description rewrite future' from Avi Kivity
The cdc stream rewrite code launches work in the backround. It's careful
to make sure all the dependencies are preserved via shared pointers, but
there are implicit dependencies (system_keyspace) that are not. To fix this
problem, this series changes the lifetime of the background work from
unbounded to be bounded by the lifetime of storage_service.

[ xemul: Not the storage_service, but the cdc_generation_service, now
  all the dances with rewriting and its futures happen inside the cdc
  part. Storage_service coroutinization and call to .stop() from main
  are here for several reasons
   - They are awseome
   - Splitting a PR into two is frustrating (as compared to ML threads)
   - Shia LaBeouf is good motivation speaker
]

As explained in the patches, I don't expect this to be a real problem and the
series just paves the way for making system_keyspace an explicit
dependency.

Test: unit (dev)

Closes #9356

* github.com:scylladb/scylla:
  cdc: don't allow background streams description rewrite to delay too far
  storage_service: coroutinize stop()
  main: stop storage_service on shutdown
2021-10-28 12:36:36 +03:00
Botond Dénes
7c95bd3343 Merge 'Rename 'system.status' and 'system.describe_ring' virtual tables' from Avi Kivity
'system.status' and 'system.describe_ring' are imperfect names for
what they do, so rename them. Fortunately they aren't exposed in any
released version so there is no compatibility concern.

Closes #9530

* github.com:scylladb/scylla:
  system_keyspace: rename 'system.describe_ring' to 'system.token_ring'
  system_keyspace: rename 'system.status' to 'system.cluster_status'
2021-10-28 11:46:20 +03:00
Avi Kivity
c30be50252 utils: logalloc: convert debug printf to fmt::print()
Standardize on one format language.
2021-10-28 10:48:08 +03:00
Takuya ASADA
13ffe3c094 scylla_util.py: detect ephemeral/EBS disks correctly on Nitro System
Currently, aws_instance.ephemeral_disks() returns both ephemeral disks
and EBS disks on Nitro System.
This is because both are attached as NVMe disks, we need to add disk
type detection code on NVMe handle logic.

Fixes #9440

Closes #9462
2021-10-28 08:58:25 +03:00
Piotr Sarna
f4cb8191fa cql3: include system distributed tables in system stats
Some time ago we started gathering stats for system tables in a separate
class in order to be able to distinguish which queries come from the
user - e.g. if the unpaged queries are internal or not.
Originally, only local system tables were moved into this class,
i.e. system and system_schema. It would make sense, however, to also
include other internal keyspaces in this separate class - which includes
system_distributed, system_traces, etc.

Fixes #9380

Closes #9490
2021-10-28 08:58:25 +03:00
Avi Kivity
5e6e4aed53 Merge 'Add Scylla Sphinx Theme 1.0' from David Garcia
Replaces https://github.com/scylladb/scylla/pull/9477

Related issue https://github.com/scylladb/sphinx-scylladb-theme/issues/133

Sphinx ScyllaDB Theme 1.0 is now released 🥳

We’ve made a number of updates to the look and feel of the theme to improve the overall user experience.
You can read more about all notable changes [here](https://sphinx-theme.scylladb.com/stable/CHANGELOG#september-2021).

This PR also cleans the file ``conf.py``, removing several unsued options.

1. Clone this PR. For more information, see [Cloning pull requests locally](https://docs.github.com/en/github/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally).

2. Enter the docs folder, and run:

```
make preview
````

3. Open http://127.0.0.1:5500/ with your favorite browser. You will see the docs with the new look and feel.

Closes #9515

* github.com:scylladb/scylla:
  Review docs config
  fix runtime errors
  upgrade theme to v1.x
2021-10-28 08:58:25 +03:00
Raphael S. Carvalho
affa1d9b04 utils/estimated_histogram.hh: fix division-by-zero in mean()
if mean() is called when there are no elements in the histogram,
a runtime error will happen due to division-by-zero.
approx_exponential_histogram::mean() handles it but for some
reason we forgot to do the same for estimated_histogram.

this problem was found when adding an unit test which calls
mean() in an empty histogram.

Fixes #9531.

Signed-off-by: Raphael S. Carvalho <raphaelsc@scylladb.com>
Message-Id: <20211027142813.56969-1-raphaelsc@scylladb.com>
2021-10-28 08:58:25 +03:00
Benny Halevy
b79e9b7396 tools: scylla-sstable: improve error reporting when loading schema from file
Throw a proper exception from do_load_schemas if parse_statements
fails to parse the schema cql.

Catch it in scylla-sstable main() function so
it won't be reported as seastar - unhandled exception.

Signed-off-by: Benny Halevy <bhalevy@scylladb.com>
Message-Id: <20211027124032.1787347-1-bhalevy@scylladb.com>
2021-10-28 08:58:25 +03:00
Avi Kivity
5ea0940ca9 system_keyspace: rename 'system.describe_ring' to 'system.token_ring'
Table names are usually nouns, so SELECT/INSERT statements
sound natural: "SELECT * FROM pets". 'system.describe_ring' defies
this convention. Rename it to 'system.token_ring' so selects are natural.

The name is not in any released version, so we can safely rename it.
2021-10-27 17:32:37 +03:00
Avi Kivity
5b21e4eb83 system_keyspace: rename 'system.status' to 'system.cluster_status'
'system.status' is too generic, it doesn't explain the status of what.
'system.node_status' is also ambiguous (this node? all nodes?) so I
picked 'system.cluster_status'.

The internal name, nodetool_status_table, was even worse (we're
not querying the status of nodetool!) but fortunately wasn't exposed.

The name is not in any released version, so we can safely rename it.
2021-10-27 17:31:45 +03:00
Avi Kivity
379454c235 utils: convert fmt::fprintf() to fmt::print()
Standardizing on a common format language.
2021-10-27 17:02:00 +03:00
Avi Kivity
7bcc0b8d8b main: convert fprint() to fmt::print()
fprint() is obsolete.
2021-10-27 17:02:00 +03:00
Avi Kivity
0131ae6b5d compress: convert fmt::sprintf() to fmt::format()
Standardize on one format language.
2021-10-27 17:02:00 +03:00
Avi Kivity
3a0f2091d7 tracing: replace seastar::sprint() with fmt::format()
sprint() is obsolete.
2021-10-27 17:02:00 +03:00
Avi Kivity
d1616a7643 thrift: replace seastar::sprint() with fmt::format()
sprint() is obsolete. Note InvalidRequestException used sprint() with
runtime format, so both it and its callers were updated.
2021-10-27 17:02:00 +03:00
Avi Kivity
27a2c74b64 test: replace seastar::sprint() with fmt::format()
sprint() is obsolete.
2021-10-27 17:02:00 +03:00
Avi Kivity
7abd105d79 streaming: replace seastar::sprint() with fmt::format()
sprint() is obsolete.
2021-10-27 17:02:00 +03:00
Avi Kivity
16f2eadfd0 storage_service: replace seastar::sprint() with fmt::format()
sprint() is obsolete.
2021-10-27 17:02:00 +03:00
Avi Kivity
2fb406138c repair: replace seastar::sprint() with fmt::format()
sprint() is obsolete.
2021-10-27 17:02:00 +03:00
Avi Kivity
bfa4535ba5 redis: replace seastar::sprint() with fmt::format()
sprint() is obsolete.
2021-10-27 17:02:00 +03:00
Avi Kivity
36919a4ed7 locator: replace seastar::sprint() with fmt::format()
sprint() is obsolete.
2021-10-27 17:02:00 +03:00
Avi Kivity
d9d03383fa db: replace seastar::sprint() with fmt::format()
sprint() is obsolete.
2021-10-27 17:02:00 +03:00
Avi Kivity
9424f6e12f cql3: replace seastar::sprint() with fmt::format()
sprint() is obsolete. Note some calls where to helper functions that
use sprint(), not to sprint() directly, so both the helpers and
the callers were modified.
2021-10-27 17:02:00 +03:00
Avi Kivity
6b02aa72e2 cdc: replace seastar::sprint() with fmt::format()
sprint() is obsolete.
2021-10-27 14:30:06 +03:00
Avi Kivity
b9cc9bad4c auth: replace seastar::sprint() with fmt::format()
sprint() is obsolete.
2021-10-27 14:29:32 +03:00
Botond Dénes
9ec55e054d treewide: distinguish truncated frame errors
We have two identical "Truncated frame" errors, at:
* read_frame_size() in serialization_visitors.hh;
* cql_server::connection::read_and_decompress_frame() in
  transport/server.cc;

When such an exception is thrown, it is impossible to tell where was it
thrown from and it doesn't have any further information contained in it
(beyond the basic information it being thrown implies).
This patch solves both problems: it makes the exception messages unique
per location and it adds information about why it was thrown (the
expected vs. real size of the frame).

Ref: #9482

Closes #9520
2021-10-27 12:27:16 +02:00
Alejo Sanchez
0a63e72fa4 api: (minor) fix typo bool instead of boolean
In definition for /column_family/major_compaction/{name} there is an
incorrect use of "bool" instead of "boolean".

Signed-off-by: Alejo Sanchez <alejo.sanchez@scylladb.com>

Closes #9516
2021-10-27 12:25:59 +02:00
Benny Halevy
a21b1fbb2f large_data_handle: add sstable name to log messages
Although the sstable name is part of the system.large_* records,
it is not printed in the log.
In particular, this is essential for the "too many rows" warning
that currently does not record a row in any large_* table
so we can't correlate it with a sstable.

Fixes #9524

Test: unit(dev)
DTest: wide_rows_test.py

Signed-off-by: Benny Halevy <bhalevy@scylladb.com>
Message-Id: <20211027074104.1753093-1-bhalevy@scylladb.com>
2021-10-27 10:53:11 +03:00
Botond Dénes
6a76e12768 mutation_partition: row: make row marker shadowing symmetric
Currently row marker shadowing the shadowable tombstone is only checked
in `apply(row_marker)`. This means that shadowing will only be checked
if the shadowable tombstone and row marker are set in the correct order.
This at the very least can cause flakyness in tests when a mutation
produced just the right way has a shadowable tombstone that can be
eliminated when the mutation is reconstructed in a different way,
leading to artificial differences when comparing those mutations.

This patch fixes this by checking shadowing in
`apply(shadowable_tombstone)` too, making the shadowing check symmetric.

There is still one vulnerability left: `row_marker& row_marker()`, which
allow overwriting the marker without triggering the corresponding
checks. We cannot remove this overload as it is used by compaction so we
just add a comment to it warning that `maybe_shadow()` has to be manually
invoked if it is used to mutate the marker (compaction takes care of
that). A caller which didn't do the manual check is
mutation_source_test: this patch updates it to use `apply(row_marker)`
instead.

Fixes: #9483

Tests: unit(dev)

Closes #9519
2021-10-26 20:40:31 +02:00
Benny Halevy
5f513ed28b view_builder: consumer: flush_fragments: close reader on error
Make sure to close the reader created by flush_fragments
if an exception occurs before it's moved to `populate_views`.

Note that it is also ok to close the reader _after_ it has been
moved, in case populate_views itself throws after closing the
reader that was moved it.  For conveience flat_mutation_reader::close
supports close-after-move.

Fixes #9479

Signed-off-by: Benny Halevy <bhalevy@scylladb.com>
Message-Id: <20211024164138.1100304-1-bhalevy@scylladb.com>
2021-10-24 19:53:31 +03:00
Benny Halevy
4062cd17e0 test: hashers_test: mutation_fragment_sanity_check: stop semaphore
To stop the semaphore as required we need run
the test in a seastar thread.

Signed-off-by: Benny Halevy <bhalevy@scylladb.com>
Message-Id: <20211024053402.990142-1-bhalevy@scylladb.com>
2021-10-24 11:29:23 +03:00
David Garcia
ff56b7e43e Review docs config 2021-10-22 13:34:56 +01:00
Botond Dénes
0d744fd3fa test: mutation_writer_test: add exception safety test for segregate_by_partition() 2021-10-21 06:50:22 +03:00
Botond Dénes
2ca6552909 mutation_writer: segregate_by_partition(): make exception safe
Close reader if feed_writer() fails in the setup phase.
2021-10-21 06:50:22 +03:00
Botond Dénes
6c8e98e33d mutation_reader: queue_reader_handle: make abandoned() exception safe
Allocating the exception might fail, terminating the application as
`abandoned()` is called in a noexcept context. Handle this case by
catching the bad-alloc and aborting the reader with that instead when
this happens.
2021-10-21 06:50:22 +03:00
Botond Dénes
de55ab571b mutation_writer: feed_writers(): make it a coroutine
The current code leaks exceptional futures. Instead of attempting to
fix, just convert to cleaner and exception-safe coroutines.
2021-10-21 06:50:22 +03:00
Botond Dénes
40ca728a20 mutation_writer: partition_based_splitting_writer: erase old bucket if we fail to create replacement
So we don't attempt to close already closed bucket again in
`partition_based_splitting_writer::close()`.
2021-10-21 06:50:22 +03:00
Michał Radwański
9caf85f64a partition_snapshot_reader: do not accidentally copy schema
Functions `upper_bound` and `lower_bound` had signatures:
```
template<typename T, typename... Args>
static rows_iter_type lower_bound(const T& t, Args... args);
```
This caused a dacay from `const schema&` to `schema` as one of the args,
which in turn copied the schema in a fair number of the queries. Fix
that by setting the parameter type to `Args&&`, which doesn't discard
the reference.

Fixes #9502

Closes #9507
2021-10-20 19:09:08 +03:00