v.23.3Improvement

Add Expiration Window for S3 Credentials to Prevent ExpiredToken Errors

Add an expiration window for S3 credentials that have an expiration time to avoid ExpiredToken errors in some edge cases. It can be controlled with expiration_window_seconds config, the default is 120 seconds. #47423 (Antonio Andelic).
Added an expiration window for S3 credentials with expiration times to prevent ExpiredToken errors in certain edge cases.

Why it matters

This feature addresses the issue where S3 credentials expire exactly at their expiration time, causing ExpiredToken errors. By introducing an expiration window, ClickHouse refreshes the credentials earlier, improving stability and reducing authentication failures when accessing S3.

How to use it

Users can control this behavior with the expiration_window_seconds configuration parameter. The default value is 120 seconds, meaning ClickHouse will consider credentials expired 2 minutes before their actual expiration time to avoid token errors. To apply, set expiration_window_seconds in the S3 configuration section.