[fs] Optimize OSS retry strategy for QpsLimitExceeded and 5xx errors - #10299
Merged
Merged
Conversation
The Aliyun OSS SDK sends every POST except InitiateMultipartUpload with NoRetryStrategy, so a single 503 QpsLimitExceeded on CompleteMultipartUpload or DeleteObjects fails the write or delete at once, while GET and PUT on the same client ride it out. A retry strategy set on the ClientConfiguration takes precedence over that override. OSSFileIO now installs OSSRetryStrategy on each hadoop-aliyun client: - Retry 429/500/502/503/504 and network errors on every request. The POSTs Paimon sends are safe to repeat: a completed upload answers NoSuchUpload, and DeleteObjects is idempotent. - Back off 300ms * 2^n, capped at 10s and jittered, so throttled writers do not retry in lockstep. The SDK default grows to a 5 minute sleep. fs.oss.attempts.maximum still bounds the number of attempts.
Contributor
|
+1 |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
The Aliyun OSS SDK retries GET and PUT, but never retries a POST other than InitiateMultipartUpload. Completing a multipart upload and deleting objects in batch are both POSTs, so under
503 QpsLimitExceededclosing a data file larger thanfs.oss.multipart.upload.size, or deleting a directory, fails on the first throttled response and takes the Flink or Spark job down with it. The SDK's backoff also has no cap and no jitter, so parallel writers retry in lockstep and a late attempt can sleep for minutes.OSSFileIOnow sets its own retry strategy on each OSS client, covering every request it sends:fs.oss.attempts.maximumstill bounds the number of attempts, andfs.oss.enhanced-retry.enabled=falsefalls back to the SDK default retry.Tests
OSSRetryStrategyTest: 7 new cases, 4 of them against a fake OSS endpoint; 24 tests inpaimon-oss-implpassed.