Forum Discussion
Azure SQL Mirrored DB says "metadata tables are corrupted" when stopping then restarting replication
- 1 year ago
I heard back from MS support. TL;DR: you need to grant VIEW PERFORMANCE DEFINITION to the managed identity fabric is using to connect to the db:
GRANT SELECT, ALTER ANY EXTERNAL MIRROR, VIEW PERFORMANCE DEFINITION TO [User];The official docs only mention the need for `SELECT, ALTER ANY EXTERNAL MIRROR`.
This does not fix a database that already has corrupted metadata, but it makes it so that the reproduction steps I mention in the first post do not generate a metadata corruption in the first place.
I believe MS is planning to push a fix for this before the end of the month, but I don't know whether that will be just an update to the documentation or a code fix that makes the "ANY EXTERNAL MIRROR" permission sufficient.
I have also raised a support ticket. Since what I was working on was just PoC I did not require a "then and there" fix. They have confirmed that the only way to fix is by "fiddling" behind the scenes and that end-users are in no position to solve the problem for themselves. I was assured that it has been escalated with the Product Team with no commitment to an estimated fix date. The lack of "traceability" leaves me feeling uncomfortable that the issue has not made it's way onto the official "known issues" list. All that the support desk could provide is verbal assurance.
As it stand I will not take Fabric Mirror anywhere near a production workload without a root cause fix!
I brought it up with the PG members (pointing them to this thread) and at least they seem to be acknowledging the issue now. Didn't sound like an easy fix though.