-
Notifications
You must be signed in to change notification settings - Fork 596
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cst/cache: allow admin api trim only if cache is initialized
Fixes UBSAN assertion caused by invoking a function call on uninitialized cache object. include/c++/v1/vector:1394:10: runtime error: reference binding to null pointer of type 'seastar::sharded<cloud_storage::cache>::entry'
- Loading branch information
1 parent
38fdff4
commit 30a15ed
Showing
2 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import pytest | ||
from requests import HTTPError | ||
|
||
from rptest.services.admin import Admin | ||
from rptest.services.cluster import cluster | ||
from rptest.tests.redpanda_test import RedpandaTest | ||
|
||
|
||
class CloudStorageCacheAdminApisNoCacheTest(RedpandaTest): | ||
""" | ||
Test the Cloud Storage Cache Admin APIs when tiered storage is not configured. | ||
""" | ||
def __init__(self, test_context): | ||
super().__init__(test_context, num_brokers=1) | ||
self.admin = Admin(self.redpanda) | ||
|
||
@cluster(num_nodes=1) | ||
def test_admin_apis(self): | ||
for node in self.redpanda.nodes: | ||
with pytest.raises(HTTPError) as excinfo: | ||
self.admin.cloud_storage_trim(byte_limit=None, | ||
object_limit=None, | ||
node=node) | ||
|
||
assert "Cloud Storage Cache is not available. Is cloud storage enabled?" == excinfo.value.response.json( | ||
)['message'] |