Skip to content

[Feature Request]: Native table TTL (automatic expiry) #24552

Description

@dengn

Version: 8.0.30-MatrixOne-v3.0.11 (MatrixOne v3.0.11)

No native TTL clause exists for automatically expiring old rows/partitions. This is important for high-volume, short-lived data (logs / traces / metrics) where you want cheap automatic retention instead of expensive DELETEs.

Reproduce

CREATE TABLE t(id INT, ts TIMESTAMP) TTL ts + INTERVAL 7 DAY;   -- SQL parser error

Request
Support a native TTL clause (time-based row/partition expiry).


Found while evaluating MatrixOne git4data / SQL as a data-versioning & agent-trace backend. Version: 8.0.30-MatrixOne-v3.0.11 (MatrixOne v3.0.11).

Testing background

Found while evaluating MatrixOne as a high-volume trace / telemetry backend: such data is short-lived (days to weeks) and needs cheap automatic retention rather than expensive periodic DELETEs.

Why it matters (expected purpose)

Native TTL (time-based row/partition expiry) is essential for observability / log / trace workloads to bound storage cost automatically. Today retention must be done with manual deletes or external schedulers.

Activity

  1. self-assigned this
    on May 27, 2026
  2. added theissue type on May 29, 2026
  3. added
    severity/s2
    on Jun 30, 2026
  4. added this to the MO-202607 milestone on Jun 30, 2026
  5. added
    severity/s0
    and removed
    severity/s2
    on Jul 23, 2026
  6. LeftHandCold commented on Sep 1, 2026

    @LeftHandCold
    Collaborator

    Currently undergoing stable, long-term testing; awaiting the merge after the 4.3 branch is cut from the main branch.

  7. XuPeng-SH commented on Oct 22, 2026

    @XuPeng-SH
    Contributor

    QA follow-up for PR #30072 at exact head 13780b807a0a92fa1580edbeac04656132c95199 (base merge 75ae9a79d626622e6ccec0bcb28412f5fcf84c7f):

    The new review reports a P2 metadata replay defect: after ALTER TABLE adds, modifies, or removes TTL, DUMP TABLE ... METADATA ONLY produces a manifest whose create_sql reflects the original TTL while its schema hash reflects the current schema. Recreating from that manifest and loading the dump then fails with “target table schema does not match table dump.” The review reports reproducing all three mutations through the MySQL entry point; unchanged TTL passed, and replaying current SHOW CREATE output succeeded.

    This is a review-reported reproduction, not a test I ran in this workspace. The PR's author reports parser/planner/TTL suites and native TTL integration passing after the rebase; those reports do not cover this new dump/load counterexample. Current exact-head combined status is empty; the returned Iceberg E2E workflow is unrelated to TTL. Please update the dump replay DDL owner when TTL policy metadata changes and add public SQL dump/load regressions for add, modify, and remove.

    The issue remains open and its existing assignee is unchanged. Next verification: run the three dump/load cases against the merged head, including unchanged TTL control and populated-data restore.

  8. XuPeng-SH commented on Oct 23, 2026

    @XuPeng-SH
    Contributor

    QA follow-up — PR #30072 dump/replay finding

    PR head 8cb32856c905b9a0cbfcac0ad65f506c575c9cd7 adds a shared reconstruction path for manifest create_sql, using current table metadata like the schema-hash owner, and a public SQL integration test covering unchanged/add/modify/remove TTL across metadata-only and populated dumps (8 cases). This addresses the previously recorded ALTER-TTL replay mismatch at the code/test level; the regression test recreates only from the manifest's own create_sql, then LOADs the dump.

    The repository's new evidence bundle reports the six mutation cases failing on the unfixed production baseline and all eight passing after the correction. I inspected the new implementation, integration test, and evidence manifest, but did not execute Go/SQL locally: this workspace has no MatrixOne checkout and go is unavailable. Therefore this is not independent runtime validation, and I am not handing the broad #24552 feature to testing yet.

    Issue #24552 remains open with its existing assignee. The PR also states that its separate syntax/visibility/performance discussion is unchanged; those broader acceptance and deployment/performance checks remain outstanding. Recheck the exact new head with the relevant native suites and maintainer review before tester handoff.

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

Metadata

Metadata

Assignees

Labels

kind/featureseverity/s0

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions