Skip to content

A drifted owned search index waits through the 60 s backend retry #1368

Open

Description

@doublewhy

Problem

When service materialization finds an index that this content owns but whose Cortex relations mapping fails the product contract, it fails with reason native-product-contract-mismatch (src/aptl/core/deployment/_service_index_materialization.py:362, dev 3bdccc7). Materialization never recreates an owned index (test_owned_existing_index_is_idempotent_no_recreate), so a second apply of the same plan reads the same mapping and fails the same way.

The provisioner still files that failure under aptl.provisioner.backend-start-failed, the only code in _RETRYABLE_APPLY_DIAGNOSTIC_CODES (src/aptl/backends/raes.py:96). For a pack whose adapter admits BEFORE_BACKEND_RETRY, aptl lab start therefore waits 60 s, runs the repair hook and applies again before it reports the refusal (src/aptl/core/lab.py:2542-2563).

The fix for #1325 ends the start without the wait and the retry for unowned-collision only, through a structured LabResult.unretryable flag that the compose step sets for the reasons in _UNRETRYABLE_REASONS (src/aptl/core/deployment/_compose_service_index_realization.py). #1281 (for #1280) adds the drifted-index message and keeps the retryable code for this reason. Neither change covers it.

Scope

Done when

  • A native-product-contract-mismatch failure ends aptl lab start without the 60 s wait and the retry, even when the adapter admits BEFORE_BACKEND_RETRY.
  • Transient backend start failures still get the single retry.
  • Tests cover both outcomes.

Related

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions