You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are attempting to handle transient errors when applying a migration to a SQL Azure database.
The problem is that the Max Retry Count is not being applied per command, but for the entire migration process. Our max retry count is set to 5 and I'll see in our logs where four separate commands are retried, but the 5th exception kills the process. Most of the time the migration is successful, but maybe every 6th time results in failure.
What is the recommended retry execution strategy for migrations?
Steps to reproduce
I can't think of any valuable repro steps to provide that will help further clarify the issue.
Here are the logs (trimmed for brevity and edited for privacy) Migration Logs.txt
Further technical details
The migration is kicked off as a job in Kubernetes.
EF Core version: 3.1.1
Database provider: SQL Azure database within a Standard Tier Elastic Pool
Target framework: .NET Core 3.1
Operating system: Windows 10 Enterprise
IDE: Visual Studio 2019 16.4.5
The text was updated successfully, but these errors were encountered:
So you're telling me to just add more retry attempts? How is that an acceptable solution to retry tens-of-thousands of commands? (Probably more)
We currently have 52 migrations and more are added all the time.
Maybe you misunderstood the problem.
Let's say I have my retry count set to 5 and I have a migration that has 10 CREATE TABLE commands. The first command fails 3 times, but succeeds on the 4th retry. Awesome! Unfortunately, now all but 1 retry attempt is left. Let's hope there aren't any more transient errors.
If the retry counter was reset between commands, that would be great too, but there isn't a way to control that when applying a migration.
I need a way to wrap each command in the migration in its own Retry Execution Strategy. Is there built in way to get all the commands that run when applying a migration?
We are attempting to handle transient errors when applying a migration to a SQL Azure database.
The problem is that the Max Retry Count is not being applied per command, but for the entire migration process. Our max retry count is set to 5 and I'll see in our logs where four separate commands are retried, but the 5th exception kills the process. Most of the time the migration is successful, but maybe every 6th time results in failure.
Here is what the execution strategy looks like:
What is the recommended retry execution strategy for migrations?
Steps to reproduce
I can't think of any valuable repro steps to provide that will help further clarify the issue.
Here are the logs (trimmed for brevity and edited for privacy)
Migration Logs.txt
Further technical details
The migration is kicked off as a job in Kubernetes.
EF Core version: 3.1.1
Database provider: SQL Azure database within a Standard Tier Elastic Pool
Target framework: .NET Core 3.1
Operating system: Windows 10 Enterprise
IDE: Visual Studio 2019 16.4.5
The text was updated successfully, but these errors were encountered: