Skip to content
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

Execution strategy for migration #17578

Closed
Tracked by #19587
ariellourenco opened this issue Aug 11, 2019 · 5 comments · Fixed by #34206 or #34338
Closed
Tracked by #19587

Execution strategy for migration #17578

ariellourenco opened this issue Aug 11, 2019 · 5 comments · Fixed by #34206 or #34338
Labels
area-aspire area-migrations closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. customer-reported type-enhancement
Milestone

Comments

@ariellourenco
Copy link

Dear all,

I am wondering if the SQL execution strategy specified when configuring the options for the context also covers the Migrate command when it takes place as part of the chain of events of the IWebHost as in the code sample in this discussion

@ajcvickers ajcvickers transferred this issue from dotnet/EntityFramework.Docs Sep 2, 2019
@AndriySvyryd
Copy link
Member

No, there are commands that cannot be executed in a transaction and therefore cannot be safely retried.

@bricelam
Copy link
Contributor

bricelam commented Sep 6, 2019

But we could retry the ones that are in a transaction and do something fancy with Down operations or idempotent DDL statements (IF NOT EXISTS) to recover from failures outside of a transaction.

@escalonn
Copy link

I'm just looking for a built-in way to retry the connection itself, not any of the operations within it.

@AndriySvyryd
Copy link
Member

When retrying without a transaction we can start from the last command that succeeded.

@AndriySvyryd AndriySvyryd self-assigned this Jun 20, 2024
@AndriySvyryd AndriySvyryd modified the milestones: Backlog, 9.0.0 Jun 20, 2024
@AndriySvyryd AndriySvyryd added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Jul 10, 2024
@AndriySvyryd AndriySvyryd removed their assignment Jul 10, 2024
AndriySvyryd added a commit that referenced this issue Jul 11, 2024
Use a single transaction for all migrations in the script

Fixes #17578
Fixes #22616
AndriySvyryd added a commit that referenced this issue Jul 12, 2024
Use a single transaction for all migrations in the script

Fixes #17578
Fixes #22616
AndriySvyryd added a commit that referenced this issue Jul 16, 2024
Use a single transaction for all migrations in the script

Fixes #17578
Fixes #22616
AndriySvyryd added a commit that referenced this issue Jul 26, 2024
Use a single transaction for all migrations in the script

Fixes #17578
Fixes #22616
@roji
Copy link
Member

roji commented Jul 26, 2024

Reopening to track reviewing my comments on #34206 (accidentally approved with auto-merge on).

@AndriySvyryd AndriySvyryd removed their assignment Aug 2, 2024
AndriySvyryd added a commit that referenced this issue Aug 2, 2024
Log migration lock acquisition

Fixes #34196
Fixes #17578
AndriySvyryd added a commit that referenced this issue Aug 10, 2024
Log migration lock acquisition

Fixes #34196
Fixes #17578
AndriySvyryd added a commit that referenced this issue Aug 12, 2024
Log migration lock acquisition

Fixes #34196
Fixes #17578
AndriySvyryd added a commit that referenced this issue Aug 13, 2024
Log migration lock acquisition

Fixes #34196
Fixes #17578
@ajcvickers ajcvickers modified the milestones: 9.0.0, 9.0.0-rc1 Aug 21, 2024
@roji roji modified the milestones: 9.0.0-rc1, 9.0.0 Oct 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-aspire area-migrations closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. customer-reported type-enhancement
Projects
None yet
7 participants