Skip to content

resource_group client: narrow degraded fallback conditions for GetResourceGroup #11010

Description

@ystaticy

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/enhancementThe issue or PR belongs to an enhancement.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions