Skip to content

Fix: establish transaction and session before snapshot promotion/demotion #4899

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

treysp
Copy link
Contributor

@treysp treysp commented Jul 3, 2025

No description provided.

Copy link
Collaborator

@erindru erindru left a comment

Choose a reason for hiding this comment

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

I was going to comment saying that this needed a test, but I think that updating the failing tests (which are failing because the new calls are unexpected) to now expect the calls should cover this

@treysp treysp force-pushed the trey/promote-demote-session branch from 86b972c to baeb229 Compare July 3, 2025 23:43
@treysp treysp force-pushed the trey/promote-demote-session branch from baeb229 to 3e7facd Compare July 3, 2025 23:43
with (
adapter.transaction(),
adapter.session(
snapshot.model.render_session_properties(
Copy link
Collaborator

Choose a reason for hiding this comment

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

It looks like these are slightly different to the render_kwargs that _promote_snapshot() passes to model.render_session_properties.

For example, we pass snapshots here in _demote_snapshot() but not in _promote_snapshot(). And _promote_snapshot() gets a table_mapping property which is absent here.

Do you think these should be consistent so macros defined in session_properties can rely on the same things being present at both RuntimeStage.PROMOTING and RuntimeStage.DEMOTING?

Copy link
Contributor

Choose a reason for hiding this comment

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

in promote the table_mapping is mainly to be used for the on_virtual_update statements which are not relevant in demotion, but I do agree maybe they should be consistent across both, since we don't know what dynamic macros there might be in session_properties potentially

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