Skip to content
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

cloud_storage_clients: add cloud_storage_backend::oracle and fix s3_client::self_configure() #22902

Merged
merged 5 commits into from
Aug 16, 2024

Conversation

WillemKauf
Copy link
Contributor

@WillemKauf WillemKauf commented Aug 15, 2024

As a first step in improving compatibility with OCI, help the s3_client properly self-configure itself for the newly added cloud_storage_backend::oracle value.

The s3_client::self_configure() function performs a check with a ListObjects() request that currently succeeds for OCI, even in the unsupported virtual_host mode. This would result in improper self-configuration, and every other cloud storage API call made to OCI in this configuration fails.

Correct this behavior by inferring the oraclecloud backend through the access_point_uri used, and always self-configure for path-style requests when it is in use.

Backports Required

  • none - not a bug fix
  • none - this is a backport
  • none - issue does not exist in previous branches
  • none - papercut/not impactful enough to backport
  • v24.2.x
  • v24.1.x
  • v23.3.x

Release Notes

Improvements

  • Adds the cloud_storage_backend::oracle value, and helps the s3_client properly configure for OCI storage.

mattschumpert
mattschumpert previously approved these changes Aug 15, 2024
@vbotbuildovich
Copy link
Collaborator

vbotbuildovich commented Aug 15, 2024

new failures in https://buildkite.com/redpanda/redpanda/builds/53004#019157d3-e46d-4571-b35b-1e11f47f1303:

"rptest.tests.scaling_up_test.ScalingUpTest.test_moves_with_local_retention.use_topic_property=True"

new failures in https://buildkite.com/redpanda/redpanda/builds/53004#019157d3-e46a-4c57-9d15-4a3f5ee769f8:

"rptest.tests.audit_log_test.AuditLogTestsAppLifecycle.test_recovery_mode"

@WillemKauf
Copy link
Contributor Author

Force push to

  • Fix conflict introduced by other recent change to ClusterSelfConfigTest (NFC, comment syntax)
  • Fix check for si_settings.bypass_bucket_creation in RedpandaService.clean()
  • Correct comment per docs request

src/v/model/metadata.h Outdated Show resolved Hide resolved
In order to provide future support for OCI. Adds a new backend value
to the `model::cloud_storage_backend` enum.
In the case of S3-compatible providers, we determine the backend
through the access-point/uri if we are already unable to determine
the backend from credential sources.

Split this logic into its own function. It will see future use in the
`s3_client` to assist in self-configuration for required platform specific
configs.
Previously, OCI would mistakenly self-configure itself for the `virtual-host`
style, due to a check with a `ListObjects` request that succeeds.

Oracle states that they only support path-style requests, so this behavior is
strange:

https://www.oracle.com/ca-en/cloud/storage/object-storage/faq/#category-amazon

We now use `infer_backend_from_uri()` to check for the `oracle_s3_compat` backend, and
return `s3_url_style::path` if this backend is detected.
`si_settings.bypass_bucket_creation` allows ducktape users to skip the
creation of a bucket in cloud storage. However, this value was not considered
during the deletion of a bucket in `RedpandaService.clean()`.

Change `RedpandaService.clean()` to consider this value, and potentially return
early/no-op.
To assert that the `oracle` backend will always configure itself
for `path`-style requests.
@WillemKauf WillemKauf force-pushed the oracle_cloud_storage_backend branch from 837b25c to b198688 Compare August 16, 2024 12:29
@WillemKauf
Copy link
Contributor Author

Force push to:

  • Rename cloud_storage_backend::oracle to cloud_storage_backend::oracle_s3_compat.
  • Fix support for BulkDelete

@WillemKauf WillemKauf requested a review from nvartolomei August 16, 2024 12:30
Copy link
Contributor

@nvartolomei nvartolomei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

neat!

@WillemKauf WillemKauf merged commit 441d3fe into redpanda-data:dev Aug 16, 2024
18 checks passed
@vbotbuildovich
Copy link
Collaborator

/backport v24.2.x

@vbotbuildovich
Copy link
Collaborator

Failed to create a backport PR to v24.2.x branch. I tried:

git remote add upstream https://github.com/redpanda-data/redpanda.git
git fetch --all
git checkout -b backport-pr-22902-v24.2.x-196 remotes/upstream/v24.2.x
git cherry-pick -x 8039ed575505a0bf593ce3165a96bbb46562be6c 4921a3240ec66546ce8cd46ac2f92300e654ab0d 229dc0d9c08246e7e7917737240464ee6af7b96d 70d88d5ece4c2eb4040e2a469203e698146ec6fb b198688407acef96c56688994c6a1367cab0bca9

Workflow run logs.

Comment on lines -471 to +472
unknown = 4,
oracle_s3_compat = 4,
unknown
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are names or enum numeric values stored in the configuration system? if the later then it seems problematic to assign a different enum to the 4 value.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The enum type is used to template property<T>, which also uses the enum type and not the underlying_type.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what i mean is: if the underlying numeric enum value is stored in the controller log, then it'd be a problem. does the controller log store the stringified name or the underlying numeric vavlue?

Copy link
Contributor Author

@WillemKauf WillemKauf Aug 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I am reading, keys and values are left in raw string format when applying updates in the config_manager state machine

I now see the reason for concern though. Persisting this configuration in raft0 as a the raw underlying_type didn't cross my mind when making this change- I'll keep staring at it and revert the change if it ends up being dangerous.

Copy link
Member

@dotnwat dotnwat Aug 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for looking!

@@ -327,6 +327,21 @@ operator<<(std::ostream& o, const client_self_configuration_output& r) {
r);
}

model::cloud_storage_backend
infer_backend_from_uri(const access_point_uri& uri) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants