Commit Graph

671 Commits

Author SHA1 Message Date
Benny Halevy
b12b142232 api: add /storage_service/compact
For major compacting all tables in the database.
The advantage of this api is that `commitlog->force_new_active_segment`
happens only once in `database::flush_all_tables` rather than
once per keyspace (when `nodetool compact` translates to
a sequence of `/storage_service/keyspace_compaction` calls).

Signed-off-by: Benny Halevy <bhalevy@scylladb.com>
2023-11-28 16:37:42 +02:00
Benny Halevy
1b576f358b api: add /storage_service/flush
For flushing all tables in the database.
The advantage of this api is that `commitlog->force_new_active_segment`
happens only once in `database::flush_all_tables` rather than
once per keyspace (when `nodetool flush` translates to
a sequence of `/storage_service/keyspace_flush` calls).

Signed-off-by: Benny Halevy <bhalevy@scylladb.com>
2023-11-28 16:37:42 +02:00
Benny Halevy
1fd85bd37b api: compaction: add flush_memtables option
When flushing is done externally, e.g. by running
`nodetool flush` prior to `nodetool compact`,
flush_memtables=false can be passed to skip flushing
of tables right before they are major-compacted.

This is useful to prevent creation of small sstables
due to excessive memtable flushing.

Signed-off-by: Benny Halevy <bhalevy@scylladb.com>
2023-11-28 16:37:42 +02:00
Benny Halevy
9324363e55 scylla-nodetool, docs: improve optional params documentation
Document the behavior if no keyspace is specified
or no table(s) are specified for a given keyspace.

Fixes scylladb/scylladb#16032

Signed-off-by: Benny Halevy <bhalevy@scylladb.com>
2023-11-28 16:37:42 +02:00
Botond Dénes
fe7c81ea30 Update ./tools/jmx and ./tools/java submodules
* ./tools/jmx 05bb7b68...80ce5996 (4):
  > StorageService: Normalize endpoint inetaddress strings to java form

Fixes #16039

  > ColumnFamilyStore: only quote table names if necessary
  > APIBuilder: allow quoted scope names
  > ColumnFamilyStore: don't fail if there is a table with ":" in its name

Fixes #16153

* ./tools/java 10480342...26f5f71c (1):
  > NodeProbe: allow addressing table name with colon in it

Also needed for #16153

Closes scylladb/scylladb#16146
2023-11-26 13:35:38 +02:00
Raphael S. Carvalho
157a5c4b1b treewide: Avoid using namespace sstables in header to avoid conflicts
That's needed for compaction_group.hh to be included in headers.

Signed-off-by: Raphael S. Carvalho <raphaelsc@scylladb.com>
2023-11-23 17:36:57 +02:00
Avi Kivity
00d82c0d54 Update tools/java submodule
* tools/java 8485bef333...1048034277 (1):
  > resolver: download sigar artifact only for Linux / AMD64
2023-11-22 18:02:04 +02:00
Kefu Chai
48340380dd scylla-sstable: print "validate" result in JSON
instead of printing the result of the "validate" subcommand in a
free-style plain text, let's print it using JSON. for two reasons:

1. it is simpler to consume the output with other tools and tests.
2. more consistent with other commands.

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

Closes scylladb/scylladb#16105
2023-11-22 17:44:07 +02:00
Kefu Chai
ca1828c718 scylla-sstable: print "validate-checksum" result in JSON
instead of printing the result of the "validate-checksum" subcommand
with the logging message, let's print it using JSON. for three reasons:

1. it is simpler to consume the output with other tools and tests.
2. more consistent with other commands.
3. the logging system is used for audit the behavior and for debugging
   purposes, not for building a user-facing command line interface.
4. the behavior should match with the corresponding document. and
   in docs/operating-scylla/admin-tools/scylla-sstable.sst, we claim
   that `validate-checksums` subcommand prints a dict of

   ```
   $ROOT := { "$sstable_path": Bool, ... }
   ```

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

Closes scylladb/scylladb#16106
2023-11-22 17:44:07 +02:00
Botond Dénes
935065fd8d Update tools/java submodule
* tools/java b776096d...8485bef3 (2):
  > dist: Require jre-11-headless in from rpm
  > dist: remove duplicated java-headless from "Requires"
2023-11-20 13:55:55 +02:00
Piotr Grabowski
321459ec51 install-dependencies.sh: update node_exporter to 1.7.0
Update node_exporter to 1.7.0.

The previous version (1.6.1) was flagged by security scanners (such as
Trivy) with HIGH-severity CVE-2023-39325. 1.7.0 release fixed that
problem.

[Botond: regenerate frozen toolchain]

Fixes #16085

Closes scylladb/scylladb#16086

Closes scylladb/scylladb#16090
2023-11-19 18:15:44 +02:00
Botond Dénes
323e34e1ed Update tools/java submodule
* tools/java 97c49094...b776096d (2):
  > build: take care of old libthrift [PART 2/2]
  > build: take care of old libthrift [PART 1/2]
2023-11-16 10:14:38 +02:00
Kefu Chai
d49ea833fd scylla-sstable: reject duplicate sstable names
before this change, `load_sstables()` fills the output sstables vector
by indexing it with the sstable's path. but if there are duplicated
items in the given sstable_names, the returned vector would have uninitialized
shared_sstable instance(s) in it. if we feed such a sstables to the
operation funcs, they would segfault when derferencing the empty
lw_shared_ptr.

in this change, we error out if duplicated sstable names are specified
in the command line.

an alternative is to tolerate this usage by initializing the sstables
vector with a back_inserter, as we always return a dictionary with the
sstable's name as the key, but it might be desirable from user's
perspective to preserve the order, like OrderedDict in Python. so
let's preserve the ordering of the sstables in the command line.

this should address the problem of the segfault if we pass duplicated
sstable paths to this tool.

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

Closes scylladb/scylladb#16048
2023-11-14 19:37:14 +02:00
Kefu Chai
efd65aebb2 build: cmake: add check-header target
to have feature parity with `configure.py`. we won't need this
once we migrate to C++20 modules. but before that day comes, we
need to stick with C++ headers.

we generate a rule for each .hh files to create a corresponding
.cc and then compile it, in order to verify the self-containness of
that header. so the number of rule is quite large, to avoid the
unnecessary overhead. the check-header target is enabled only if
`Scylla_CHECK_HEADERS` option is enabled.

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

Closes scylladb/scylladb#15913
2023-11-13 10:27:06 +02:00
Avi Kivity
7b08886e8d Update tools/java submodule (dependencies update)
* tools/java 86a200e324...97c490947c (1):
  > Merge 'build: update several dependencies' from Piotr Grabowski

Ref https://github.com/scylladb/scylla-tools-java/issues/348
Ref https://github.com/scylladb/scylla-tools-java/issues/349
Ref https://github.com/scylladb/scylla-tools-java/issues/350
2023-11-12 18:17:04 +02:00
Botond Dénes
7ff7cdc86a tools/scylla-nodetool: implement enableautocompaction command 2023-11-07 09:49:56 -05:00
Botond Dénes
0e0401a5c5 tools/scylla-nodetool: implement disableautocompaction command 2023-11-07 09:49:56 -05:00
Botond Dénes
f5083f66f5 tools/scylla-nodetool: implement the flush command 2023-11-07 09:49:56 -05:00
Botond Dénes
f082cc8273 tools/scylla-nodetool: extract keyspace/table parsing
Having to extract 1 keyspace and N tables from the command-line is
proving to be a common pattern among commands. Extract this into a
method, so the boiler-plate can be shared. Add a forward-looking
overload as well, which will be used in the next patch.
2023-11-07 09:49:56 -05:00
Botond Dénes
ec5b24550a tools/scylla-nodetool: implement the drain command 2023-11-07 09:49:56 -05:00
Botond Dénes
598dbd100d tools/scylla-nodetool: implement the snapshot command 2023-11-07 09:49:56 -05:00
Benny Halevy
a1acf6854b everywhere: reduce dependencies on i_partitioner.hh
Signed-off-by: Benny Halevy <bhalevy@scylladb.com>
2023-11-05 20:47:44 +02:00
Botond Dénes
665a5cb322 Update tools/jmx submodule
* tools/jmx 8d15342e...05bb7b68 (4):
  > README: replace 0xA0 (NBSP) character with space
  > scylla-apiclient: update Guava dependency
  > scylla-apiclient: update snakeyaml dependency
  > scylla-apiclient: update Jackson dependencies

