Skip to content

Fix stale in-memory catalog state after an Iceberg ALTER#1112

Open
NiclasHaderer wants to merge 1 commit into
duckdb:v1.5-variegatafrom
NiclasHaderer:nh/alter-schema-fix
Open

Fix stale in-memory catalog state after an Iceberg ALTER#1112
NiclasHaderer wants to merge 1 commit into
duckdb:v1.5-variegatafrom
NiclasHaderer:nh/alter-schema-fix

Conversation

@NiclasHaderer

@NiclasHaderer NiclasHaderer commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

After an Iceberg ALTER (e.g. ADD COLUMN) or table rename is committed, the catalog left the old IcebergTableInformation in schema.tables. A scan in the same connection then read the pre-ALTER schema.

This refreshes the published table info on commit and swaps it into the schema under the entry lock, for both ALTER and rename, so subsequent reads see the committed schema.

@Tmonster

Copy link
Copy Markdown
Member

I guess this is to update the information schema immediately after an alter? Otherwise any read afterwards will do the same correct?

@NiclasHaderer

NiclasHaderer commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

Sorry, yeah that is what this is fixing. Im currently contemplating if I should instead trigger a refetch from the rest server to get the newest metadata. What do you think?

Edit: I think we should be able to reuse the response of the commit even...

@NiclasHaderer
NiclasHaderer marked this pull request as ready for review July 1, 2026 05:24
@Tishj

Tishj commented Jul 3, 2026

Copy link
Copy Markdown
Member

I'm not sure I like this fix
There is no guarantee that the table hasn't received updates before our rename, and we're potentially pasting outdated state over newer state.

I'd be much more inclined to just reset the state, so that it can be populated the next time it's scanned

@Tmonster

Tmonster commented Jul 6, 2026

Copy link
Copy Markdown
Member

I'm also wondering what the performance improvement is here. Unless MAX_TABLE_STALENESS is set, then only 1 extra round trip is made. Potentially you could use the response from the server, but variations in IRC spec implementations make me think this might become a headache later.

Is there a specific use case where we really need to prevent the extra round trip?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants