Commit Graph

41895 Commits

Author SHA1 Message Date
Avi Kivity
43bcaeb87f Merge 'test: randomized_nemesis_test: add fmt::formatter for some types' from Kefu Chai
before this change, we rely on the default-generated fmt::formatter created from operator<<, but fmt v10 dropped the default-generated formatter.

in this change, we define formatters for

* raft_call
* raft_read
* network_majority_grudge
* reconfiguration
* stop_crash
* operation::thread_id
* append_seq
* AppendReg::append
* AppendReg::ret
* operation::either_of<Ops...>
* operation::exceptional_result<Op>
* operation::completion<Op>
* operation::invocable<Op>

and drop their operator<<:s.

in which,

* `operator<<` for append_entry is never used. so it is removed.
* `operator<<` for `std::monostate` and `std::variant` are dropped. as we are now using their counterparts in {fmt}.
* stop_crash::result_type 's `fmt::formatter` is not added, as we cannot define a partial specialization of `fmt::formatter` for a nested class for a template class. we will tackle this struct in another change.

Refs #13245

Closes scylladb/scylladb#17884

* github.com:scylladb/scylladb:
  test: raft: generator: add fmt::formatter:s
  test: randomized_nemesis_test: add fmt::formatter for some types
  test: randomized_nemesis_test: add fmt::formatter for seastar::timed_out_error
  raft: add fmt::formatter for error classes
2024-03-21 10:19:46 +01:00
Kefu Chai
61424b615c test: raft: generator: add fmt::formatter:s
before this change, we rely on the default-generated fmt::formatter
created from operator<<, but fmt v10 dropped the default-generated
formatter.

in this change, we define formatters for

* operation::either_of<Ops...>
* operation::exceptional_result<Op>
* operation::completion<Op>
* operation::invocable<Op>

and drop their operator<<:s.

Refs #13245

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
2024-03-20 21:01:29 +08:00
Kefu Chai
72899f573e test: randomized_nemesis_test: add fmt::formatter for some types
before this change, we rely on the default-generated fmt::formatter
created from operator<<, but fmt v10 dropped the default-generated
formatter.

in this change, we define formatters for

* raft_call
* raft_read
* network_majority_grudge
* reconfiguration
* stop_crash
* operation::thread_id
* append_seq
* append_entry
* AppendReg::append
* AppendReg::ret

and drop their operator<<:s.

in which,

* `operator<<` for `std::monostate` and `std::variant` are dropped.
  as we are now using their counterparts in {fmt}.
* stop_crash::result_type 's `fmt::formatter` is not added, as we
  cannot define a partial specialization of `fmt::formatter` for
  a nested class for a template class. we will tackle this struct
  in another change.

Refs #13245

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
2024-03-20 21:01:29 +08:00
Kefu Chai
97b203b1af test: randomized_nemesis_test: add fmt::formatter for seastar::timed_out_error
before this change, we rely on the default-generated fmt::formatter
created from operator<<, but fmt v10 dropped the default-generated
formatter.

in this change, we define formatter for `seastar::timed_out_error`,
which will be used by the `fmt::formatter` for  `std::variant<...>`.

Refs #13245

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
2024-03-20 21:01:29 +08:00
Kefu Chai
50637964ed raft: add fmt::formatter for error classes
before this change, we rely on the default-generated fmt::formatter
created from operator<<, but fmt v10 dropped the default-generated
formatter.

in this change, we define formatter for classes derived from
`raft::error`. since {fmt} v10 defines the formatter for all classes
derived from `std::exception`, the definition is provided only when
the tree is compiled with {fmt} < 10.

Refs #13245

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
2024-03-20 21:01:29 +08:00
Pavel Emelyanov
21a5911e60 Merge 'db/virtual_tables: make token_ring_table tablet aware' from Botond Dénes
The token ring table is a virtual table (`system.token_ring`), which contains the ring information for all keyspaces in the system. This is essentially an alternative to `nodetool describering`, but since it is a virtual table, it allows for all the usual filtering/aggregation/etc. that CQL supports.
Up until now, this table only supported keyspaces which use vnodes. This PR adds support for tablet keyspaces. To accommodate these keyspaces a new `table_name` column is added, which is set to `ALL` for vnodes keyspaces. For tablet keyspaces, this contains the name of the table.
Simple sanity tests are added for this virtual table (it had none).

Fixes: #16850

Closes scylladb/scylladb#17351

* github.com:scylladb/scylladb:
  test/cql-pytest: test_virtual_tables: add test for token_ring table
  db/virtual_tables: token_ring_table: add tablet support
  db/virtual_tables: token_ring_table: add table_name column
  db/virtual_tables: token_ring_table: extract ring emit
  service/storage_service: describe_ring_for_table(): use topology to map hostid to ip
2024-03-20 14:05:49 +03:00
Mikołaj Grzebieluch
b4144d14c6 test.py: adjust the test for topology upgrade to write to and read from CDC tables
In topology on raft, management of CDC generations is moved to the topology coordinator.
We need to verify that the CDC keeps working correctly during the upgrade for topology on the raft.

A similar change will be made in the topology recovery test. It will reuse
the `start_writes_to_cdc_table` function.

Ref #17409

Closes scylladb/scylladb#17828
2024-03-20 11:15:02 +01:00
Yaron Kaikov
d859067486 [action sync labels] improve pr search when labeling an issue
This PR contains few fixes and improvment seen during
https://github.com/scylladb/scylladb/issues/15902 label addtion

When we add a label to an issue, we go through all PR.
1) Setting PR base to `master` (release PR are not relevant)
2) Since for each Issue we have only one PR, ending the search after a
   match was found
3) Make sure to skip PR with empty body (mainly debug one)
4) Set backport label prefix to `backport/`

Closes scylladb/scylladb#17912
2024-03-20 12:14:42 +02:00
David Garcia
559dc9bb27 docs: Implement relative link support for configuration properties
Introduces relative link support for individual properties listed on the configuration properties page.  For instance, to link to a property from a different document, use the syntax :ref:`memtable_flush_static_shares <confprop_memtable_flush_static_shares>`.

Additionally, it also adds support for linking groups. For example, :ref:`Ungrouped properties <confgroup_ungrouped_properties>`.

Closes scylladb/scylladb#17753
2024-03-20 11:39:30 +02:00
Kefu Chai
2479328e3b Update seastar submodule
> Revert "build: do not provide zlib as an ingredient"
> Fix reference to sstring type in tutorial about concurrency in coroutines
> Merge 'Adding a Metrics tester app' from Amnon Heiman
> cooking.sh: do not quote backtick in here document

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

Closes scylladb/scylladb#17887
2024-03-20 09:18:35 +02:00
Kefu Chai
432c000dfa ./: not include unused headers
these unused includes were identified by clangd. see
https://clangd.llvm.org/guides/include-cleaner#unused-include-warning
for more details on the "Unused include" warning.

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

Closes scylladb/scylladb#17888
2024-03-20 09:16:46 +02:00
Raphael S. Carvalho
6115c113fe sstables_loader: Don't discard sstable that is not fully exhausted
Affects load-and-stream for tablets only.

The intention is that only this loop is responsible for detecting
exhausted sstables and then discarding them for next iterations:
        while (sstable_it != _sstables.rend() && exhausted(*sstable_it)) {
            sstable_it++;
        }

But the loop which consumes non exhausted sstables, on behalf of
each tablet, was incorrectly advancing the iterator, despite the
sstable wasn't considered exhausted.

Fixes #17733.

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

Closes scylladb/scylladb#17899
2024-03-20 09:11:59 +02:00
Yaron Kaikov
0cbe5f1aa8 [action] add Fixes validation in backport PR
When we open a backport PR we should make sure the patch contains a ref to the issue it suppose to fix in order to make sure we have more accurate backport information

This action will only be triggered when base branch is `branch-*`

If `Fixes` are missing, this action will fail and notify the author.

Ref: https://github.com/scylladb/scylla-pkg/issues/3539

Closes scylladb/scylladb#17897
2024-03-20 08:55:36 +02:00
Nadav Har'El
8df2ea3f95 cql: don't crash when creating a view during a truncate
The test dtest materialized_views_test.py::TestMaterializedViews::
test_mv_populating_from_existing_data_during_truncate reproduces an
assertion failure, and crash, while doing a CREATE MATERIALIZED VIEW
during a TRUNCATE operation.

This patch fixes the crash by removing the assert() call for a view
(replacing it by a warning message) - we'll explain below why this is fine.
Also for base tables change we change the assertion to an on_internal_error
(Refs #7871).
This makes the test stop crashing Scylla, but it still fails due to
issue #17635.

Let's explain the crash, and the fix:

The test starts TRUNCATE on table that doesn't yet have a view.
truncate_table_on_all_shards() begins by disabling compaction on
the table and all its views (of which there are none, at this
point). At this point, the test creates a new view is on this table.
The new view has, by default, compaction enabled. Later, TRUNCATE
calls discard_sstables() on this new view, asserts that it has
compaction disabled - and this assertion fails.

The fix in this patch is to not do the assert() for views. In other words,
we acknowledge that in this use case, the view *will* have compactions
enabled while being truncated. I claim that this is "good enough", if we
remember *why* we disable compaction in the first place: It's important
to disable compaction while truncating because truncating during compaction
can lead us to data resurection when the old sstable is deleted during
truncation but the result of the compaction is written back. True,
this can now happen in a new view (a view created *DURING* the
truncation). But I claim that worse things can happen for this
new view: Notably, we may truncate a view and then the ongoing
view building (which happens in a new view) might copy data from
the base to the view and only then truncate the base - ending up
with an empty base and non-empty view. This problem - issue #17635 -
is more likely, and more serious, than the compaction problem, so
will need to be solved in a separate patch.

Fixes #17543.

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

Closes scylladb/scylladb#17634
2024-03-20 08:54:39 +02:00
Raphael S. Carvalho
d5a5005afa sstables: Fix clone semantics for runs in partitioned_sstable_set
When a sstable set is cloned, we don't want a change in cloned set
propagating to the former one.

It happens today with partitioned_sstable_set::_all_runs, because
sets are sharing ownership of runs, which is wrong.

Let's not violate clone semantics by copying all_runs when cloning.

Doesn't affect data correctness as readers work directly with
sstables, which are properly cloned. Can result in a crash in ICS
when it is estimating pending tasks, but should be very rare in
practice.

Fixes #17878.

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

Closes scylladb/scylladb#17879
2024-03-20 08:41:32 +02:00
Andrei Chekun
b52f79b1ce Fix leaking file descriptors in test.py
Fixes #17569

Tests are not closing file descriptor after it finishes. This leads to inability to continue tests since the default value for opened files in Linux is 1024. Issue easy to reproduce with the next command:
```
$ ./test.py --mode debug test_native_transport --repeat 1500
```
After fix applied all tests are passed with a next command:
```
$ ./test.py --mode debug test_native_transport --repeat 10000
```

Closes scylladb/scylladb#17798
2024-03-19 14:59:14 +01:00
Piotr Dulikowski
70cb1dc8fe doc: describe upgrade and recovery for raft topology
Document the manual upgrade procedure that is required to enable
consistent cluster management in clusters that were upgraded from an
older version to ScyllaDB Open Source 6.0. This instruction is placed in
previously placeholder "Enable Raft-based Topology" page which is a part
of the upgrade instructions to ScyllaDB Open Source 6.0.

Add references to the new description in the "Raft Consensus Algorithm
in ScyllaDB" document in relevant places.

Extend the "Handling Node Failures" document so that it mentions steps
required during recovery of a ScyllaDB cluster running version 6.0.

Fixes: scylladb/scylladb#17341

Closes scylladb/scylladb#17624
2024-03-19 14:59:14 +01:00
Yaron Kaikov
ad76f0325e [action] Sync labels from an Issue to linked PR
After merging https://github.com/scylladb/scylladb/pull/17365, all backport labels should be added to PR (before we used to add backport labels to the issues).

Adding a GitHub action which will be triggered in the following conditions only:

1) The base branch is `master` or `next`
2) Pull request events:
- opened: For every new PR that someone opens, we will sync all labels from the linked issue (if available)
- labeled: This role only applies to labels with the `backport/` prefix. When we add a new label for the backport we will update the relevant issue or PR to get them both to sync
- unlabeled: Same as `labeled` only applies to the `backport/` prefix. When we remove a label for backport we will update the relevant issue or pr

Closes scylladb/scylladb#17715
2024-03-19 09:17:07 +02:00
Avi Kivity
e48eb76f61 sstables_manager: decouple from system_keyspace
sstables_manager now depends on system_keyspace for access to the
system.sstables table, needed by object storage. This violates
modularity, since sstables_manager is a relatively low-level leaf
module while system_keyspace integrates large parts of the system
(including, indirectly, sstables_manager).

One area where this is grating is sstables::test_env, which has
to include the much higher level cql_test_env to accommodate it.

Fix this by having sstables_manager expose its dependency on
system_keyspace as an interface, sstables_registry, and have
system_keyspace implement the glue logic in
system_keyspace_sstables_manager.

Closes scylladb/scylladb#17868
2024-03-18 20:38:07 +03:00
Anna Stuchlik
a13694daea doc: fix the image upgrade page
This commit updates the Upgrade ScyllaDB Image page.

- It removes the incorrect information that updating underlying OS packages is mandatory.
- It adds information about the extended procedure for non-official images.

Closes scylladb/scylladb#17867
2024-03-18 18:27:46 +02:00
Gleb Natapov
af218d0063 raft_group0_client: assert that hold_read_apply_mutex is called on shard 0
group0 operations a valid on shard 0 only. Assert that. We already do
that in the version of the function that gets abort source.

Message-ID: <ZeCti70vrd7UFNim@scylladb.com>
2024-03-18 16:20:41 +01:00
Pavel Emelyanov
a8f48e0f6b test/boost/tablets: Use verbose BOOST_REQUIRE checkers
Lot's of BOOST_REQUIRES in this test require some integers to be in some
eq/gt/le relations to each other. And one place that compares rack names
as strings. Using more verbose boost checkers is preferred in such cases

Signed-off-by: Pavel Emelyanov <xemul@scylladb.com>

Closes scylladb/scylladb#17866
2024-03-18 17:09:02 +02:00
Botond Dénes
270d01f16a Merge 'build: cmake: put server deb packages under build/dist/$<CONFIG>/debian' from Kefu Chai
this change is a follow up of ca7f7bf8e2, which changed the output path to build/$<CONFIG>/debian. but what dist/docker/debian/build_docker.sh expects is `build/dist/$config/debian/*.deb`, where `$config` is the normalized mode, when the debian packages are built using CMake generated rules, `$mode` is CMake configuration name, i.e., `$<CONFIG>`. so, ca7f7bf8e2 made a mistake, as it does not match the expectation of `build_docker.sh`.

in this change, this issue is addressed. so we use the same path in both `dist/CMakeLists.txt` and `dist/docker/debian/build_docker.sh`.

Closes scylladb/scylladb#17848

* github.com:scylladb/scylladb:
  build: cmake: add dist-* targets to the default build target
  build: cmake: put server deb packages under build/dist/$<CONFIG>/debian
2024-03-18 16:18:35 +02:00
Avi Kivity
72bbe75d5b Merge 'Fix node replace with tablets for RF=N' from Tomasz Grabiec
This PR fixes a problem with replacing a node with tablets when
RF=N. Currently, this will fail because tablet replica allocation for
rebuild will not be able to find a viable destination, as the replacing node
is not considered to be a candidate. It cannot be a candidate because
replace rolls back on failure and we cannot roll back after tablets
were migrated.

The solution taken here is to not drain tablet replicas from replaced
node during topology request but leave it to happen later after the
replaced node is in left state and replacing node is in normal state.

The replacing node waits for this draining to be complete on boot
before the node is considered booted.

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

Nodes in the left state will be kept in tablet replica sets for a while after node
replace is done, until the new replica is rebuilt. So we need to know
about those node's location (dc, rack) for two reasons:

 1) algorithms which work with replica sets filter nodes based on their location. For example materialized views code which pairs base replicas with view replicas filters by datacenter first.

 2) tablet scheduler needs to identify each node's location in order to make decisions about new replica placement.

It's ok to not know the IP, and we don't keep it. Those nodes will not
be present in the IP-based replica sets, e.g. those returned by
get_natural_endpoints(), only in host_id-based replica
sets. storage_proxy request coordination is not affected.

Nodes in the left state are still not present in token ring, and not
considered to be members of the ring (datacanter endpoints excludes them).

In the future we could make the change even more transparent by only
loading locator::node* for those nodes and keeping node* in tablet replica sets.

Currently left nodes are never removed from topology, so will
accumulate in memory. We could garbage-collect them from topology
coordinator if a left node is absent in any replica set. That means we
need a new state - left_for_real.

Closes scylladb/scylladb#17388

* github.com:scylladb/scylladb:
  test: py: Add test for view replica pairing after replace
  raft, api: Add RESTful API to query current leader of a raft group
  test: test_tablets_removenode: Verify replacing when there is no spare node
  doc: topology-on-raft: Document replace behavior with tablets
  tablets, raft topology: Rebuild tablets after replacing node is normal
  tablets: load_balancer: Access node attributes via node struct
  tablets: load_balancer: Extract ensure_node()
  mv: Switch to using host_id-based replica set
  effective_replication_map: Introduce host_id-based get_replicas()
  raft topology: Keep nodes in the left state to topology
  tablets: Introduce read_required_hosts()
2024-03-18 16:16:08 +02:00
Kefu Chai
d1c35f943d test: unit: add fmt::formatter for test_data in tests
before this change, we rely on the default-generated fmt::formatter
created from operator<<, but fmt v10 dropped the default-generated
formatter.

in this change, we define formatters for

* test_data in two different tests
* row_cache_stress_test::reader_id

and drop its operator<<.

Refs #13245

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

Closes scylladb/scylladb#17861
2024-03-18 15:35:28 +02:00
Kefu Chai
de6803de92 build: cmake: use --ld-path for specifying linker for clang
Clang > 12 starts to complain like
```
warning:  '-fuse-ld=' taking a path is deprecated; use '--ld-path=' instead [-Wfuse-ld-path]'
```
this option is not supported by GCC yet. also instead of using
the generic driver's name, use the specific name. otherwise ld
fails like
```
lld is a generic driver.
Invoke ld.lld (Unix), ld64.lld (macOS), lld-link (Windows), wasm-ld (WebAssembly) instead
```

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

Closes scylladb/scylladb#17825
2024-03-18 14:49:11 +02:00
Pavel Emelyanov
933b346166 test/tablets: Add test to check how ALTER changes RF (in one DC)
For now test is incomplete in several ways

1. It xfails, until #17116
2. It doesn't rebuild/repair tablets
3. It doesn't check that tablet data actually exists on replicas

refs: #17575

Signed-off-by: Pavel Emelyanov <xemul@scylladb.com>

Closes scylladb/scylladb#17808
2024-03-18 14:47:57 +02:00
Yaron Kaikov
6406d3083c [mergify] set draft PR when conflicts
When Mergify open a backport PR and identify conflicts, it adding the
`conflicts` label. Since GitHub can't identify conflicts in PR, setting
a role to move PR to draft, this way we will not trigger CI

Once we resolve the conflicts developer should make the PR `ready for
review` (which is not draft) and then CI will be triggered

`conflict` label can also be removed

Closes scylladb/scylladb#17834
2024-03-18 14:45:08 +02:00
Beni Peled
bddac3279e Skip the backport-label workflow for draft pull requests
It's not necessary (and annoying) when this workflow runs and fails
against PRs in draft mode

Closes scylladb/scylladb#17864
2024-03-18 14:42:55 +02:00
Wojciech Mitros
efcb718e0a mv: adjust memory tracking of single view updates within a batch
Currently, when dividing memory tracked for a batch of updates
we do not take into account the overhead that we have for processing
every update. This patch adds the overhead for single updates
and joins the memory calculation path for batches and their parts
so that both use the same overhead.

Fixes #17854

Closes scylladb/scylladb#17855
2024-03-18 14:31:54 +02:00
Kefu Chai
d57a82c156 build: cmake: add dist-* targets to the default build target
also, add a target of `dist-server`, which mirrors the structure
of the targets created by `configure.py`, and it is consistent
with the ones defined by `build_submodule()`.

so that they are built when our CI runs `ninja -C $build`. CI
expects that all these rpm and deb packages to built when
`ninja -C $build` finishes. so that it can continue with
building the container image. let's make it happen. so that
the CMake-based rules can work better with CI.

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
2024-03-18 20:02:43 +08:00
Raphael S. Carvalho
2c9b13d2d1 compaction: Check for key presence in memtable when calculating max purgeable timestamp
It was observed that some use cases might append old data constantly to
memtable, blocking GC of expired tombstones.

That's because timestamp of memtable is unconditionally used for
calculating max purgeable, even when the memtable doesn't contain the
key of the tombstone we're trying to GC.

The idea is to treat memtable as we treat L0 sstables, i.e. it will
only prevent GC if it contains data that is possibly shadowed by the
expired tombstone (after checking for key presence and timestamp).

Memtable will usually have a small subset of keys in largest tier,
so after this change, a large fraction of keys containing expired
tombstones can be GCed when memtable contains old data.

Fixes #17599.

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

