v.23.2Improvement

Add optional S3 setting allow_head_object_request to use GetObjectAttributes by default.

Add a new S3 setting allow_head_object_request. This PR makes usage of GetObjectAttributes request instead of HeadObject introduced in https://github.com/ClickHouse/ClickHouse/pull/45288 optional (and disabled by default). #45701 (Vitaly Baranov).
Introduces a new S3 setting allow_head_object_request to optionally use the HeadObject request instead of the newer GetObjectAttributes request when accessing S3 objects.

Why it matters

The feature allows users to choose between the GetObjectAttributes request, which is used by default, and the legacy HeadObject request for retrieving metadata about S3 objects. This flexibility can help in environments where GetObjectAttributes is unsupported or causes issues, improving compatibility with different S3 providers.

How to use it

To enable the use of the HeadObject request instead of the default GetObjectAttributes, set the S3 setting allow_head_object_request to true. By default, this setting is false, so GetObjectAttributes will be used unless overridden.