Skip to content

Fix transaction delete visibility during clone materialization - #32268

Merged
mergify[bot] merged 5 commits into
matrixorigin:mainfrom
iamlinjunhong:codex/loom/develop/9f756ba49a51c9b1cbb4611a3d57364e391ae8cc690e3246e3b940e8a511c9c1
Nov 5, 2026
Merged

mergify[bot] merged 5 commits into
matrixorigin:mainfrom
iamlinjunhong:codex/loom/develop/9f756ba49a51c9b1cbb4611a3d57364e391ae8cc690e3246e3b940e8a511c9c1

Conversation

@iamlinjunhong

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

What this PR does / why we need it:

COPY ALTER and clone can materialize transaction-local rows without applying transaction-local deletes first, leaving stale rows and secondary-index entries. Apply the existing workspace delete checks before materializing rows, while preserving shared objects and their tombstones. Immutable-only metadata cloning remains unchanged.

The historical origin of the missing index entries reported in #32245 is unknown. This change does not repair historical index corruption; the regression test separately demonstrates propagation of a synthetic missing entry and recovery when that index is rebuilt.

Validation:

  • Focused visibility and cleanup tests passed, including race mode; changed-package vet and lint passed. The earlier owning-package test passed with the same production code.
  • SQL regression passed twice (156/156); the clone directory passed 2657/2657 and the existing primary-index control passed 52/52. A local build passed.
  • In a two-CN cluster, DELETE and UPDATE followed by COPY ALTER produced correct table and secondary-index keys from a new connection on CN2. A mixed shared/rewritten object case also read correctly on both CNs. Real appendable-file materialization and tombstones were verified at component level; that exact combination was not directly read through a target relation.
  • These local checks ran on Darwin arm64. CI is pending.

The added workspace delete filtering is limited to rows already being rewritten; it uses bounded transaction-local state and adds no global cache or background work. No dedicated performance benchmark was run.

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@XuPeng-SH

XuPeng-SH commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

mo-bot review · mo-bot-local · done

Commit: 1801411237debd24d720c23a153dd9caf9bd24f3

Review completed. Read the assessment.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mo-bot review · mo-bot-local · review

Commit: 1801411237debd24d720c23a153dd9caf9bd24f3

Assessment: approve

The fix applies the existing workspace-delete policy before clone materialization assigns new row IDs, preserving shared objects and their tombstones. It adds no parallel filtering mechanism or new state; no actionable findings remain.

Model: gpt-6.1-sol / max

Session: 01a1a004-9884-72c0-ad39-f096c4209c4a · slot 1 · generation 0

Validation:

  • Reviewed all four changed files, both linked issues and their supplied comments, the complete discussion, and clone/data-source/cleanup consumers.

  • Reused exact-head successful build, Ubuntu unit tests and coverage, arm64 static analysis, and both multi-CN BVT checks. Author reports focused normal/race tests, two 156/156 regression runs, clone-group 2657/2657 and primary-index control 52/52.

  • Local preflight and source audit passed: pinned clean source, formatting, unchanged surrounding production logic, all 156 SQL/result commands aligned, and complete discussion coverage. Receipts and logs are retained.

Limitations:

  • No fresh Go or SQL execution was needed; author-reported Darwin arm64 checks lack retained raw logs here.

  • The exact appendable-file-plus-tombstone combination was validated at component level, without a direct target-relation read. Historical missing-index corruption in #32245 remains unexplained and is not repaired by this change.

@mergify mergify Bot added the queued label Nov 5, 2026
@mergify

mergify Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

✅ Merged into main as 4ffcfba at 20:56 UTC

1 h 6 min in the queue, 1 h 4 min of it CI.

So far

  • ✅ Entered the queue Thu 5 Nov, 19:50 · rule main · triggered by rule Automatic queue on approval for main
  • ✅ Passed · in place
  • ✅ Merged 20:56 · 4ffcfba · squash
3 merge conditions met
  • #review-threads-unresolved = 0 · required by GitHub branch protection
  • github-review-approved · required by GitHub branch protection
  • any of · required by GitHub branch protection:
    • check-success = CI Required
    • check-neutral = CI Required
    • check-skipped = CI Required

Times in UTC · dashboard · how the merge queue works

This branch was previously deployed

1 inactive deployment
ci — 787e0583 Deployed Nov 5, 2026 by mergify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working size/L Denotes a PR that changes [500,999] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants