Skip to content

[Bug]: AsyncRestoreManager in async_client.py duplicates the obsolete FROM SNAPSHOT SQL #31377

Closed as duplicate

Description

@Ariznawlll

DRAFT 3 (SDK, 2026-10-27) — candidate issue, not yet filed

Title: [Bug]: AsyncRestoreManager in async_client.py duplicates the obsolete FROM SNAPSHOT restore SQL (parallel copy of the #31190 defect)

Description

#31190 filed that RestoreManager/AsyncRestoreManager in restore.py (and pitr.py) emit the long-removed RESTORE ... FROM SNAPSHOT syntax. Audit today found the defect also lives in a second, independent copy: matrixone/async_client.py contains its own hand-duplicated class AsyncRestoreManager (lines ~262-346) with the identical dead grammar:

# async_client.py:272
sql = f"RESTORE CLUSTER FROM SNAPSHOT {self.client._escape_identifier(snapshot_name)}"
# async_client.py:283 onward — RESTORE ACCOUNT ... FROM SNAPSHOT ... [TO ACCOUNT ...]

This is a copy-pasted duplicate of restore.py's manager (different type, different module) rather than an import — so any fix landing in restore.py/pitr.py will not touch the async_client.py copy, and the async API will remain broken (all four restore entry points: cluster, tenant, database, table) even after the linked issue is closed.

For completeness, the same duplication audit on the snapshot-creating side shows the async surface also embeds clone helpers (clone_table, clone_table_with_snapshot, clone_database, ... in async_client.py) whose SQL re-implements the clone builders — worth re-using one builder module instead, but those aren't broken per se; the restore copy is the concrete defect.

Reproduction

from matrixone.async_client import AsyncClient
ac = AsyncClient()
await ac.connect(...)
await ac.restore.restore_table("snap", "acc", "db", "t")
# server: ERROR 1064 ... near " SNAPSHOT `snap`"  (same as #31190 evidence)

Or statically: grep -n "FROM SNAPSHOT" matrixone/async_client.py → 8 hits, all inside the duplicated AsyncRestoreManager.

Impact

Expected behavior

Fix the grammar in the async_client.py copy along with restore.py/pitr.py (or better: delete the duplicate and re-export through a shared builder so it cannot diverge). Regression test: one async test asserting the emitted SQL matches the current server grammar (RESTORE DATABASE ...{snapshot="..."}), or a live restore round-trip through the async client.

Activity

  1. added
    kind/bug
    on Oct 27, 2026
  2. added this to the MO-202610 milestone on Oct 27, 2026
  3. added theissue type on Oct 27, 2026
  4. XuPeng-SH commented on Oct 28, 2026

    @XuPeng-SH
    Contributor

    Consolidated into #31190. The original report and reproduction remain here, and its additional acceptance cases are recorded in #31190. Closing as a duplicate only consolidates tracking; it does not mean the defect has been fixed.

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

Metadata

Metadata

Assignees

Labels

kind/bugneeds-triage

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions