fix: skip repair RemoveBrokenProperties if already run#61409
Conversation
Signed-off-by: kyteinsky <kyteinsky@gmail.com>
|
I'm wondering if this one-time migration should have just been a background job. Downside of moving it there is that it runs outside the maintenance window. Not sure if that is problematic. |
TBH, I think that might be a better solution, If anyone ever needs to rerun this, it would be easier to remember just to trigger the migration again, which creates a new job. |
maybe the initial query that reads the complete for the re-run possibility, it can be run again with |
Signed-off-by: kyteinsky <kyteinsky@gmail.com>
Yes. But and there is nothing wrong with that but without looking at the code, there is no way for a user or one of our engineers, to know that this repair works differently. It a hidden gotcha. This would be confusing an frustrating to find a hidden off switch. With @ChristophWurst recommendation, there is no hidden gotcha, and we still get the same logic of a one time run. |
|
My understanding was that it wouldn't be needed in normal circumstances since the source of the issue has been fixed. Also, I'm not sure of the structure of the background job, if it's a queued job (not a timed job), it would just run once and then be removed from the job list. It would then be not possible to run it? I'm sorry to be a little conservative on the change since then we would have to test and make sure it make the instance act funny. With the current change, it would be just two occ commands to re-run it (one to change the config and the other to run the repairs), everything else remains the same. |
Summary
The repair step removes null characters from the properties table. The PR which added this also made sure no further entries are inserted with null characters so it should be safe to run once and then skip it for the later upgrades.
The need for this arises from the fact that
valuetypecolumn is compared which does not have an index and should not have it since it's not used anywhere else, but it results in a long scan of the DB whenever the repair step runs.The step is marked expensive but expensive repair steps still run in maintenance mode and cause a long downtime.
It was added in #49528
TODO
Checklist
3. to review, feature component)stable32)AI (if applicable)