Skip to content

bulk: synchronous statements surface the lease-relocation marker to the client #173620

Description

Summary:
When a synchronous bulk statement with an execution-locality filter is issued
from a gateway that doesn't match the filter, the coordinator relocates and the
job's Resume returns the lease-relocation marker (jobs.IsLeaseRelocationError).
On the synchronous path this marker is returned to the client as an error even
though the job continues and completes on the destination node — the statement
appears to fail while actually succeeding.

Background:
IMPORT now waits through this: on the marker it calls JobRegistry.WaitForJobs
and reports results from the job's persisted progress. BACKUP/RESTORE still return
the marker to the client (backup_planning.go, restore_planning.go — same
AwaitCompletion -> return err pattern).

Proposed work:

  • Apply the same wait-through to synchronous BACKUP/RESTORE.
  • Persist IMPORT's INSPECT job ID so the relocation path can report a
    non-NULL inspect_job_id (currently NULL there, since the INSPECT job runs
    on the destination and its ID isn't persisted on the import job).

Epic CRDB-65504

Jira issue: CRDB-66931

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-disaster-recoveryC-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)O-agentFiled by an AI agent; usually the result of a human/agent investigation sessionT-sql-foundationsSQL Foundations Team (formerly SQL Schema + SQL Sessions)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions