Repository navigation
Conversation
…tivity row for older flags and store the cutoff
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Prepares the database for #2796: makes
flag_activity.whoNOT NULL, gives every flag aflag_activityrow, and stores the time it ran as the cutoff betweenbugs_activityandflag_activity. No code reads them yet, #2796 does, once this is deployed.Changes
flag_activity.whobecomes NOT NULL. #2808 (bug 2088705) added it nullable and writes it on every change. On MySQL its foreign key is dropped for the change and added back at the end of checksetup.flag_activityrow (flags last changed beforeflag_activitylogged every type) a row with its current state, dated at its last change, in batches of 10,000 flags. It then stores the time it ran in the new one-row tableflag_activity_migration, which also keeps it from running again.set_flag_activity_cutoffinBugzilla::Test::Util, and new testt/flag-activity-start-rows.t.t/flag-activity-who.tnow checks the NOT NULL change, andt/bmo/bugmail-flag-events.tsetswhoin its rows.Deploy
The current code already writes
whoand logs every flag change to both tables, so it runs unchanged on the new schema. The backfill can take a while on production. #2796 has to be deployed in a later release.Test plan
flag_activityrow: each gets one,flag_activity_migrationholds one row, and a second run adds nothingwhosetReferences