Skip to content

feat(iceberg): port Iceberg connector to 4.2-dev#25947

Open
iamlinjunhong wants to merge 1 commit into
matrixorigin:4.2-devfrom
iamlinjunhong:d-iceberg
Open

feat(iceberg): port Iceberg connector to 4.2-dev#25947
iamlinjunhong wants to merge 1 commit into
matrixorigin:4.2-devfrom
iamlinjunhong:d-iceberg

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:

issue #23359

What this PR does / why we need it:

feat(iceberg): port Iceberg connector to 4.2-dev

@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 →

@gouhongshen gouhongshen 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.

Codex automated review

Found two blocking regressions: broad CALL interception breaks existing stored procedures, and access registration can leave a partially committed authorization state.

P1 - Match only supported Iceberg built-in procedure names (pkg/frontend/iceberg_call.go:400)

This prefix check claims every unqualified procedure beginning with iceberg_ before doInterpretCall performs the normal stored-procedure lookup. Thus an existing procedure such as iceberg_backup worked on the base branch but is now routed to OperationForProcedure and rejected as unsupported, even when Iceberg is disabled. Use an exact allowlist for the four built-ins so unrelated stored procedures retain prior behavior.

P1 - Commit principal and residency registration atomically (pkg/frontend/iceberg_call.go:265)

The principal upsert executes before this residency-policy upsert without an explicit transaction. Background sessions use autocommit, so if this second statement fails, the call returns an error but the principal mapping remains committed. This has a deterministic trigger: policy validation accepts a region longer than the DDL's varchar(128), causing only the second insert to fail. Under an existing cluster allow policy, runtime treats the missing account policy as optional, so the partial state can authorize the newly mapped external principal. Wrap both writes in one BEGIN/commit-or-rollback transaction and test rollback when the second write fails.

@aunjgr aunjgr 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.

I found two independent merge blockers on the current head.

  1. pkg/frontend/iceberg_call.go:395: isIcebergBuiltinProcedure claims every unqualified procedure whose name starts with iceberg_. That interception happens before normal stored-procedure resolution, so an existing user procedure such as iceberg_backup is routed into Iceberg parsing and rejected as unsupported—even with the feature disabled. Match the exact built-in procedure set, not the prefix.

  2. pkg/frontend/iceberg_call.go:250-280: access registration performs the principal-map upsert and residency-policy upsert as two autocommit statements. If the second statement fails (for example, a value passes policy validation but exceeds a storage column limit), the call returns an error with the principal mapping already committed. Authorization can then observe a partially registered identity. Execute both mutations in one explicit transaction with rollback on either error and add a second-write-failure regression.

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

Labels

size/XXL Denotes a PR that changes 2000+ lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants