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

[release/8.0] Revert Azure SQL streaming breaking change #32069

Merged
merged 1 commit into from
Oct 17, 2023

Conversation

AndriySvyryd
Copy link
Member

Fixes #32052

Description

When the connection string points to an Azure SQL database we now by default configure a retrying execution strategy, per official recommendation. This in turn forces all the streaming queries to buffer (because we can't reliably retry a query if it fails in the middle of reading the results). This makes it a breaking change for apps that weren't using a retrying execution strategy as it increases the peak memory usage proportionally to the largest result set queried.

Customer impact

OutOfMemoryException thrown in some cases.

How found

Customer reported on RC2

Regression

Yes, from RC1.

Testing

Added tests.

Risk

Low.

@AndriySvyryd AndriySvyryd requested a review from a team October 17, 2023 05:20
Copy link
Contributor

@ErikEJ ErikEJ left a comment

Choose a reason for hiding this comment

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

If you decide to implement this, there are more domains than .database.windows.net

@ErikEJ
Copy link
Contributor

ErikEJ commented Oct 17, 2023

Does this mean that having a retrying strategy enabled always will require more memory?

@roji
Copy link
Member

roji commented Oct 17, 2023

Does this mean that having a retrying strategy enabled always will require more memory?

@ErikEJ enabling a retrying strategy makes EF buffer the entire query resultset; this is required since if we stream, a failure could occur in the middle, and at that point retrying the query could yield different results (and user code has already started consuming the 1st resultset). There's a note about this in the performance docs.

Whether this requires (significantly) more memory really depends on the resultset size... With small resultsets, buffering should have (practically) zero overhead; but if you're loading a huge amount of data, this can obviously get very significant. Buffering basically means that memory overhead starts being proportional to the resultset size (whereas with streaming it is not).

@AndriySvyryd AndriySvyryd merged commit 39da9a7 into release/8.0 Oct 17, 2023
7 checks passed
@AndriySvyryd AndriySvyryd deleted the Issue32052 branch October 17, 2023 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Increased query memory usage on EFCore 8 RC2
4 participants