[Botond: regenerate frozen toolchain]
2023-11-01 08:08:37 -04:00
Botond Dénes
287f05ad26 Merge 'scylla-sstable/tools: Use semi-properly initiated db::config + extensions to allow encrypted sstables' from Calle Wilund
Refs https://github.com/scylladb/scylla-enterprise/issues/3461
Refs https://github.com/scylladb/scylla-enterprise/issues/3210

Adds a tool-app global db::config + extensions to each tool invocation + configurable init.
Uses this in scylla-sstables, allowing both enterprise-only configs to be read, as well as (almost all)
encrypted sstables.

Note: Do not backport to enterprise before https://github.com/scylladb/scylla-enterprise/pull/3473 is merged, otherwise tools will break there.

Closes scylladb/scylladb#15615

* github.com:scylladb/scylladb:
  scylla-sstable: Use tool-global config + extensions
  tools: Add db config + extensions to tool app run
2023-10-31 14:21:57 +02:00
Kefu Chai
2cd804b8e5 build: cmake: do not hardwire build_reloc.sh arguments
before this change, we feed `build_reloc.sh` with hardwired arguments
when building python3 submodule. but this is not flexible, and hurts
the maintainability.

in this change, we mirror the behavior of `configure.py`, and collect
the arguments from the output of `install-dependencies.sh`, and feed
the collected argument to `build_reloc.sh`.

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

Closes scylladb/scylladb#15885
2023-10-31 13:27:12 +02:00
Calle Wilund
b9e57583f3 scylla-sstable: Use tool-global config + extensions
Uses a single db::config + extensions, allowing both handling
of enterprise-only scylla.yaml keys, as well as loading sstables
utilizing extension in that universe.
2023-10-30 10:22:12 +00:00
Calle Wilund
6de4e7af21 tools: Add db config + extensions to tool app run
Initializes extensions for tools runs, allowing potentially more interaction
with, say, sstables in some versions of scylla.
2023-10-30 10:20:53 +00:00
Botond Dénes
16ce212c31 tools/scylla-nodetool: implement the listsnapshots command
The output is changed slightly, compared to the current nodetool:
* Number columns are aligned to the right
* Number columns don't have decimal places
* There are no trailing whitespaces
2023-10-27 01:26:54 -04:00
Botond Dénes
27854a50be tools/scylla-nodetool: implement clearsnapshot command 2023-10-27 01:26:54 -04:00
Botond Dénes
b32ee54ba0 tools/scylla-nodetool: implement the cleanup command
The --jobs command-line argument is accepted but ignored, just like the
current nodetool does.
2023-10-27 01:26:53 -04:00
Botond Dénes
b878dcc1c3 tools/scylla-nodetool: log responses with trace level
With this, both requests and responses to/from the remote are logged
when trace-level logging is enabled. This should greatly simplify
debugging any problems.
2023-10-26 08:28:37 -04:00
Botond Dénes
0cba973972 Update tools/java submodule
* tools/java 3c09ab97...86a200e3 (1):
  > cassandra-stress: add storage options
2023-10-24 09:41:36 +03:00
Aleksandra Martyniuk
0c6a3f568a compaction: delete default_compaction_progress_monitor
default_compaction_progress_monitor returns a reference to a static
object. So, it should be read-only, but its users need to modify it.

Delete default_compaction_progress_monitor and use one's own
compaction_progress_monitor instance where it's needed.

Closes scylladb/scylladb#15800
2023-10-23 16:03:34 +03:00
Botond Dénes
4b57c2bf18 tools/scylla-nodetool: implement compactionhistory command 2023-10-20 10:55:38 -04:00
Botond Dénes
a212ddc5b1 tools/scylla-nodetool: implement stop command 2023-10-20 10:04:56 -04: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
Avi Kivity
854188a486 Merge 'database, storage_proxy: Reconcile pages with dead rows and partitions incrementally' from Botond Dénes
Currently, mutation query on replica side will not respond with a result which doesn't have at least one live row. This causes problems if there is a lot of dead rows or partitions before we reach a live row, which stem from the fact that resulting reconcilable_result will be large:

1. Large allocations.  Serialization of reconcilable_result causes large allocations for storing result rows in std::deque
2. Reactor stalls. Serialization of reconcilable_result on the replica side and on the coordinator side causes reactor stalls. This impacts not only the query at hand. For 1M dead rows, freezing takes 130ms, unfreezing takes 500ms. Coordinator  does multiple freezes and unfreezes. The reactor stall on the coordinator side is >5s
3. Too large repair mutations. If reconciliation works on large pages, repair may fail due to too large mutation size. 1M dead rows is already too much: Refs https://github.com/scylladb/scylladb/issues/9111.

This patch fixes all of the above by making mutation reads respect the memory accounter's limit for the page size, even for dead rows.

This patch also addresses the problem of client-side timeouts during paging. Reconciling queries processing long strings of tombstones will now properly page tombstones,like regular queries do.

My testing shows that this solution even increases efficiency. I tested with a cluster of 2 nodes, and a table of RF=2. The data layout was as follows (1 partition):
* Node1: 1 live row, 1M dead rows
* Node2: 1M dead rows, 1 live row

This was designed to trigger reconciliation right from the very start of the query.

Before:
```
Running query (node2, CL=ONE, cold cache)
Query done, duration: 140.0633503ms, pages: 101, result: [Row(pk=0, ck=3000000, v=0)]
Running query (node2, CL=ONE, hot cache)
Query done, duration: 66.7195275ms, pages: 101, result: [Row(pk=0, ck=3000000, v=0)]
Running query (all-nodes, CL=ALL, reconcile, cold-cache)
Query done, duration: 873.5400742ms, pages: 2, result: [Row(pk=0, ck=0, v=0), Row(pk=0, ck=3000000, v=0)]
```

After:
```
Running query (node2, CL=ONE, cold cache)
Query done, duration: 136.9035122ms, pages: 101, result: [Row(pk=0, ck=3000000, v=0)]
Running query (node2, CL=ONE, hot cache)
Query done, duration: 69.5286021ms, pages: 101, result: [Row(pk=0, ck=3000000, v=0)]
Running query (all-nodes, CL=ALL, reconcile, cold-cache)
Query done, duration: 162.6239498ms, pages: 100, result: [Row(pk=0, ck=0, v=0), Row(pk=0, ck=3000000, v=0)]
```

Non-reconciling queries have almost identical duration (1 few ms changes can be observed between runs). Note how in the after case, the reconciling read also produces 100 pages, vs. just 2 pages in the before case, leading to a much lower duration (less than 1/4 of the before).

Refs https://github.com/scylladb/scylladb/issues/7929
Refs https://github.com/scylladb/scylladb/issues/3672
Refs https://github.com/scylladb/scylladb/issues/7933
Fixes https://github.com/scylladb/scylladb/issues/9111

Closes scylladb/scylladb#15414

* github.com:scylladb/scylladb:
  test/topology_custom: add test_read_repair.py
  replica/mutation_dump: detect end-of-page in range-scans
  tools/scylla-sstable: write: abort parser thread if writing fails
  test/pylib: add REST methods to get node exe and workdir paths
  test/pylib/rest_client: add load_new_sstables, keyspace_{flush,compaction}
  service/storage_proxy: add trace points for the actual read executor type
  service/storage_proxy: add trace points for read-repair
  storage_proxy: Add more trace-level logging to read-repair
  database: Fix accounting of small partitions in mutation query
  database, storage_proxy: Reconcile pages with no live rows incrementally
2023-10-05 22:39:34 +03:00
Avi Kivity
197b7590df Update tools/jmx submodule
* tools/jmx d107758...8d15342 (2):
  > Revert "install-dependencies.sh: do not install weak dependencies"
  > install-dependencies.sh: do not install weak dependencies Especially for Java, we really do not need the tens of packages and MBs it adds, just because Java apps can be built and use sound and graphics and whatnot.
2023-10-05 22:36:54 +03:00
Avi Kivity
ee57f69b17 Update tools/java submodule
* tools/java 9dddad27bf...3c09ab97a9 (1):
  > nodetool: parse and forward -h|--host to nodetool
2023-10-05 22:35:58 +03:00
Botond Dénes
96787ec0a5 Merge 'Do not keep excessive info on sstables::entry_descriptor' from Pavel Emelyanov
The descriptor in question is used to parse sstable's file path and return back the result. Parser, among "relevant" info, also parses sstable directory and keyspace+table names. However, there are no code (almost) that needs those strings. And the need to construct descriptor with those makes some places obscurely use empty strings.

The PR removes sstable's directory, keyspace and table names from descriptor and, while at it, relaxes the sstable directory code that makes descriptor out of a real sstable object by (!) parsing its Data file path back.

Closes scylladb/scylladb#15617

* github.com:scylladb/scylladb:
  sstables: Make descriptor from sstable without parsing
  sstables: Do not keep directory, keyspace and table names on descriptor
  sstables: Make tuple inside helper parser method
  sstables: Do not use ks.cf pair from descriptor
  sstables: Return tuple from parse_path() without ks.cf hints
  sstables: Rename make_descriptor() to parse_path()
2023-10-05 15:15:23 +03:00
Pavel Emelyanov
14ee59fb04 sstables: Do not use ks.cf pair from descriptor
There's only one place that needs ks.cf pair from the parsed desctipror
-- sstables loader from tools/. This code already has ks.cf from the
tuple returned after parsing and can use them.

Signed-off-by: Pavel Emelyanov <xemul@scylladb.com>
2023-10-05 12:21:01 +03:00
Pavel Emelyanov
62d71d398f sstables: Return tuple from parse_path() without ks.cf hints
There are two path parsers. One of them accepts keyspace and table names
and the other one doesn't. The latter is then supposed to parse the
ks.cf pair from path and put it on the descriptor. This patch makes this
method return ks.cf so that later it will be possible to remove these
strings from the desctiptor itself.

Signed-off-by: Pavel Emelyanov <xemul@scylladb.com>
2023-10-05 12:21:00 +03:00
Pavel Emelyanov
d56f9db121 sstables: Rename make_descriptor() to parse_path()
The method really parses provided path, so the existing name is pretty
confusing. It's extra confusing in the table::get_snapshot_details()
where it's just called and the return value is simply ignored.

Named "parse_..." makes it clear what the method is for.

Signed-off-by: Pavel Emelyanov <xemul@scylladb.com>
2023-10-05 11:04:07 +03:00
Avi Kivity
6d5823e8f5 Regenerate frozen toolchain for new Python driver
Update to scylla-driver 3.26.3.

Closes scylladb/scylladb#15629
2023-10-05 10:09:53 +03:00
Botond Dénes
62cdc36a74 tools/scylla-nodetool: implement help operation
Nodetool considers "help" to be just another operation. So implement it
as such. The usual --help and --help <command> is also supported.
2023-10-04 05:27:09 -04:00
Botond Dénes
1efabca515 tools/scylla-nodetool: implement the traceprobability commands
gettraceprobability and settraceprobability
2023-10-04 05:27:09 -04:00
Botond Dénes
25d41f72c4 tools/scylla-nodetool: implement the gossip commands
disablegossip, enablegossip and statusgossip
2023-10-04 05:27:09 -04:00
Botond Dénes
5bc25dbebe tools/scylla-nodetool: implement the binary commands
disablebinary, enablebinary and statusbinary
2023-10-04 05:27:09 -04:00
Botond Dénes
2ac1705c90 tools/scylla-nodetool: implement backup related commands
disablebackup, enablebackup and statusbackup
2023-10-04 05:27:09 -04:00
Botond Dénes
91e62413c8 tools/scylla-nodetool: implement version command 2023-10-04 05:27:09 -04:00