Rock
Rock copied to clipboard
Rock Update block should detect current Azure DTU ceiling and warn user if it's too low.
Prerequisites
- [x] Put an X between the brackets on this line if you have done all of the following:
- Can you reproduce the problem on a fresh install or the demo site ?
- Did you include your Rock version number and client culture setting?
- Did you %3Aissue+user%3ASparkDevNetwork+-repo%3ASparkDevNetwork%2FSlack perform a cursory search to see if your bug or enhancement is already reported?
Description
If Rock is running on Azure, there is a stored procedure that will let us determine what the current DTU limits the database is configured for. For the v11 upgrade, even though the upgrade notes mention bumping up the DTU, we still had a lot of people report errors after upgrade that were because they didn't notice/read and didn't bump up the DTU.
I think it would be useful if the Rock Update block checked what the current DTU was and if it's below a certain value present a warning to the user (not an error, let them go ahead if they want). This could either be an alert div on the page or a bootstrap modal dialog asking them to confirm the upgrade even though their DTU might be to low.
SELECT
MAX(ISNULL([dtu_limit], 10000))
FROM [sys].[dm_db_resource_stats]
The above query will run on Azure SQL or throw an error if running on-premise SQL. The IS_NULL check handles cases where they are configured for vCore pricing instead of DTU pricing. So if they use vCore we "pretend" they have 10,000 DTU.
The dm_db_resource_stats
pseudo table returns usage statistics over a period of time, one row for every 15 seconds of calculates stats. Using the MAX
function allows us to catch cases where they upgrade the DTU just moments before loading the Upgrade page.
So the logic might be something like:
- Run query
- If query throws an exception, assume self-hosted and do not show any warnings.
- If query returns a value <
THRESHOLD
then display a warning to the user.
Threshold should probably be 50 or maybe even 100.
Expected behavior:
Rock should, since it's possible, do a better job of warning the user if an upgrade is likely to fail. This wouldn't be a guarantee that it will upgrade fine, but it should catch the common cases where somebody is running on an S0 (10 DTU) system because it's just a tiny Rock install and Rock runs fine at that size, but then blows up during the upgrade.
Actual behavior:
A poor wittle 5 DTU server tries to upgrade to v11 and fails and the admin freaks out.
Versions
- Rock Version: v11
- Client Culture Setting: en-US