feat(iceberg): port Iceberg connector to 4.2-dev#25947
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
gouhongshen
left a comment
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
I found two independent merge blockers on the current head.
-
pkg/frontend/iceberg_call.go:395:isIcebergBuiltinProcedureclaims every unqualified procedure whose name starts withiceberg_. That interception happens before normal stored-procedure resolution, so an existing user procedure such asiceberg_backupis routed into Iceberg parsing and rejected as unsupported—even with the feature disabled. Match the exact built-in procedure set, not the prefix. -
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.
What type of PR is this?
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