Enhancement Task
As suggested in PR comment: pingcap/tidb#68105 (comment)
Refine the degraded fallback behavior of GetResourceGroup when degradedRUSettings is configured.
Currently, degraded fallback is too broad and may hide original errors from RM. We should only use degraded fallback for transient RM failures, while preserving original errors for non-retryable cases.
Expected behavior:
- transient RM unavailability -> degraded group
- RM recovery -> real group
- resource group not found -> original error
- caller cancellation/deadline -> original context error
- generic non-retryable error -> original error
- nonexistent
SwitchGroup target -> do not switch
It is also helpful to preserve the underlying error from ErrClientGetResourceGroup so upper layers can correctly inspect errors such as context.Canceled and context.DeadlineExceeded.
Enhancement Task
As suggested in PR comment: pingcap/tidb#68105 (comment)
Refine the degraded fallback behavior of
GetResourceGroupwhendegradedRUSettingsis configured.Currently, degraded fallback is too broad and may hide original errors from RM. We should only use degraded fallback for transient RM failures, while preserving original errors for non-retryable cases.
Expected behavior:
SwitchGrouptarget -> do not switchIt is also helpful to preserve the underlying error from
ErrClientGetResourceGroupso upper layers can correctly inspect errors such ascontext.Canceledandcontext.DeadlineExceeded.