Why:
fixLinkRecommendationData currently refuses to run
in production when --db-table is passed as an argument.
This is because the search index is delayed, and it
takes hours (if not days) to recognize update commands
coming from GrowthExperiments.
Unfortunately, when recovering from broken search index
scenario (T362367), the only solution for dangling DB
records is to drop them all, and deal with possible
incorrect removals later (by re-running the script
with --search-index).
What:
Add --force, which bypasses the "unsafe for production"
check. I documented it as "use with care", as during normal
operation, there is no reason to ever need to force it,
and understanding why the check is there is critical
to avoid breakages.
Patch also updates docstrings, as batching is in fact
implemented, and replication lag is checked in
commitTransaction(). The script indeed does not
handle search index update lag, so it has some risky
aspects, but assuming one is aware of the risks
(mainly increasing dangling search records, which
are more visible and problematic), it is executable
in production.
Bug: T364341
Change-Id: Ic8c563ce8fc36e67eeeb8a892e8f327f62a7b146