Closes scylladb/scylladb#17835
2024-03-18 13:37:44 +02:00
Benny Halevy
2c0b1d1fa7 compaction: get_max_purgeable_timestamp: optimize sstable filtering by min_timestamp
There is no point in checking `sst->filter_has_key(*hk)`
if the sstable contains no data older than the running
minimum timestamp, since even if it matches, it won't change
the minimum.

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

Closes scylladb/scylladb#17839
2024-03-18 13:26:49 +02:00
Avi Kivity
ed211cd0bf sstables: partition_index_cache: reindent
Fix up after e120ba3514.

Closes scylladb/scylladb#17847
2024-03-18 13:23:21 +02:00
Andrei Chekun
b6edf056ea Add sanity tests for multi dc
Fix writing cassandra-rackdc.properties with correct format data instead of yaml
Add a parameter to overwrite RF for specific DC
Add the possibility to connect cql to the specific node

In this PR 4 tests were added to test multi-DC functionality. One is added from initial commit were multi-DC possibility were introduced, however, this test was not commited. Three of them are migrations from dtest, that later will be deleted. To be able to execute migrated tests additional functionality is added: the ability to connect cql to the specific node in the cluster instead of pooled connection and the possibility to overwrite the replication factor for the specific DC. To be able to use the multi DC in test.py issue with the incorrect format of the properties file fixed in this PR.

Closes scylladb/scylladb#17503
2024-03-18 13:00:36 +02:00
Nadav Har'El
680e37c4af Merge 'schema_tables: unfreeze frozen_mutation:s gently' from Avi Kivity
With large schemas, unfreezing can stall, especially as it requires
a lot of memory. Switch to a gentle version that will not stall.

As a preparation step, we add unfreeze_gently() for a span of mutations.

Fixes #17841

Closes scylladb/scylladb#17842

* github.com:scylladb/scylladb:
  schema_tables: unfreeze frozen_mutation:s gently
  frozen_mutation: add unfreeze_gently(span<frozen_mutation>)
2024-03-18 12:56:44 +02:00
Kefu Chai
fe28aac440 test/perf: add fmt::formatter for perf_result_with_aio_writes
before this change, we rely on the default-generated fmt::formatter
created from operator<<, but fmt v10 dropped the default-generated
formatter.

in this change, we define formatters for `perf_result_with_aio_writes`,
and drop its operator<<.

Refs #13245

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

Closes scylladb/scylladb#17849
2024-03-18 12:53:39 +02:00
Botond Dénes
a4e8bea679 tools/scylla-nodetool: status: handle missing host_id
Newly joining nodes may not have a host id yet. Handle this and print a
"?" for these nodes, instead of the host-id.
Extend the existing test for joining node case (also rename it and add
comment).

Closes scylladb/scylladb#17853
2024-03-18 12:26:59 +02:00
Kefu Chai
384e9e9c7c build: cmake: put server deb packages under build/dist/$<CONFIG>/debian
this change is a follow up of ca7f7bf8e2, which changed the output path
to build/$<CONFIG>/debian. but what dist/docker/debian/build_docker.sh
expects is `build/dist/$config/debian/*.deb`, where `$config` is the
normalized mode, when the debian packages are built using CMake
generated rules, `$mode` is CMake configuration name, i.e., `$<CONFIG>`.
so, ca7f7bf8e2 made a mistake, as it does not match the expectation of
`build_docker.sh`.

in this change, this issue is addressed. so we use the same path
in both `dist/CMakeLists.txt` and `dist/docker/debian/build_docker.sh`.

apply the same change to `dist-server-rpm`.

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
2024-03-18 14:21:39 +08:00
Avi Kivity
731b5c5120 schema_tables: unfreeze frozen_mutation:s gently
With large schemas, unfreezing can stall, especially as it requires
a lot of memory. Switch to a gentle version that will not stall.
2024-03-17 17:46:02 +02:00
Avi Kivity
a34edb0a93 frozen_mutation: add unfreeze_gently(span<frozen_mutation>)
While we have unfreeze(vector<frozen_mutation>), a gentle version is
preferred.
2024-03-17 17:45:30 +02:00
Kefu Chai
8811900602 build: cmake: do not link randomized_nemesis_test with replication.cc
test/raft/replication.cc defines a symbol named `tlogger`, while
test/raft/randomized_nemesis_test.cc also defines a symbol with
the same name. when linking the test with mold, it identified the ODR
violation.

in this change, we extract test-raft-helper out, so that
randomized_nemesis_test can selectively only link against this library.
this also matches with the behavior of the rules generated by `configure.py`.

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

