Commit Graph

37897 Commits

Author SHA1 Message Date
Avi Kivity
bfaac3a239 Merge 'Make replace sstables implementations exception safe' from Benny Halevy
This is the first phase of providing strong exception safety guarantees by the generic `compaction_backlog_tracker::replace_sstables`.

Once all compaction strategies backlog trackers' replace_sstables provide strong exception safety guarantees (i.e. they may throw an exception but must revert on error any intermediate changes they made to restore the tracker to the pre-update state).

Once this series is merged and ICS replace_sstables is also made strongly exception safe (using infrastructure from size_tiered_backlog_tracker introduced here), `compaction_backlog_tracker::replace_sstables` may allow exceptions to propagate back to the caller rather than disabling the backlog tracker on errors.

Closes #14104

* github.com:scylladb/scylladb:
  leveled_compaction_backlog_tracker: replace_sstables: provide strong exception safety guarantees
  time_window_backlog_tracker: replace_sstables: provide strong exception safety guarantees
  size_tiered_backlog_tracker: replace_sstables: provide strong exception safety guarantees
  size_tiered_backlog_tracker: provide static calculate_sstables_backlog_contribution
  size_tiered_backlog_tracker: make log4 helper static
  size_tiered_backlog_tracker: define struct sstables_backlog_contribution
  size_tiered_backlog_tracker: update_sstables: update total_bytes only if set changed
  compaction_backlog_tracker: replace_sstables: pass old and new sstables vectors by ref
  compaction_backlog_tracker: replace_sstables: add FIXME comments about strong exception safety
2023-07-17 12:32:27 +03:00
Botond Dénes
c4f35d67e5 Merge 'utils: add fmt formatter for pretty printers' from Kefu Chai
add fmt formatter for `utils::pretty_printed_data_size` and
`utils::pretty_printed_throughput`.

this is a part of a series to migrating from `operator<<(ostream&, ..)`
based formatting to fmtlib based formatting. the goal here is to enable
fmtlib to print `utils::pretty_printed_data_size` and
`utils::pretty_printed_throughput` without the help of `operator<<`.

please note, despite that it's more popular to use the IEC prefixes
when presenting the size of storage, i.e., MiB for 1024**2 bytes instead
of MB for 1000**2 bytes, we are still using the SI binary prefixes as
the default binary prefix, in order to preserve the existing behavior.
the operator<< for these types are removed.

the tests are updated accordingly.

Refs #13245

Closes #14719

* github.com:scylladb/scylladb:
  utils: drop operator<< for pretty printers
  utils: add fmt formatter for pretty printers
2023-07-17 12:06:00 +03:00
Kefu Chai
ed5825ebdb s3/test: correct outdated comments
these comments or docstrings are not in-sync with the code they
are supposed to explain. so let's update them accordingly.

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

Closes #14545
2023-07-17 12:03:11 +03:00
Kefu Chai
3ed982df87 query_context: do not include unused header
in this header, none of the exceptions defined by
`exceptions/exceptions.hh` is used. so let's drop the `#include`.

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

Closes #14718
2023-07-17 12:00:49 +03:00
Kefu Chai
18166e0e43 sstable: do not include unused header
`db/query_context.hh` contains the declaration of class
`db::query_context`. but `replica/table.cc` does not use or need
`db::query_context`.

so, in this change, the `#include` is removed.

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

Closes #14717
2023-07-17 11:47:02 +03:00
Aleksandra Martyniuk
241b56b7b5 test: drain old compaction tasks from task manager
When running compaction task test on the same scylla instantion
other tests are run, some compaction tasks from other test cases may
be left in task manager. If they stay in memory long enough, they may
get unregistered during the compaction task test and cause bad_request
status.

Drain old compaction tasks before and after each test.

Fixes: #14584.

Closes #14585
2023-07-17 10:57:36 +03:00
Harsh Soni
78c8e92170 dbuild: fix ulimits hard value for docker on osx
Docker-on-osx cannot parse "unlimited" as the hard limit value of ulimit, so, hardcode it to a fixed value.

Closes #14295
2023-07-17 10:30:39 +03:00
Kefu Chai
a8254111ef utils: drop operator<< for pretty printers
since all callers of these operators have switched to fmt formatters.
let's drop them. the tests are updated accordingly.

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
2023-07-17 14:02:13 +08:00
Kefu Chai
fc6b84ec1f utils: add fmt formatter for pretty printers
add fmt formatter for `utils::pretty_printed_data_size` and
`utils::pretty_printed_throughput`.

this is a part of a series to migrating from `operator<<(ostream&, ..)`
based formatting to fmtlib based formatting. the goal here is to enable
fmtlib to print `utils::pretty_printed_data_size` and
`utils::pretty_printed_throughput` without the help of `operator<<`.

please note, despite that it's more popular to use the IEC prefixes
when presenting the size of storage, i.e., MiB for 1024**2 bytes instead
of MB for 1000**2 bytes, we are still using the SI binary prefixes as
the default binary prefix, in order to preserve the existing behavior.

also, we use the singular form of "byte" when formating "1". this is
more correct.

the tests are updated accordingly.

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
2023-07-17 14:02:13 +08:00
Botond Dénes
3945721dd6 Merge 'test/boost/database_test: split mutation sub-tests' from Alecco
Split long-runing database mutation tests.

At a trade-off with verbosity, split these sub-tests for the long running tests `database_with_data_in_sstables_is_a_mutation_source_`*.

Refs #13905

Closes #14455

* github.com:scylladb/scylladb:
  test/lib/mutation_source_test: bump ttl
  test/boost/memtable_test: split memtable sub-tests
  test/boost/database_test: split mutation sub-tests
2023-07-17 08:29:28 +03:00
Botond Dénes
1f5b1679b0 Merge 'test: use different table names in sstable_expired_data_ratio and cleanups' from Kefu Chai
it turns out we are creating two tables with the same name in
sstable_expired_data_ratio. and when creating the second table,
we don't destroy the first one.

this does not happen in the real world, we could tolerate this
in test. but this matters if we're going to have a system-wide per-table
registry which use the name of table as the table's identifier in the
registry. for instance, the metrics name for the tables would conflict.

so, in this series, we use different name for the tables under
testing. they can share the same set of sstables though. this fulfills
the needs of this test in question. also, we rename some variables
for better readability in this series.

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

Closes #14665

* github.com:scylladb/scylladb:
  test: rename variables with better names
  test: use different table names in sstable_expired_data_ratio
  test: explicitly capture variables
2023-07-17 08:27:30 +03:00
Kefu Chai
567b453689 utils: avoid using out-of-range index in pretty_printers
before this change, if the formatter size is greater than a pettabyte,
`exp` would be 6. but we still use it as the index to find the suffix
in `suffixes`, but the array's size is 6. so we would be referencing
random bits after "PB" for the suffix of the formatted size.

in this change

* loop in the suffix for better readability. and to avoid
  the off-by-one errors.
* add tests for both pretty printers

Branches: 5.1,5.2,5.3
Fixes #14702
Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>

Closes #14713
2023-07-16 18:46:09 +03:00
Kefu Chai
6459bf9c0b test: randomized_nemesis_test: do not perform tautogical comparision
it is not supported by C++, and might not yield expected result.
as "0 <= d" evaluates to true, which is always less than "magic".

so let's avoid using it.

```
/home/kefu/dev/scylladb/test/raft/randomized_nemesis_test.cc:2908:23: error: result of comparison of constant 54313 with expression of type 'bool' is always true [-Werror,-Wtautological-constant-out-of-range-compare]
 2908 |         assert(0 <= d < magic);
      |                ~~~~~~ ^ ~~~~~
```

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

Closes #14695
2023-07-16 18:30:58 +03:00
Avi Kivity
4fc870a31a cql3: expr: avoid redoing prepare work when evaluating field_selection
prepare_expression() already validates the types and computes
the index of the field; no need to redo that work when
evaluating the expression.

The tests are adjusted to also prepare the expression.

Closes #14562
2023-07-16 14:29:19 +03:00
Alejo Sanchez
6d9709679d test/lib/mutation_source_test: bump ttl
Use a large ttl (2h+) to avoid deletions for database_test.

An actual fix would be to make database_test to not ignore query_time,
but this is much harder.

Signed-off-by: Alejo Sanchez <alejo.sanchez@scylladb.com>
2023-07-15 10:51:09 +02:00
Alejo Sanchez
a9350493e3 test/boost/memtable_test: split memtable sub-tests
Split long-runing memtable tests.

At a trade-off with verbosity, split these sub-tests for the long
running tests
test_memtable_with_many_versions_conforms_to_mutation_source*.

