From 62c910166888dfb9af3222ef0d4f12fa80d5798c Mon Sep 17 00:00:00 2001 From: mulhern Date: Fri, 13 Nov 2026 14:54:23 -0500 Subject: [PATCH 1/7] Revert "Update CI to stratisd v3.9.4" This reverts commit 0bd77dbe5a2cc215c67ca0b34ebc078d724606f7. --- .github/workflows/main.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 42db14c07..eb9d6854b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -139,7 +139,6 @@ jobs: - uses: stratis-storage/github-actions/github-modify@HEAD with: repo: stratisd - default_branch: stratisd-v3.9.4 - name: Print head commit run: git log --oneline -1 working-directory: stratisd @@ -206,7 +205,6 @@ jobs: - uses: stratis-storage/github-actions/github-modify@HEAD with: repo: stratisd - default_branch: stratisd-v3.9.4 - name: Print head commit run: git log --oneline -1 working-directory: stratisd From 732c089bbe4467a536e5b9e31bc8727c2134ac6a Mon Sep 17 00:00:00 2001 From: mulhern Date: Fri, 13 Nov 2026 14:55:42 -0500 Subject: [PATCH 2/7] Reapply "Reapply "Require stratisd 3.10.0"" This reverts commit 294a80e7e53443755983a2d67e7c2d6c8c59d7ab. --- src/stratis_cli/_actions/_constants.py | 2 +- src/stratis_cli/_actions/_introspect.py | 20 ++++++++++---------- src/stratis_cli/_version.py | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/stratis_cli/_actions/_constants.py b/src/stratis_cli/_actions/_constants.py index 2a1131b69..e6e438bf6 100644 --- a/src/stratis_cli/_actions/_constants.py +++ b/src/stratis_cli/_actions/_constants.py @@ -23,7 +23,7 @@ SECTOR_SIZE = 512 MAXIMUM_STRATISD_VERSION = "4.0.0" -MINIMUM_STRATISD_VERSION = "3.9.2" +MINIMUM_STRATISD_VERSION = "3.10.0" assert Version(MINIMUM_STRATISD_VERSION) < Version(MAXIMUM_STRATISD_VERSION) REVISION = f"r{MINIMUM_STRATISD_VERSION.split('.')[1]}" diff --git a/src/stratis_cli/_actions/_introspect.py b/src/stratis_cli/_actions/_introspect.py index 4088c2b39..ac03f6fd9 100644 --- a/src/stratis_cli/_actions/_introspect.py +++ b/src/stratis_cli/_actions/_introspect.py @@ -14,8 +14,8 @@ """, - "org.storage.stratis3.Manager.r9": """ - + "org.storage.stratis3.Manager.r10": """ + @@ -84,8 +84,8 @@ """, - "org.storage.stratis3.Report.r9": """ - + "org.storage.stratis3.Report.r10": """ + @@ -94,8 +94,8 @@ """, - "org.storage.stratis3.blockdev.r9": """ - + "org.storage.stratis3.blockdev.r10": """ + @@ -122,8 +122,8 @@ """, - "org.storage.stratis3.filesystem.r9": """ - + "org.storage.stratis3.filesystem.r10": """ + @@ -150,8 +150,8 @@ """, - "org.storage.stratis3.pool.r9": """ - + "org.storage.stratis3.pool.r10": """ + diff --git a/src/stratis_cli/_version.py b/src/stratis_cli/_version.py index 5d9c5e052..f44b377d3 100644 --- a/src/stratis_cli/_version.py +++ b/src/stratis_cli/_version.py @@ -17,5 +17,5 @@ .. moduleauthor:: mulhern """ -__version_info__ = (3, 9, 3) +__version_info__ = (3, 10, 0) __version__ = ".".join(str(x) for x in __version_info__) From 8252059c7d20a8933d5950aaa2ba54795f95050a Mon Sep 17 00:00:00 2001 From: mulhern Date: Fri, 13 Nov 2026 14:56:03 -0500 Subject: [PATCH 3/7] Reapply "Reapply "Update introspect data"" This reverts commit aaffd5c6e296331994c2357e09e418496aa7a250. --- src/stratis_cli/_actions/_introspect.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/stratis_cli/_actions/_introspect.py b/src/stratis_cli/_actions/_introspect.py index ac03f6fd9..6c8e580ab 100644 --- a/src/stratis_cli/_actions/_introspect.py +++ b/src/stratis_cli/_actions/_introspect.py @@ -246,6 +246,11 @@ + + + + + From a2669838696f935a6830d4dbc66e5a614bd5293f Mon Sep 17 00:00:00 2001 From: mulhern Date: Fri, 13 Nov 2026 14:56:18 -0500 Subject: [PATCH 4/7] Reapply "Reapply "Add pool remove-cache subcommand"" This reverts commit 1920a181f6284576252f81b75b495c81ece6ccbf. --- src/stratis_cli/_actions/_pool.py | 41 +++++++++++ src/stratis_cli/_parser/_pool.py | 16 ++++ tests/integration/pool/test_remove_cache.py | 81 +++++++++++++++++++++ 3 files changed, 138 insertions(+) create mode 100644 tests/integration/pool/test_remove_cache.py diff --git a/src/stratis_cli/_actions/_pool.py b/src/stratis_cli/_actions/_pool.py index e62aaab44..806255f25 100644 --- a/src/stratis_cli/_actions/_pool.py +++ b/src/stratis_cli/_actions/_pool.py @@ -612,6 +612,47 @@ def add_cache_devices(namespace: Namespace): ) ) + @staticmethod + def remove_cache(namespace: Namespace): + """ + Remove the cache from this pool. + + :raises StratisCliEngineError: + :raises StratisCliIncoherenceError: + :raises StratisCliNoChangeError: + """ + from ._data import MOPool, ObjectManager, Pool, pools # noqa: PLC0415 + + pool_id = PoolId.from_parser_namespace(namespace) + assert pool_id is not None + + proxy = get_object(TOP_OBJECT) + managed_objects = ObjectManager.Methods.GetManagedObjects(proxy, {}) + + (pool_object_path, pool_info) = next( + pools(props=pool_id.managed_objects_key()) + .require_unique_match(True) + .search(managed_objects) + ) + + if not bool(MOPool(pool_info).HasCache()): + raise StratisCliNoChangeError("remove-cache", "cache") + + ((removed, devs_removed), return_code, message) = Pool.Methods.RemoveCache( + get_object(pool_object_path), {} + ) + + if return_code != StratisdErrors.OK: # pragma: no cover + raise StratisCliEngineError(return_code, message) + + if not removed: # pragma: no cover + raise StratisCliIncoherenceError( + ( + f"Expected to remove the cache from {pool_id} but " + "stratisd reports that it did not remove the cache." + ) + ) + @staticmethod def extend_data(namespace: Namespace): """ diff --git a/src/stratis_cli/_parser/_pool.py b/src/stratis_cli/_parser/_pool.py index 0af3ff81c..67c3af546 100644 --- a/src/stratis_cli/_parser/_pool.py +++ b/src/stratis_cli/_parser/_pool.py @@ -426,6 +426,22 @@ def verify(self, namespace: Namespace, parser: ArgumentParser): "func": PoolActions.add_cache_devices, }, ), + ( + "remove-cache", + { + "help": "Remove an active pool's cache", + "func": PoolActions.remove_cache, + "groups": [ + ( + "Pool Identifier", + { + "description": ("Choose one option to specify the pool"), + "mut_ex_args": [(True, UUID_OR_NAME)], + }, + ) + ], + }, + ), ( "extend-data", { diff --git a/tests/integration/pool/test_remove_cache.py b/tests/integration/pool/test_remove_cache.py new file mode 100644 index 000000000..954f336e0 --- /dev/null +++ b/tests/integration/pool/test_remove_cache.py @@ -0,0 +1,81 @@ +# Copyright 2026 Red Hat, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +""" +Test 'remove-cache'. +""" + +from uuid import uuid4 + +from dbus_client_gen import DbusClientUniqueResultError +from stratis_cli import StratisCliErrorCodes +from stratis_cli._errors import StratisCliNoChangeError + +from .._misc import RUNNER, TEST_RUNNER, SimTestCase, device_name_list + +_DEVICE_STRATEGY = device_name_list(1, 1) +_DEVICE_STRATEGY_2 = device_name_list(2, 2) +_ERROR = StratisCliErrorCodes.ERROR + + +class RemoveCacheTestCase1(SimTestCase): + """ + Test removing a cache where the cache is non-existent. + """ + + _MENU = ["--propagate", "pool", "remove-cache"] + _POOLNAME = "deadpool" + + def setUp(self): + super().setUp() + command_line = ["pool", "create", self._POOLNAME] + _DEVICE_STRATEGY() + RUNNER(command_line) + + def test_remove(self): + """ + Verify that trying to remove a non-existent cache returns + StratisCliNoChangeError. + """ + command_line = self._MENU + [f"--name={self._POOLNAME}"] + self.check_error(StratisCliNoChangeError, command_line, _ERROR) + + def test_non_existent_pool(self): + """ + Verify that trying to remove a cache from a non-existent pool raises + DbusClientUniqueResultError. + """ + command_line = self._MENU + [f"--uuid={uuid4()}"] + self.check_error(DbusClientUniqueResultError, command_line, _ERROR) + + +class RemoveCacheTestCase2(SimTestCase): + """ + Test removing a cache. + """ + + _MENU = ["--propagate", "pool", "remove-cache"] + _POOLNAME = "deadpool" + + def setUp(self): + super().setUp() + command_line = ["pool", "create", self._POOLNAME] + _DEVICE_STRATEGY() + RUNNER(command_line) + command_line = ["pool", "init-cache", self._POOLNAME] + _DEVICE_STRATEGY_2() + RUNNER(command_line) + + def test_remove(self): + """ + Verify that remove an existing cache succeeds. + """ + command_line = self._MENU + [f"--name={self._POOLNAME}"] + TEST_RUNNER(command_line) From 31022e15e8bcca5dff7afab0ef055f8ef9780d66 Mon Sep 17 00:00:00 2001 From: mulhern Date: Fri, 13 Nov 2026 14:56:35 -0500 Subject: [PATCH 5/7] Reapply "Reapply "Add man pages for pool remove-cache subcommand"" This reverts commit 7059d13e8ca5adcb4bcbcc7c30918f8fcf48b0d4. --- docs/stratis.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/stratis.txt b/docs/stratis.txt index 920630ab2..9a4b27af5 100644 --- a/docs/stratis.txt +++ b/docs/stratis.txt @@ -76,6 +76,8 @@ pool init-cache [..]:: drives, such as SSDs, are used for this purpose. pool add-cache [..]:: Add one or more blockdevs to an existing pool with an initialized cache. +pool remove-cache <(--uuid |--name )>:: + Remove a pool's cache. pool extend-data [--device-uuid ]:: Increase the pool's data capacity with additional storage space offered by its component data devices through, e.g., expansion of a component RAID From 75d54b880da98d83f2511ef9498aa5b87851ebf0 Mon Sep 17 00:00:00 2001 From: mulhern Date: Fri, 13 Nov 2026 14:56:52 -0500 Subject: [PATCH 6/7] Reapply "Reapply "Add MetadataUsed field to detail listing"" This reverts commit c47c2ece318c3281631b65f85bc91ef735263860. --- src/stratis_cli/_actions/_introspect.py | 1 + src/stratis_cli/_actions/_list_pool.py | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/src/stratis_cli/_actions/_introspect.py b/src/stratis_cli/_actions/_introspect.py index 6c8e580ab..4408bb405 100644 --- a/src/stratis_cli/_actions/_introspect.py +++ b/src/stratis_cli/_actions/_introspect.py @@ -285,6 +285,7 @@ + diff --git a/src/stratis_cli/_actions/_list_pool.py b/src/stratis_cli/_actions/_list_pool.py index c3117b5fc..daae775f2 100644 --- a/src/stratis_cli/_actions/_list_pool.py +++ b/src/stratis_cli/_actions/_list_pool.py @@ -451,9 +451,17 @@ def size_str(value: Range | None) -> str: allocated_size = Range(mopool.AllocatedSize()) except DbusClientMissingPropertyError: allocated_size = None + print(f" Allocated: {size_str(allocated_size)}") print(f" Used: {size_str(size_triple.used())}") + try: + metadata_used = Range(mopool.MetadataUsed()) + except DbusClientMissingPropertyError: + metadata_used = None + + print(f" Metadata: {size_str(metadata_used)}") + def display(self): """ List a single pool in detail. From 6b597fc2e38b2baa5d9a8a56b9f988e8dcf5da82 Mon Sep 17 00:00:00 2001 From: mulhern Date: Fri, 13 Nov 2026 14:57:09 -0500 Subject: [PATCH 7/7] Reapply "Reapply "Add a man page entry for the Metadata field"" This reverts commit df51a7e2e89c0412d416859f601a096d90018ed6. --- docs/stratis.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/stratis.txt b/docs/stratis.txt index 9a4b27af5..2f2840a3b 100644 --- a/docs/stratis.txt +++ b/docs/stratis.txt @@ -410,6 +410,13 @@ Space Usage: Used:: The space on the devices that is in use. Used space can be reclaimed. For example, destroying a Stratis filesystem will reduce this value. +Space Usage: Metadata:: + The space on the devices that is set aside for metadata use. This + metadata includes Stratis metadata, and other block layer metadata, + such as that used to manage encryption of a pool or device. It does + not include filesystem metadata, which is considered part of user + data. + FIELDS for stratis pool list [(--uuid |--name )] --stopped UUID::