Geo: Ensure performance of Snippet Repository replication queries are sufficient for release
The following discussion from !46904 (merged) should be addressed:
-
@mkozono started a discussion: thought: Before releasing snippet replication, we need to be sure the duration of major queries isn't excessive. Since this is behind a feature flag, I'll open a follow up issue to get query timings from
#database-lab
to be sure that new queries produced inRegistryConsistencyWorker
andin_replicables_for_current_secondary?
definitely won't timeout (at a minimum).
Note that RegistryConsistencyWorker
is a low-priority background thing, so IMO queries can be acceptable on the slower side given that we do our best to make them perform well. in_replicables_for_current_secondary?
happens in e.g. update events, so these have less leeway.
-
Get the SQL of notable queries (since there are generally too many permutations to seriously evaluate all of them individually). - Note that the full queries are produced by
#find_registry_differences
and#in_replicables_for_current_secondary?
. Not.replicables_for_current_secondary
, because it is never run alone. This is important because the two methods above restrict the query by primary key, by range or exact ID.
- Note that the full queries are produced by
-
Modify the queries to align with actual data in #database-lab
, i.e.gitlab-org
namespace ID# 9970. Ornfs-file22
shard name. -
Run them in #database-lab
-
Get full database review and approval for release
Edited by Alex Ives