Refs #13905
2023-07-15 10:51:09 +02:00
Alejo Sanchez
79eedded35 test/boost/database_test: split mutation sub-tests
Split long-runing database mutation tests.

At a trade-off with verbosity, split these sub-tests for the long
running tests database_with_data_in_sstables_is_a_mutation_source_*.

Refs #13905

Signed-off-by: Alejo Sanchez <alejo.sanchez@scylladb.com>
2023-07-15 10:51:06 +02:00
Kefu Chai
42bba50727 test: rename variables with better names
we first use `cf` and then `lcs_table` later on in
`sstable_expired_data_ratio` to represent "tables_for_tests"
with schema of different compaction strategies.

to improve the readability, we rename the variables which are
related to STCS (Sized-Tiered Compaction Strategy) to "stcs_*", so
better reflect their relations, for better readability.

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
2023-07-15 13:29:55 +08:00
Kefu Chai
f7af971181 test: use different table names in sstable_expired_data_ratio
it turns out we are creating two tables with the same name in
sstable_expired_data_ratio. and when creating the second table,
we don't destroy the first one.

this does not happen in the real world, we could tolerate this
in test. this matters if we're going to have a system-wide per-table
registry which use the name of table as the table's identifier in the
registry. for instance, the metrics name for the tables would conflict.

to avoid creating multiples tables with the same ${ks}.${cf},
after this change, we use different name for the tables under
testing, and they can share the same set of sstables though. this
fulfills the needs of this test in question, and the needs of
having per-table metrics with table id as their identifiers.

Fixes #14657
Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
2023-07-15 13:29:55 +08:00
Kefu Chai
c836e7940e test: explicitly capture variables
* sstable_expired_data_ratio: capture variables explictly for better
  readability.

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
2023-07-15 13:29:55 +08:00
Anna Stuchlik
a93fd2b162 doc: fix internal links
Fixes https://github.com/scylladb/scylladb/issues/14490

This commit fixes mulitple links that were broken
after the documentation is published (but not in
the preview) due to incorrect syntax.
I've fixed the syntax to use the :docs: and :ref:
directive for pages and sections, respectively.

Closes #14664
2023-07-14 18:32:47 +03:00
Botond Dénes
eb8d7fa1c2 Merge 'test/pylib: handle paging for run_async' from Alecco
Provide a way to fetch all pages for `run_async`.

While there, move the code to a common helper module.

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

Closes #14688

* github.com:scylladb/scylladb:
  test/pylib: handle paged results for async queries
  test/pylib: move async query wrapper to common module
2023-07-14 16:37:24 +03:00
Raphael S. Carvalho
d6029a195e Remove DateTieredCompactionStrategy
This is the last step of deprecation dance of DTCS.

In Scylla 5.1, users were warned that DTCS was deprecated.

In 5.2, altering or creation of tables with DTCS was forbidden.

5.3 branch was already created, so this is targetting 5.4.

Users that refused to move away from DTCS will have Scylla
falling back to the default strategy, either STCS or ICS.

See:
WARN  2023-07-14 09:49:11,857 [shard 0] schema_tables - Falling back to size-tiered compaction strategy after the problem: Unable to find compaction strategy class 'DateTieredCompactionStrategy

Then user can later switch to a supported strategy with
alter table.

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

Closes #14559
2023-07-14 16:20:48 +03:00
Kefu Chai
8b10b1408b migration_manager: correct format string when printing warning
we intent to print the error message. but failed to pass it to the
formatter. if we actually run into this case, fmtlib would throw.

so in this change, we also print the error when
announcing schema change fails.

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

Closes #14623
2023-07-14 15:47:10 +03:00
Asias He
dad5caf141 streaming: Add stream_plan_ranges_percentage
This option allows user to change the number of ranges to stream in
batch per stream plan.

Currently, each stream plan streams 10% of the total ranges.

With more ranges per stream plan, it reduces the waiting time between
two stream plans. For example,

stream_plan1: shard0 (t0), shard1 (t1)
stream_plan2: shard0 (t2), shard1 (t3)

We start stream_plan2 after all shards finish streaming in stream_plan1.
If shard0 and shard1 in stream_plan1 finishes at different time. One of
the shards will be idle.

If we stream more ranges in a single stream plan, the waiting time will
be reduced.

