Skip to content

Honor preferredGateway as a pinned connector with elimination-only veto #445

Description

@prajjwalkumar17

Description

Hyperswitch is adding orchestration-owned preferred-connector routing (juspay/hyperswitch#14412): it remembers the connector behind a customer's last successful interac payment and sends it on the hybrid routing request as the existing optional PaymentInfo.preferredGateway field.

Today that field only influences a decision in the (preferredGateway, dynamicSwitchingEnabled=false) corner — on the V2 path dynamicSwitchingEnabled is synthesized as eligible_list.len() > 1, so with two or more eligible connectors the preference has no effect and SR ranking decides.

Proposed behavior

When a decide request carries preferredGateway and it is present in the post-enforcement functional list:

  • front the priority order with it (static order otherwise preserved),
  • skip the SR-v3 reorder; multi-objective and volume-commitment post-steps stand down,
  • keep outage and elimination scoring fully active — a demoted preferred connector must lose to the next connector in the static order,
  • label the decision PREFERRED_CONNECTOR_ROUTING (downtime variants keep the token so feedback admission survives elimination events),
  • leave update-gateway-score untouched so pinned traffic keeps training success-rate windows and elimination scores.

A preference that is absent or not functional must behave exactly like today's no-preference flow — including not hard-failing the single-entry-list corner.

🤖 Generated with Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions