Skip to content

Commit

Permalink
fix(scylla-sstable): switch from --scylla-yaml-file to `SCYLLA_CONF…
Browse files Browse the repository at this point in the history
…` env variable

since the scylla sstable code doesn't fallback into any other option
but reading schema from sstable of system tables, if --scylla-yaml-file is used.

switching to SCYLLA_CONF env variable should make the tool use other fallback
options like reading the assuming the schema from the sstable we want to read.

Ref: scylladb/scylla-enterprise#4660
(cherry picked from commit 92febe8)
  • Loading branch information
fruch committed Sep 15, 2024
1 parent 6faf815 commit 524320e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions sdcm/utils/sstable/sstable_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import json
import logging
import random
from pathlib import Path

from sdcm.paths import SCYLLA_YAML_PATH
from sdcm.utils.version_utils import ComparableScyllaVersion
Expand Down Expand Up @@ -69,8 +70,8 @@ def check_that_sstables_are_encrypted(self, sstables=None, # pylint: disable=to

if ComparableScyllaVersion(self.db_node.scylla_version) >= '2023.1.3':
dump_cmd = (
f"{self.db_node.add_install_prefix('/usr/bin/scylla')} sstable dump-scylla-metadata"
f" --scylla-yaml-file {self.db_node.add_install_prefix(SCYLLA_YAML_PATH)}"
f"SCYLLA_CONF={Path(self.db_node.add_install_prefix(SCYLLA_YAML_PATH)).parent}"
f" {self.db_node.add_install_prefix('/usr/bin/scylla')} sstable dump-scylla-metadata"
" --logger-log-level scylla-sstable=debug"
f" --keyspace {self.keyspace} --table {self.table} --sstables"
)
Expand Down
5 changes: 3 additions & 2 deletions upgrade_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from functools import wraps, cache
from typing import List
import contextlib
from pathlib import Path

import cassandra
import tenacity
Expand Down Expand Up @@ -806,8 +807,8 @@ def test_rolling_upgrade(self): # pylint: disable=too-many-locals,too-many-stat
if should_use_sstabledump:
dump_cmd = 'sstabledump'
else:
dump_cmd = (f'{first_node.add_install_prefix("/usr/bin/scylla")} sstable dump-data '
f'--scylla-yaml-file {first_node.add_install_prefix(SCYLLA_YAML_PATH)} '
dump_cmd = (f'SCYLLA_CONF={Path(first_node.add_install_prefix(SCYLLA_YAML_PATH)).parent} '
f'{first_node.add_install_prefix("/usr/bin/scylla")} sstable dump-data '
f'--keyspace {keyspace} '
f'--table {table} '
'--sstables')
Expand Down

0 comments on commit 524320e

Please sign in to comment.