Previously, we retry the stream plan if one of the stream plans is
failed. That's one of the reasons we want more stream plans. With RBNO
and 1f8b529e08 (range_streamer: Disable restream logic), the
restream factor is not important anymore.

Also, more ranges in a single stream plan will create bigger but fewer
sstables on the receiver side.

The default value is the same as before: 10% percentage of total ranges.

Fixes #14191

Closes #14402
2023-07-14 09:03:01 +03:00
Botond Dénes
5c5c56820c Merge 'Automatically close exhausted SSTable readers for cleanup' from Raphael "Raph" Carvalho
This is a followup to 1545ae2d3b

A new reader is introduced that automatically closes the underlying sstable reader once it's exhausted after a fast forward call.

Allowing us to revert 1fefe597e6 which is fragile.

Closes #14669

* github.com:scylladb/scylladb:
  Revert "sstables: Close SSTable reader if index exhaustion is detected in fast forward call"
  sstables: Automatically close exhausted SSTable readers in cleanup
2023-07-14 09:00:57 +03:00
Alejo Sanchez
9fefb601ef test/pylib: handle paged results for async queries
Provide a flag to fetch all pages for run_async().

Add a simple test to random tables. Runs within 6 seconds in debug mode.

Signed-off-by: Alejo Sanchez <alejo.sanchez@scylladb.com>
2023-07-13 16:56:01 +02:00
Mikołaj Grzebieluch
b165f1e88b utils: error injection: check if it is an ongoing one-shot injection in is_enabled
Change it for consistency with `enabled_injections`.

Closes #14597
2023-07-13 15:56:33 +02:00
Botond Dénes
4cee8206f8 Revert "view_update_generator: Increase the registration_queue_size"
This reverts commit d3034e0fab.

The test modified by this commit
(view_build_test.test_view_update_generator_register_semaphore_unit_leak)
often fails, breaking build jobs.
2023-07-13 16:48:50 +03:00
Pavel Emelyanov
ddbccf1952 main: Use invoke_on_all(&class::method, ...) where possible
The sharded<service>::invoke_on_all() has the ability to call method by
pointer with automagical unwrapping of sharded references. This makes
the code shorter.

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

Closes #14684
2023-07-13 16:31:14 +03:00
Anna Stuchlik
9db9dedb41 doc: document the minimum_keyspace_rf option
Fixes https://github.com/scylladb/scylladb/issues/14598

This commit adds the description of minimum_keyspace_rf
to the CREATE KEYSPACE section of the docs.
(When we have the reference section for all ScyllaDB options,
an appropriate link should be added.)

This commit must be backported to branch-5.3, because
the feature is already on that branch.

Closes #14686
2023-07-13 15:37:52 +03:00
Kefu Chai
057701299c compaction_manager: remove unnecessary include
also, remove unnecessary forward declarations.

* compaction_manager_test_task_executor is only referenced
  in the friend declaration. but this declaration does not need
  a forward declaration of the friend class
* compaction_manager_test_task_executor is not used anywhere.

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

Closes #14680
2023-07-13 14:59:39 +03:00
Patryk Jędrzejczak
ed5627cb78 test: raft: add more unit tests for raft address map
https://github.com/scylladb/scylladb/pull/12035 and
https://github.com/scylladb/scylladb/pull/14329 have introduced a few
features to the raft address map that haven't been tested yet:
- mappings without an actual IP address (the first PR)
- marking entries with generation numbers (the second PR)

This commit adds unit tests that verify these changes.

Closes #14572
2023-07-13 12:00:43 +02:00
Kamil Braun
a2fe63349d Merge 'utils: error injection: add a string-to-string map of injection's parameters' from Mikołaj Grzebieluch
Add `parameters` map to `injection_shared_data`. Now tests can attach
string data to injections that can be read in injected code via
`injection_handler`.

Closes #14521

Closes #14608

* github.com:scylladb/scylladb:
  tests: add a `parameters` argument to code that enables injections
  api/error_injection: add passing injection's parameters to enable endpoint
  tests: utils: error injection: add test for injection's parameters
  utils: error injection: add a string-to-string map of injection's parameters
  utils: error injection: rename received_messages_counter to injection_shared_data
2023-07-13 11:52:15 +02:00
Kefu Chai
a871de33e6 test.py: remove redundant message in report
before this change, we would have report in Jenkins like:

```
[Info] - 1 out of 3 times failed: failed.
 == [File] - test/boost/commitlog_test.cc
 == [Line] - 298

[Info] - passed: release=1, dev=1
 == [File] - test/boost/commitlog_test.cc
 == [Line] - 298

[Info] - failed: debug=1
 == [File] - test/boost/commitlog_test.cc
 == [Line] - 298
```

the first section is rendered from the an `Info` tag,
created by `test.py`. but the ending "failed" does not
help in this context, as we already understand it's failing.
so, in this change, it is dropped.

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

Closes #14546
2023-07-13 11:31:13 +03:00
Nadav Har'El
e01a369708 alternator: detect errors in AttributeDefinitions parameter
Add missing validation of the AttributeDefinitions parameter of the
CreateTable operation in Alternator. This validation isn't needed
for correctness or safety - the invalid entries would have been
ignored anyway. But this patch is useful for user-experience - the
user should be notified when the request is malformed instead of
ignoring the error.

The fix itself is simple (a new validate_attribute_definitions()
function, calling it in the right place), but much of the contents
of this patch is a fairly large set of tests covering all the
interesting cases of how AttributeDefinitions can be broken.
Particularly interesting is the case where the same AttributeName
appears more than once, e.g., attempting to give two different types
to the same key attribute - which is not allowed.

One of the new tests remains xfail even after this patch - it checks
the case that a user attempts to add a GSI to an existing table where
another GSI defined the key's type differently. This test can't
succeed until we allow adding GSIs to existing tables (Refs #11567).

Fixes #13870.

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

Closes #14556
2023-07-13 11:28:47 +03:00
Tomasz Grabiec
6449c59963 gossiper: Bring back abort on listener failure
The refactoring in c48dcf607a dropped
the noexcept around listener notification. This is probably
unintentional, as the comment which explains why we need to abort was
preserved.

Closes #14573
2023-07-13 11:26:23 +03:00
Kefu Chai
565f5c7380 transport: correct format string when printing logging message
we print the stream id in the logging messages, but in this case,
we forgot to pass `stream` to `log::debug()`. but the placeholder
for `stream` was added. if the underlying fmtlib actually formats
the argument with the format string, it would throw.

fortunately, we don't enable debug level logging often, guess that's
why we haven't spotted this issue yet.

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

Closes #14620
2023-07-13 11:21:43 +03:00
Kefu Chai
3a67c31df0 compaction_manager: pass const reference to ctor
the callers of the constructor does not move variable into this
parameter, and the constructor itself is not able to consume it.
as the parameter is a vector while `compaction_sstable_registration`
use an `unordered_set` for tracking the sstables being compacted.

so, to avoid creating a temporary copy of the vector, let's just
pass by reference.

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

Closes #14661
2023-07-13 11:19:44 +03:00
Petr Gusev
3737bf8fa2 topology.cc: unindex_node: _dc_racks removal fix
The eps reference was reused to manipulate
the racks dictionary. This resulted in
assigning a set of nodes from the racks
dictionary to an element of the _dc_endpoints dictionary.

The problem was demonstrated by the dtest
test_decommission_last_node_in_rack
(scylladb/scylla-dtest#3299).
The test set up four nodes, three on one rack
and one on another, all within a single data
center (dc). It then switched to a
'network_topology_strategy' for one keyspace
and tried to decommission the single node
on the second rack. This decomission command
with error message 'zero replica after the removal.'
This happened because unindex_node assigned
the empty list from the second rack
as a value for the single dc in
_dc_endpoints dictionary. As a result,
we got empty nodes list for single dc in
natural_endpoints_tracker::_all_endpoints,
node_count == 0 in data_center_endpoints,
_rf_left == 0, so
network_topology_strategy::calculate_natural_endpoints
rejected all the endpoints and returned an empty
endpoint_set. In
repair_service::do_decommission_removenode_with_repair
this caused the 'zero replica after the removal' error.

With this fix the test passes both with
--consistent-cluster-management option and
without it.

The specific unit test for this problem was added.

Fixes: #14184

Closes #14673
2023-07-13 11:16:01 +03:00
Mikołaj Grzebieluch
382d797d81 tests: add a parameters argument to code that enables injections 2023-07-13 10:10:52 +02:00
Mikołaj Grzebieluch
507f750754 api/error_injection: add passing injection's parameters to enable endpoint 2023-07-13 10:10:52 +02:00
Mikołaj Grzebieluch
ef712e5d21 tests: utils: error injection: add test for injection's parameters 2023-07-13 10:10:52 +02:00
Mikołaj Grzebieluch
f60580ab3e utils: error injection: add a string-to-string map of injection's parameters
Add `parameters` map. Now tests can attach string data to
injections that can be read in injected code via `injection_handler`.
2023-07-13 10:10:52 +02:00
Mikołaj Grzebieluch
b33714a0f0 utils: error injection: rename received_messages_counter to injection_shared_data
For now, `received_messages_counter` have only data for messaging the injection.
In future, there will be more data to keep, for example, a string-to-string map of
injection's parameters.

Rename this class and its attributes.
2023-07-13 10:10:52 +02:00
Asias He
1b577e0414 repair: Release permit earlier when the repair_reader is done
Consider

- 10 repair instances take all the 10 _streaming_concurrency_sem

- repair readers are done but the permits are not released since they
  are waiting for view update _registration_sem

- view updates trying to take the _streaming_concurrency_sem to make
  progress of view update so it could release _registration_sem, but it
  could not take _streaming_concurrency_sem since the 10 repair
  instances have taken them

- deadlock happens

Note, when the readers are done, i.e., reaching EOS, the repair reader
replaces the underlying (evictable) reader with an empty reader. The
empty reader is not evictable, so the resources cannot be forcibly
released.

To fix, release the permits manually as soon as the repair readers are
done even if the repair job is waiting for _registration_sem.

Fixes #14676

Closes #14677
2023-07-13 11:00:35 +03:00
Nadav Har'El
6a7d980a5d docs/alternator: list more DynamoDB features not in Alternator
This patch adds to docs/alternator/compatibility.md mentions of three
recently-added DynamoDB features (ReturnValuesOnConditionCheckFailure,
DeletionProtectionEnabled and TableClass) which Alternator does not yet
support.

Each of these mentions also links to the github issue we have on each
feature - issues #14481, #14482 and #10431 respectively.

During a review of this patch, the reviewers didn't like that I used
words like "recent" and "new" to describe recently-added DynamoDB
features, and asked that I use specific dates instead. So this is what
I do in this patch for the new features - and I also went back and
fixed a few pre-existing references to "recent" and "new" features,
and added the dates.

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

Closes #14483
2023-07-13 09:52:08 +02:00
Kamil Braun
9d4b3c6036 test: use correct timestamp resolution in test_group0_history_clearing_old_entries
In 10c1f1dc80 I fixed
`make_group0_history_state_id_mutation` to use correct timestamp
resolution (microseconds instead of milliseconds) which was supposed to
fix the flakiness of `test_group0_history_clearing_old_entries`.

Unfortunately, the test is still flaky, although now it's failing at a
later step -- this is because I was sloppy and I didn't adjust this
second part of the test to also use microsecond resolution. The test is
counting the number of entries in the `system.group0_history` table that
are older than a certain timestamp, but it's doing the counting using
millisecond resolution, causing it to give results that are off by one
sometimes.

Fix it by using microseconds everywhere.

Fixes #14653

Closes #14670
2023-07-13 10:33:52 +03:00
Kefu Chai
aeb160a654 sstables: use sstables_manager::uuid_stable_identifier()
instead of accessing the `feature_service`'s member variable, use
the accessor provided by sstable_manager. so we always access the
this setting via a single channel. this should helps with the
readability.

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

Closes #14658
2023-07-13 10:31:06 +03:00
Tomasz Grabiec
b7bc991aa1 Merge 'Fix test_node_isolation flakiness' from Kamil Braun
The test isolates a node and then connects to it through CQL.
The `connect()` step would often timeout on ARM debug builds. This was
already dealt with in the past in the context of other tests: #11289.

The `ManagerClient.con_gen` function creates a connection in a way that
avoids the problem -- connection timeout settings are adjusted to
account for the slowness. Use it in this test to fix the flakiness.

At the same time, reduce the timeout used for the actual CQL request
(after the driver has already connected), because the test expects this
request to timeout and waiting for 200 seconds here is just a waste of
time.

Closes #14663

* github.com:scylladb/scylladb:
  test: test_node_isolation: use `ManagerClient.con_gen` to create CQL connection
  test: manager_client: make `con_gen` for `ManagerClient.__init__` nonoptional
2023-07-12 16:36:54 +02:00