Rock icon indicating copy to clipboard operation
Rock copied to clipboard

Rock Update block should detect current Azure DTU ceiling and warn user if it's too low.

Open cabal95 opened this issue 4 years ago • 0 comments

Prerequisites

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:

  1. Run query
  2. If query throws an exception, assume self-hosted and do not show any warnings.
  3. 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

cabal95 avatar Aug 05 '20 23:08 cabal95