Closes scylladb/scylladb#17836
2024-03-17 17:01:47 +02:00
Kefu Chai
e1ae36ecfd test/boost: add formatter for BOOST_REQUIRE_EQUAL
in gossiping_property_file_snitch_test, we use
`BOOST_REQUIRE_EQUAL(dc_racks[i], dc_racks[0])` to check the equality
of two instances of `pair<sstring, sstring`, like:
```c++
BOOST_REQUIRE_EQUAL(dc_racks[i], dc_racks[0])
```

since the standard library does not provide the formatter for printing
`std::pair<>`, we rely on the homebrew generic formatter to
print `std::pair<>, which in turn uses operator<< to format the
elements in the `pair`, but we intend to remove this formatter
in future, as the last step of #13245 .

so in order to enable Boost.test to print out lhs and rhs when
`BOOST_REQUIRE_EQUAL` check fails, we are adding
`boost_test_print_type()` for `pair<sstring,sstring>`. the helper
function uses {fmt} to print the `pair<>`.

Refs #13245

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

Closes scylladb/scylladb#17831
2024-03-17 16:58:39 +02:00
Kefu Chai
6244a2ae00 service:qos: add fmt::formatter for service_level_options::workload_type
this change prepares for the fmt::formatter based formatter used by
tests, which will use {fmt} to print the elements in a container,
so we need to define the formatter using fmt::formatter for these
element. the operator<< for service_level_options::workload_type is
preserved, as the tests are still using it.

Refs #13245

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

Closes scylladb/scylladb#17837
2024-03-17 16:52:57 +02:00
Kefu Chai
7df3acd39c repair: add fmt::formatter for row_level_diff_detect_algorithm
before this change, we rely on the default-generated fmt::formatter
created from operator<<, but fmt v10 dropped the default-generated
formatter.

in this change, we define formatters for
row_level_diff_detect_algorithm. please note, we already have
`format_as()` overload for this type, but we cannot use it as a
fallback of the proper `fmt::formatter<>` specialization before
{fmt} v10. so before we update our CI to a distro with {fmt} v10,
`fmt::formatter<row_level_diff_detect_algorithm>` is still
needed.

Refs #13245

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

Closes scylladb/scylladb#17824
2024-03-16 19:12:49 +02:00
Botond Dénes
03c47bc30b tools/scylla-nodetool: status: handle nodes without load
Some nodes may not have a load yet. Handle this. Also add a test
covering this case.

Closes scylladb/scylladb#17823
2024-03-16 17:38:53 +02:00
Pavel Emelyanov
42a2dce4b6 test/lib: Eliminate variadic futures from template
The assert_that_failed(future) pair of helpers are templates with
variadic futures, but since they are gone in seastar, so should they in
test/lib

Signed-off-by: Pavel Emelyanov <xemul@scylladb.com>

Closes scylladb/scylladb#17830
2024-03-16 17:37:25 +02:00
Kefu Chai
8bab51733f db: add fmt::formatter for db::functions::function
before this change, we rely on the default-generated fmt::formatter
created from operator<<, but fmt v10 dropped the default-generated
formatter.

in this change, we define formatters for `db::functions::function`.
please note, because we use `std::ostream` as the parameter of
the polymorphism implementation of `function::print()`.
without an intrusive change, we have to use `fmt::ostream_formatter`
or at least use similar technique to format the `function` instance
into an instance of `ostream` first. so instead of implementing
a "native" `fmt::formatter`, in this change, we just use
`fmt::ostream_formatter`.

Refs #13245

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

Closes scylladb/scylladb#17832
2024-03-16 17:36:49 +02:00
Kefu Chai
23e9958ebb data_dictionary: do not include unused headers
these unused includes were identified by clangd. see
https://clangd.llvm.org/guides/include-cleaner#unused-include-warning
for more details on the "Unused include" warning.

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

Closes scylladb/scylladb#17826
2024-03-15 21:17:11 +03:00
Botond Dénes
ad9bad4700 tools/scylla-nodetool: {proxy,table}histograms: handle empty histograms
Empty histograms are missing some of the members that non-empty
histograms have. The code handling these histograms assumed all required
members are always present and thus error out when receiving an empty
histogram.
Add tests for empty histograms and fix the code handling them to check
for the potentially missing members, instead of making assumptions.

Closes scylladb/scylladb#17816
2024-03-15 15:59:31 +03:00