Commit Graph

39348 Commits

Author SHA1 Message Date
Anna Mikhlin
24efacf90d release: prepare for 5.4.0-rc1 scylla-5.4.0-rc1 2023-10-26 22:44:14 +03:00
David Garcia
1639a468df docs: add latest option to aws_images extension
rollback only latest

Closes scylladb/scylladb#15651

(cherry picked from commit 51466dcb23)
2023-10-26 13:10:44 +03:00
Anna Stuchlik
a0766ac236 doc: fix the Reference page layout
This commit fixes the layout of the Reference
page. Previously, the toctree level was "2",
which made the page hard to navigate.
This PR changes the level to "1".

In addition, the capitalization of page
titles is fixed.

This is a follow-up PR to the ones that
created and updated the Reference section.
It must be backported to branch-5.4.

Closes scylladb/scylladb#15830

(cherry picked from commit e223624e2e)
2023-10-26 11:30:15 +03:00
Botond Dénes
fa0f382a82 Merge 'Initialize datadir for system and non-system keyspaces the same way' from Pavel Emelyanov
When populating system keyspace the sstable_directory forgets to create upload/ subdir in the tables' datadir because of the way it's invoked from distributed loader. For non-system keyspaces directories are created in table::init_storage() which is self-contained and just creates the whole layout regardless of what.

This PR makes system keyspace's tables use table::init_storage() as well so that the datadir layout is the same for all on-disk tables.

Test included.

fixes: #15708
closes: scylladb/scylla-manager#3603

Closes scylladb/scylladb#15723

* github.com:scylladb/scylladb:
  test: Add test for datadir/ layout
  sstable_directory: Indentation fix after previous patch
  db,sstables: Move storage init for system keyspace to table creation

(cherry picked from commit 7f81957437)
2023-10-25 12:13:03 +03:00
Anna Stuchlik
37fd8a4c36 doc:remove upgrade guides for unsupported versions
This commit:
- Removes upgrade guides for versions older than 5.0.
  The oldest one is from version 4.6 to 5.0.
- Adds the redirections for the removed pages.

Closes scylladb/scylladb#15709
scylla-5.4.0-rc0
2023-10-19 10:00:23 +03:00
Yaron Kaikov
83f7d0073a release: prepare for 5.4.0-rc0 2023-10-18 14:38:53 +03:00
Kefu Chai
203f41dc99 sstable: improve descriptions of capped.*deletion_time
before this change, they reads

> Was local deletion time capped at ...

and

> Was partition tombstone deletion time capped at ...

the "Was" part is confusing. and the first description is not
accurate enough. so let's improve them a little bit.

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>

Closes scylladb/scylladb#15108
2023-10-18 09:40:02 +03:00
Kefu Chai
9bc0a9f95e mutation: do not include unused header
the `utils::UUID` class is not used by the implementation of
`canonical_mutation`, so let's remove the include from this source file.

the `#include` was originally added in
5a353486c6, but that commit did
add any code using UUID to this file.

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>

Closes scylladb/scylladb#15731
2023-10-17 20:38:07 +03:00
Avi Kivity
dfffc022da Merge 'doc: doc: remove recommended image upgrade with OS from previous releases' from Anna Stuchlik
This commit removes the information about the recommended way of upgrading ScyllaDB images - by updating ScyllaDB and OS packages in one step. This upgrade procedure is not supported (it was implemented, but then reverted).

The scope of this commit:

- Remove the information from the 5.0-to.-5.1 upgrade guide and replace with general info.
- Remove the information from the 4.6-to.-5.1 upgrade guide and replace with general info.
- Remove the information from the 5.x.y-to.-5.x.z upgrade guide and replace with general info.
- Remove the following files as no longer necessary (they were only created to incorporate the (invalid) information about image upgrade into the upgrade guides.
     /upgrade/_common/upgrade-image-opensource.rst
    /upgrade/_common/upgrade-guide-v5-patch-ubuntu-and-debian-p1.rst
    /upgrade/_common/upgrade-guide-v5-patch-ubuntu-and-debian-p2.rst
    /upgrade/_common/upgrade-guide-v5-patch-ubuntu-and-debian.rst

This PR is a continuation of https://github.com/scylladb/scylladb/pull/15739.

**This PR must be backported to branch-5.2 and branch-5.1.**

Closes scylladb/scylladb#15740

* github.com:scylladb/scylladb:
  doc: remove wrong image upgrade info (5.x.y-to-5.x.y)
  doc: remove wrong image upgrade info (4.6-to-5.0)
  doc: remove wrong image upgrade info (5.0-to-5.1)
2023-10-17 18:29:36 +03:00
Anna Stuchlik
9d9fe57efa doc: remove recommended image upgrade with OS
This commit removes the information about
the recommended way of upgrading ScyllaDB
images - by updating ScyllaDB and OS packages
in one step.
This upgrade procedure is not supported
(it was implemented, but then reverted).

The scope of this commit:
- Remove the information from the 5.1-to.-5.2
  upgrade guide and replace with general info.
- Remove the information from the Image Upgrade
  page.
- Remove outdated info (about previous releases)
  from the Image Upgrade page.
- Rename "AMI Upgrade" as "Image Upgrade"
  in the page tree.

Refs: https://github.com/scylladb/scylladb/issues/15733

Closes scylladb/scylladb#15739
2023-10-17 18:28:52 +03:00
Avi Kivity
f42eb4d1ce Merge 'Store and propagage GC timestamp markers from commitlog' from Calle Wilund
Fixes #14870

(Originally suggested by @avikivity). Use commit log stored GC clock min positions to narrow compaction GC bounds.
(Still requires augmented manual flush:es with extensive CL clearing to pass various dtest, but this does not affect "real" execution).

Adds a lowest timestamp of GC clock whenever a CF is added to a CL segment the first time. Because GC clock is wall
clock time and only connected to TTL (not cell/row timestamps), this gives a fairly accurate view of GC low bounds
per segment. This is then (in a rather ugly way) propagated to tombstone_gc_state to narrow the allowed GC bounds for
a CF, based on what is currently left in CL.

Note: this is a rather unoptimized version - no caching or anything. But even so, should not be excessively expensive,
esp. since various other code paths already cache the results.

Closes scylladb/scylladb#15060

* github.com:scylladb/scylladb:
  main/cql_test_env: Augment compaction mgr tombstone_gc_state with CL GC info
  tombstone_gc_state: Add optional callback to augment GC bounds
  commitlog: Add keeping track of approximate lowest GC clock for CF entries
  database: Force new commitlog segment on user initiated flush
  commitlog: Add helper to force new active segment
2023-10-17 18:27:43 +03:00
Anna Stuchlik
7718f76ecd doc: remove outdated info from Materialized Views
This commit removes outdated info from
the Materialized Views page:

- The reference to the outated blog post.
- Irrelevant information about versions.

Fixes https://github.com/scylladb/scylladb/issues/15725

Closes scylladb/scylladb#15742
2023-10-17 18:26:54 +03:00
Anna Stuchlik
dd1207cabb doc: remove wrong image upgrade info (5.x.y-to-5.x.y)
This commit removes the invalid information about
the recommended way of upgrading ScyllaDB
images (by updating ScyllaDB and OS packages
in one step) from the 5.x.y-to-5.x.y upgrade guide.
This upgrade procedure is not supported (it was
implemented, but then reverted).

Refs https://github.com/scylladb/scylladb/issues/15733

In addition, the following files are removed as no longer
necessary (they were only created to incorporate the (invalid)
information about image upgrade into the upgrade guides.

/upgrade/_common/upgrade-image-opensource.rst
/upgrade/_common/upgrade-guide-v5-patch-ubuntu-and-debian-p1.rst
/upgrade/_common/upgrade-guide-v5-patch-ubuntu-and-debian-p2.rst
/upgrade/_common/upgrade-guide-v5-patch-ubuntu-and-debian.rst
2023-10-17 16:48:51 +02:00
Anna Stuchlik
526d543b95 doc: remove wrong image upgrade info (4.6-to-5.0)
This commit removes the invalid information about
the recommended way of upgrading ScyllaDB
images (by updating ScyllaDB and OS packages
in one step) from the 4.6-to-5.0 upgrade guide.
This upgrade procedure is not supported (it was
implemented, but then reverted).

Refs https://github.com/scylladb/scylladb/issues/15733
2023-10-17 16:28:19 +02:00
Anna Stuchlik
9852130c5b doc: remove wrong image upgrade info (5.0-to-5.1)
This commit removes the invalid information about
the recommended way of upgrading ScyllaDB
images (by updating ScyllaDB and OS packages
in one step) from the 5.0-to-5.1 upgrade guide.
This upgrade procedure is not supported (it was
implemented, but then reverted).

Refs https://github.com/scylladb/scylladb/issues/15733
2023-10-17 16:04:16 +02:00
Kefu Chai
77b96f7748 main.cc: do not cast hours to milliseconds
there is no need to explicitly cast an instance of
std::chrono::hours to std::chrono::milliseconds to feed it to a
function which expects std::chrono::milliseconds. the constructor
of of std::chrono::milliseconds is able to do this convert and
create a new instance of std::chrono::milliseconds from another.
std::chrono::duration<> instance.

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>

Closes scylladb/scylladb#15734
2023-10-17 17:02:45 +03:00
Kamil Braun
7dcee7de02 test/pylib: implement expected_error for decommission and removenode
You can now pass `expected_error` to `ManagerClient.decommission_node`
and `ManagerClient.remove_node`. Useful in combination with error
injections, for example.

Closes scylladb/scylladb#15650
2023-10-17 16:25:43 +03:00
Calle Wilund
3378c246f7 main/cql_test_env: Augment compaction mgr tombstone_gc_state with CL GC info
Fixes #14870 (yet another alternative solution)

(Originally suggested by @avikivity). Use store GC clock min positions from CL
to narrow compaction GC bounds.

Note: not optimized with caches or anything at this point. Can easily be added
though of course always somewhat risky.
2023-10-17 10:30:40 +00:00
Kefu Chai
031ff755ce test/sstable: verify sstables::parse_path()
check the behavior of sstables::parse_path().
for better test coverage of this function.

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>

Closes scylladb/scylladb#15659
2023-10-17 13:28:58 +03:00
Calle Wilund
43a7d83fd0 tombstone_gc_state: Add optional callback to augment GC bounds
Allows potentially narrowing of GC time bounds.
2023-10-17 10:26:41 +00:00
Calle Wilund
560d3c17f0 commitlog: Add keeping track of approximate lowest GC clock for CF entries
Adds a lowest timestamp of GC clock whenever a CF is added to a CL segment
first. Because GC clock is wall clock time and only connected to TTL (not
cell/row timestamps), this gives a fairly accurate view of GC low bounds
per segment.

Includes of course a function to get the all-segment lowest per CF.
2023-10-17 10:26:41 +00:00
Calle Wilund
2429cf656c database: Force new commitlog segment on user initiated flush
Helper for tools - ensures that tests which use nodetool flush
to force data to sstables also remove as much as possible from
commitlog.
2023-10-17 10:26:40 +00:00
Calle Wilund
810d06946f commitlog: Add helper to force new active segment
When called, if active segment holds data, close and replace with pristine one.
2023-10-17 10:26:40 +00:00
Petr Gusev
39789b6527 main.cc: ARM build fix
This is a follow-up for #15720.

Closes scylladb/scylladb#15730
2023-10-17 13:17:32 +03:00
Takuya ASADA
58d94a54a3 scylla_raid_setup: faillback to other paths when UUID not avialable
On some environment such as VMware instance, /dev/disk/by-uuid/<UUID> is
not available, scylla_raid_setup will fail while mounting volume.

To avoid failing to mount /dev/disk/by-uuid/<UUID>, fetch all available
paths to mount the disk and fallback to other paths like by-partuuid,
by-id, by-path or just using real device path like /dev/md0.

To get device path, and also to dumping device status when UUID is not
available, this will introduce UdevInfo class which communicate udev
using pyudev.

Related #11359

Closes scylladb/scylladb#13803
2023-10-17 12:24:58 +03:00
Tomasz Grabiec
0aef0f900b Merge 'truncation records refactorings' from Petr Gusev
This PR contains several refactoring, related to truncation records handling in `system_keyspace`, `commitlog_replayer` and `table` clases:
* drop map_reduce from `commitlog_replayer`, it's sufficient to load truncation records from the null shard;
* add a check that `table::_truncated_at` is properly initialized before it's accessed;
* move its initialization after `init_non_system_keyspaces`

Closes scylladb/scylladb#15583

* github.com:scylladb/scylladb:
  system_keyspace: drop truncation_record
  system_keyspace: remove get_truncated_at method
  table: get_truncation_time: check _truncated_at is initialized
  database: add_column_family: initialize truncation_time for new tables
  database: add_column_family: rename readonly parameter to is_new
  system_keyspace: move load_truncation_times into distributed_loader::populate_keyspace
  commitlog_replayer: refactor commitlog_replayer::impl::init
  system_keyspace: drop redundant typedef
  system_keyspace: drop redundant save_truncation_record overload
  table: rename cache_truncation_record -> set_truncation_time
  system_keyspace: get_truncated_position -> get_truncated_positions
2023-10-17 10:55:30 +02:00
Raphael S. Carvalho
da04fea71e compaction: Fix key estimation per sstable to produce efficient filters
The estimation assumes that size of other components are irrelevant,
when estimating the number of partitions for each output sstable.
The sstables are split according to the data file size, therefore
size of other files are irrelevant for the estimation.

With certain data models, like single-row partitions containing small
values, the index could be even larger than data.
For example, assume index is as large as data, then the estimation
would say that 2x more sstables will be generated, and as a result,
each sstable are underestimated to have 2x less keys.

Fix it by only accounting size of data file.

Fixes #15726.

Signed-off-by: Raphael S. Carvalho <raphaelsc@scylladb.com>

Closes scylladb/scylladb#15727
2023-10-17 11:21:11 +03:00
Aleksandra Martyniuk
0ce9db2329 repair: throw abort_requested_exception when abort is requested
If abort is requsted during bootstrap then a node should exit normally.
To achieve so, abort_requested_exception should be thrown as main
handles it gracefully.

In data_sync_repair_task_impl::run exceptions from all shards are
wrapped together into std::runtime_exception and so they aren't
handled as they are supposed to.

Throw abort_requested_exception when shutdown was requested.
Throw abort_requested_exception also if repair::task_manager_module::is_aborted,
so that force_terminate_all_repair_sessions acts the same regardless
the state of the repair.

To maintain consistency do the same for user_requested_repair_task_impl.

Fixes: #15710.

Closes scylladb/scylladb#15722
2023-10-17 10:08:06 +03:00
Kefu Chai
19e724822d test.py: pass self.suite.scylla_env to pytest process
before this change, pytest does not populate its suites's
`scylla_env` down to the forked pytest child process. this works
if the test does not care about the env variables in `scylla_env`.
but object_store is an exception, as it launches scylla instances
by itself. so, without the help of `scylla_env`, `run.find_scylla()`
always find the newest file globbed by `build/*/scylla`. this is not
always what we expect. on the contrary, if we launch object_store's
pytest using `test.py`, there are good chances that object_store
ends up with testing a wrong scylla executable if we have multiple
builds under `build/*/scylla`.

so, in this change, we populate `self.suite.scylla_env` down to
the child process created by `PythonTest`, so that all pytest
based tests can have access to its suites's env variables.
in addition to 'SCYLLA' env variable, they also include the
the env variables required by LLVM code coverage instrumentation.
this is also nice to have.

Fixes #15679
Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>

Closes scylladb/scylladb#15682
2023-10-17 09:27:12 +03:00
Petr Gusev
9b1dfad51c main.cc: disable stall detector for debug ARM builds
The stall detector uses glibc backtrace function to
collect backtraces, this causes ASAN failures on ARM.
For now we just disable the stall detector in this
configuration, the ticket about migrating
to libunwind: scylladb/seastar#1878

We increase the value of blocked_reactor_notify_ms to
make sure the stall detector never fires.

Fixes #15389
Fixes #15090

Closes scylladb/scylladb#15720
2023-10-16 21:57:35 +03:00
Wojciech Mitros
055f061706 test: handle fast execution of test_user_function_filtering
Currently, when the test is executed too quickly, the timestamp
insterted into the 'my_table' table might be the same as the
timestamp used in the SELECT statement for comparison. However,
the statement only selects rows where the inserted timestamp
is strictly lower than current timestamp. As a result, when this
comparison fails, we may skip executing the following comparison,
which uses a user-defined function, due to which the statement
is supposed to fail with an error. Instead, the select statement
simply returns no rows and the test case fails.
To fix this, simply use the less or equal operator instead
of using the strictly less operator for comparing timestamps.

Fixes #15616

Closes scylladb/scylladb#15699
2023-10-12 17:04:43 +03:00
Tomasz Grabiec
accac7efd8 test: test_tablets.py: Enable verbose logging
This is in order to aid investigation of falkiness of the test, which
fails due to a timeout during scan after cluster restart in debug mode.

See #14746.

I enable trace-level logging for some scylla-side loggers and
inject logging of sent and received messages on the driver side.

Closes scylladb/scylladb#15696
2023-10-12 17:03:19 +03:00
Jan Ciolek
940e44f887 db/view: change log level of failed view updates to WARN
When a remote view update doesn't succeed there's a log message
saying "Error applying view update...".
This message had log level ERROR, but it's not really a hard error.
View updates can fail for a multitude of reasons, even during normal operation.
A failing view update isn't fatal, it will be saved as a view hint a retried later.

Let's change the log level to WARN. It's something that shouldn't happen too much,
but it's not a disaster either.
ERROR log level causes trouble in tests which assume that an ERROR level message
means that the test has failed.

Refs: https://github.com/scylladb/scylladb/issues/15046#issuecomment-1712748784

For local view updates the log level stays at "ERROR", local view updates shouldn't fail.

Signed-off-by: Jan Ciolek <jan.ciolek@scylladb.com>

Closes scylladb/scylladb#15640
2023-10-11 18:19:23 +03:00
Israel Fruchter
41c80929eb Update tools/cqlsh submodule
* tools/cqlsh 66ae7eac...426fa0ea (8):
  > Updated Scylla Driver[Issue scylladb/scylla-cqlsh#55]
  > copyutil: closing the local end of pipes after processes starts
  > setup.py: specify Cython language_level explicitly
  > setup.py: pass extensions as a list
  > setup.py: reindent block in else branch
  > setup.py: early return in get_extension()
  > reloc: install build==0.10.0
  > reloc: add --verbose option to build_reloc.sh

Fixes: https://github.com/scylladb/scylla-cqlsh/issues/37

Closes scylladb/scylladb#15685
2023-10-11 17:29:23 +03:00
Aleksandra Martyniuk
5a10bd44bf test_storage_service: use new_test_snapshot fixture
test_storage_service_keyspace_cleanup_with_no_owned_ranges
from test_storage_service.py creates snapshots with tags based
on current time. Thus if a test runs on the same node twice
with time distance short enough, there may be a name collision
between the snapshots from two runs. This will cause the second
run to fail on assertions.

Use new_test_snapshot fixture to drop snapshots after the test.

Delete my_snapshot_tags as it's no longer necessary.

Fixes: #15680.

Closes scylladb/scylladb#15683
2023-10-11 00:53:36 +03:00
Avi Kivity
35849fc901 Revert "Merge 'Don't calculate hashes for schema versions in Raft mode' from Kamil Braun"
This reverts commit 3d4398d1b2, reversing
changes made to 45dfce6632. The commit
causes some schema changes to be lost due to incorrect timestamps
in some mutations. More information is available in [1].

Reopens: scylladb/scylladb#7620
Reopens: scylladb/scylladb#13957

Fixes scylladb/scylladb#15530.

[1] https://github.com/scylladb/scylladb/pull/15687
2023-10-11 00:32:05 +03:00
Kamil Braun
05ede7a042 test/pylib: always return a response from put_json
In 20ff2ae5e1 mutating endpoints were
changed to use PUT. But some of them return a response, and I forgot to
provide `response_type` parameter to `put_json` (which causes
`RESTClient` to actually obtain the response). These endpoints now
return `None`.

Fix this.

Closes scylladb/scylladb#15674
2023-10-09 14:35:04 +03:00
Raphael S. Carvalho
4e6fe34501 tests: Synchronize boost logger for multithreaded tests in sstable_directory_test
The logger is not thread safe, so a multithreaded test can concurrently
write into the log, yielding unreadable XMLs.

Example:
boost/sstable_directory_test: failed to parse XML output '/scylladir/testlog/x86_64/release/xml/boost.sstable_directory_test.sstable_directory_shared_sstables_reshard_correctly.3.xunit.xml': not well-formed (invalid token): line 1, column 1351

The critical (today's unprotected) section is in boost/test/utils/xml_printer.hpp:
```
inline std::ostream&
operator<<( custom_printer<cdata> const& p, const_string value )
{
    *p << BOOST_TEST_L( "<![CDATA[" );
    print_escaped_cdata( *p, value );
    return  *p << BOOST_TEST_L( "]]>" );
}
```

The problem is not restricted to xml, but the unreadable xml file caused
the test to fail when trying to parse it, to present a summary.

New thread-safe variants of BOOST_REQUIRE and BOOST_REQUIRE_EQUAL are
introduced to help multithreaded tests. We'll start patching tests of
sstable_directory_test that will call BOOST_REQUIRE* from multiple
threads. Later, we can expand its usage to other tests.

Fixes #15654.

Signed-off-by: Raphael S. Carvalho <raphaelsc@scylladb.com>

Closes scylladb/scylladb#15655
2023-10-08 15:57:08 +03:00
Avi Kivity
765e193122 Merge 'db/hints: Modernize manager' from Dawid Mędrek
This PR is another step in refactoring the Hinted Handoff module. It aims at modernizing the code by moving to coroutines, using `std::ranges` instead of Boost's ones where possible, and uses other features coming with the new C++ standards.

It also tries to make the code clearer and get rid of confusing elements, e.g. using shared pointers where they shouldn't be used or marking methods as virtual even though nothing derives from the class. It also prevents `manager.hh` from giving direct access to internal structures (`hint_endpoint_manager` in this case).

Refs #15358

Closes scylladb/scylladb#15631

* github.com:scylladb/scylladb:
  db/hints/manager: Reword comments about state
  db/hints/manager: Unfriend space_watchdog
  db/hints: Remove a redundant alias
  db/hints: Remove an unused namespace
  db/hints: Coroutinize change_host_filter()
  db/hints: Coroutinize drain_for()
  db/hints: Clean up can_hint_for()
  db/hints: Clean up store_hint()
  db/hints: Clean up too_many_in_flight_hints_for()
  db/hints: Refactor get_ep_manager()
  db/hints: Coroutinize wait_for_sync_point()
  db/hints: Use std::span in calculate_current_sync_point
  db/hints: Clean up manager::forbid_hints_for_eps_with_pending_hints()
  db/hints: Clean up manager::forbid_hints()
  db/hints: Clean up manager::allow_hints()
  db/hints: Coroutinize compute_hints_dir_device_id()
  db/hints: Clean up manager::stop()
  db/hints: Clean up manager::start()
  db/hints/manager: Clean up the constructor
  db/hints: Remove boilerplate drain_lock()
  db/hints: Let drain_for() return a future
  db/hints: Remove ep_managers_end
  db/hints: Remove find_ep_manager
  db/hints: Use manager as API for hint_endpoint_manager
  db/hints: Don't mark have_ep_manager()'s definition as inline
  db/hints: Remove make_directory_initializer()
  db/hints/manager: Order constructors
  db/hints: Move ~manager() and mark it as noexcept
  db/hints: Use reference for storage proxy
  db/hints/manager: Explicitly delete copy constructor
  db/hints: Capitalize constants
  db/hints/manager: Hide declarations
  db/hints/manager: Move the defintions of static members to the header
  db/hints: Move make_dummy() to the header
  db/hints: Don't explicitly define ~directory_initializer()
  db/hints: Change the order of logging in ensure_created_and_verified()
  db/hints: Coroutinize ensure_rebalanced()
  db/hints: Coroutinize ensure_created_and_verified()
  db/hints: Improve formatting of directory_initializer::impl
  db/hints: Do not rely on the values of enums
  db/hints: Move the implementation of directory_initializer
  db/hints: Prefer nested namespaces
  db/hints: Remove an unused alias from manager.hh
  db/hints: Reorder includes in manager.hh and .cc
2023-10-06 17:20:33 +03:00
Botond Dénes
0ea0982590 Merge 'test/pylib: better code consistency, less boilerplate' from Kamil Braun
Refactor the code to be more consistent -- we often did the same thing in multiple ways depending on the endpoint, such as how we returned errors (some endpoints would return them through exceptions, other would wrap into `aiohttp.web.Response`s). Choose the arguably least boilerplate'y way in each case.

Then reduce the boilerplate even further.

Thanks to these refactors, modifying the framework in the future will require less work and it will be more obvious which of the possible ways to modify it should be picked (i.e. consistent with the existing code.)

Closes scylladb/scylladb#15646

* github.com:scylladb/scylladb:
  test/pylib: scylla_cluster: reduce `aiohttp` boilerplate
  test/pylib: always return data as JSON from endpoints
  test/pylib: scylla_cluster: catch `HTTPError` in topology change endpoints
  test/pylib: scylla_cluster: do sanity/precondition checks through asserts
  test/pylib: scylla_cluster: return errors through exceptions
  test/pylib: use JSON data to pass `expected_error` in `server_start`
  test/pylib: use PUT instead of GET for mutating endpoints
  test/pylib: rest_client: make `data` optional in `put_json`
  test/pylib: fix some type errors
2023-10-06 14:51:16 +03:00
Dawid Medrek
6fdca0d3a8 db/hints/manager: Reword comments about state
The current comments should be clearer to someone
not familiar with the module. This commit also makes
them abide by the limit of 120 characters per line.
2023-10-06 13:25:30 +02:00
Dawid Medrek
aa38ea3642 db/hints/manager: Unfriend space_watchdog
space_watchdog is a friend of shard hint manager just to
be able to execute one of its functions. This commit changes
that by unfriending the class and exposing the function.
2023-10-06 13:25:30 +02:00
Dawid Medrek
6cd0153954 db/hints: Remove a redundant alias 2023-10-06 13:25:30 +02:00
Dawid Medrek
ddc385bce0 db/hints: Remove an unused namespace 2023-10-06 13:25:30 +02:00
Dawid Medrek
76d414012b db/hints: Coroutinize change_host_filter() 2023-10-06 13:25:30 +02:00
Dawid Medrek
09eb30e6f1 db/hints: Coroutinize drain_for()
This commit turns the function into a coroutine
and makes the code less compact and more readable.
2023-10-06 13:25:30 +02:00
Dawid Medrek
907a572e24 db/hints: Clean up can_hint_for()
This commit gets rid of unnecessary additional calls to functions
and makes all lines abide by the limit of 120 characters.
2023-10-06 13:25:30 +02:00
Dawid Medrek
596e1f9859 db/hints: Clean up store_hint()
This commit makes the function abide by the limit
of 120 characters per line.
2023-10-06 13:25:30 +02:00
Dawid Medrek
8a43f94ca6 db/hints: Clean up too_many_in_flight_hints_for()
This commit makes the return statement more readable.
It also makes the comment abide by the limit of 120 characters per line.
2023-10-06 13:25:30 +02:00
Dawid Medrek
96a5906621 db/hints: Refactor get_ep_manager() 2023-10-06 13:25:30 +02:00