-
Notifications
You must be signed in to change notification settings - Fork 580
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix shadow indexing mode selection #6663
Conversation
dbb3989
to
c4e997e
Compare
def test_shadow_indexing_mode(self, cloud_storage_enable_remote_read, | ||
cloud_storage_enable_remote_write, | ||
topic_remote_read, topic_remote_write): | ||
to_bool = lambda x: True if x == "true" else False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: this could be simplified to:
to_bool = lambda x: True if x == "true" else False | |
to_bool = lambda x: x == "true" |
or maybe even compare directly:
read = ret["redpanda.remote.read"][0] == "true"
Previously, topic level overrides of remote read/write were not honoured in some cases. For example, if remote write was enabled at the cluster level (cloud_storage_enable_remote_write=true) and disabled at the topic level (redpanda.remote.write=false), remote writes would still be performed. This is due to a bug in the logic which chooses the SI mode: if none of the topic level overrides are true, 'get_shadow_indexing_mode` returns a std::nullopt which causes the default value of the properties to be used. The default value is whatever the cluster level config is set to. This commit fixes the issue. Note that we may still return a std::nullopt if both remote read and write are unspecified at the topic level. This means that the topic will always follow the cluster level remote read/write configuration.
c4e997e
to
55fd2bf
Compare
Changes in force-push:
|
/backport v22.2.x |
/backport v22.1.x |
Failed to run cherry-pick command. I executed the below command:
|
Failed to run cherry-pick command. I executed the below command:
|
/backport v22.2.x |
/backport v22.1.x |
Failed to run cherry-pick command. I executed the below command:
|
Failed to run cherry-pick command. I executed the below command:
|
Cover letter
Previously, topic level overrides of remote read/write were not honoured
in some cases. For example, if remote write was enabled at the cluster
level (cloud_storage_enable_remote_write=true) and disabled at the topic
level (redpanda.remote.write=false), remote writes would still be
performed. This is due to a bug in the logic which chooses the SI mode:
if none of the topic level overrides are true,
'get_shadow_indexing_mode` returns a std::nullopt which causes the
default value of the properties to be used. The default value is
whatever the cluster level config is set to.
This PR fixes the issue and adds ducktape tests for the SI mode selection.
Backport Required
UX changes
Release notes
Bug Fixes