From 9193214274889f2b7636146e72d8200e9bfaeb7b Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Tue, 4 Mar 2014 15:50:54 +0800 Subject: Bug 966180: backport bug 956233 to bmo (enable USE_MEMCACHE on most objects) --- contrib/merge-users.pl | 5 ++ contrib/reorg-tools/bmo-plan.txt | 82 ---------------------- contrib/reorg-tools/convert_date_time_date.pl | 4 ++ contrib/reorg-tools/fix_all_open_status_queries.pl | 4 ++ contrib/reorg-tools/fixgroupqueries.pl | 4 ++ contrib/reorg-tools/fixqueries.pl | 4 ++ contrib/reorg-tools/migrate_crash_signatures.pl | 8 ++- contrib/reorg-tools/migrate_orange_bugs.pl | 4 ++ contrib/reorg-tools/move_flag_types.pl | 4 ++ contrib/reorg-tools/movebugs.pl | 4 ++ contrib/reorg-tools/movecomponent.pl | 11 ++- contrib/reorg-tools/reset_default_user.pl | 2 + 12 files changed, 52 insertions(+), 84 deletions(-) delete mode 100755 contrib/reorg-tools/bmo-plan.txt (limited to 'contrib') diff --git a/contrib/merge-users.pl b/contrib/merge-users.pl index 99fe3fef0..de2fe9ec5 100755 --- a/contrib/merge-users.pl +++ b/contrib/merge-users.pl @@ -244,4 +244,9 @@ Bugzilla::Hook::process('merge_users_after', { old_id => $old_id, new_id => $new # Commit the transaction $dbh->bz_commit_transaction(); +# It's complex to determine which items now need to be flushed from memcached. +# As user merge is expected to be a rare event, we just flush the entire cache +# when users are merged. +Bugzilla->memcached->clear_all(); + print "Done.\n"; diff --git a/contrib/reorg-tools/bmo-plan.txt b/contrib/reorg-tools/bmo-plan.txt deleted file mode 100755 index 838ff0ab9..000000000 --- a/contrib/reorg-tools/bmo-plan.txt +++ /dev/null @@ -1,82 +0,0 @@ -==BMO Reorg Plan== - -Do the following things, mostly in order (but see "Timing" at the end): - -1) Create new classifications using GUI: - Graveyard (Description: "Old, retired products", sort key: ) - -2) Rename classifications using GUI: - Client Support to Other - -3) Move products between classification using GUI: - Grendel from Client Software to Graveyard - CCK from Unclassified to Graveyard - Derivatives from Unclassified to Graveyard - MozillaClassic from Unclassified to Graveyard - UI: "reclassify" link from the top-level classification list - -4) Create new products using GUI: - Core Graveyard in Graveyard - (desc: "Old, retired Core components", closed for entry, no charts) - MailNews Core in Components - (desc: "Mail and news components common to Thunderbird and SeaMonkey", - open for bug entry, create charts) - -5) Rename products using GUI, and fix queries using fixqueries.pl: -mysql> update series_categories set name="SeaMonkey (2)" where id=32; - Mozilla Application Suite to SeaMonkey - Sumo to support.mozilla.com - -5.5) Rename versions and milestones in Toolkit to match Firefox before step 6 - -6) Sync milestones, versions and groups between products using -syncmsandversions.pl: - Core -> Core Graveyard (new) - Core -> MailNews Core (new) - Firefox -> Toolkit - Core -> SeaMonkey - mozilla.org -> Websites (only 1) - -6.5) Sync flag inclusions using syncflags.pl: - Core -> Core Graveyard (new) - Core -> MailNews Core (new) - Core -> SeaMonkey - mozilla.org -> Websites (only 1) - -6.7) Allow Firefox flags temporarily in Toolkit: - 250 | blocking-firefox3 | blocking1.9 - 387 - 419 | blocking-firefox3.1 | blocking1.9.1 - 416 - 63 | blocking0.8 | blocking1.6 - 69 - 76 | blocking0.9 | blocking1.7 - 83 - 36 | review | review - 4 - 356 | wanted-firefox3 | wanted1.9 - 357 - 418 | wanted-firefox3.1 | wanted1.9.1 - 417 - -7) Move components using movecomponent.pl. - Any instruction beginning "moved from". - Can't fix the queries for this - oh well - - -8) Rename components using GUI, and fix queries using fixqueries.pl. - Any instruction beginning "renamed from" or "MailNews: prefix removed". - - -9) Create new components using GUI. - Any instruction beginning "new". - - -10) Move open bugs using GUI: - XP Miscellany to Core/General - -11) Merge components by moving bugs using GUI: - Any instruction beginning "merge in". - Merge all bugs, including closed. Delete empty component when done. - - -12) Close Core Graveyard (and Grendel if necessary) to new bugs - -13) Rename Toolkit versions and milestones back (from 5.5) - -14) Execute flag mapping SQL using Reed's mapping to update bugs in Toolkit - -15) Disable above-listed flags in point 6.7 in Toolkit again diff --git a/contrib/reorg-tools/convert_date_time_date.pl b/contrib/reorg-tools/convert_date_time_date.pl index aa3b58ca1..a2e9bfffc 100755 --- a/contrib/reorg-tools/convert_date_time_date.pl +++ b/contrib/reorg-tools/convert_date_time_date.pl @@ -55,4 +55,8 @@ Bugzilla->dbh->bz_alter_column('bugs', $column, { TYPE => 'DATE' }); Bugzilla->dbh->do("UPDATE fielddefs SET type = ? WHERE name = ?", undef, FIELD_TYPE_DATE, $column); +# It's complex to determine which items now need to be flushed from memcached. +# As this is expected to be a rare event, we just flush the entire cache. +Bugzilla->memcached->clear_all(); + print "\ndone.\n"; diff --git a/contrib/reorg-tools/fix_all_open_status_queries.pl b/contrib/reorg-tools/fix_all_open_status_queries.pl index b51ac21c2..7c8d8be68 100755 --- a/contrib/reorg-tools/fix_all_open_status_queries.pl +++ b/contrib/reorg-tools/fix_all_open_status_queries.pl @@ -137,4 +137,8 @@ print "Adding new status '$new_status'.\n\n"; do_namedqueries($new_status); do_series($new_status); +# It's complex to determine which items now need to be flushed from memcached. +# As this is expected to be a rare event, we just flush the entire cache. +Bugzilla->memcached->clear_all(); + exit(0); diff --git a/contrib/reorg-tools/fixgroupqueries.pl b/contrib/reorg-tools/fixgroupqueries.pl index 1c75edb97..0bd64cd40 100755 --- a/contrib/reorg-tools/fixgroupqueries.pl +++ b/contrib/reorg-tools/fixgroupqueries.pl @@ -116,4 +116,8 @@ print "Changing all instances of '$old' to '$new'.\n\n"; #do_namedqueries($old, $new); do_series($old, $new); +# It's complex to determine which items now need to be flushed from memcached. +# As this is expected to be a rare event, we just flush the entire cache. +Bugzilla->memcached->clear_all(); + exit(0); diff --git a/contrib/reorg-tools/fixqueries.pl b/contrib/reorg-tools/fixqueries.pl index 4b862fd72..221213058 100755 --- a/contrib/reorg-tools/fixqueries.pl +++ b/contrib/reorg-tools/fixqueries.pl @@ -128,5 +128,9 @@ do_namedqueries($field, $old, $new); do_series($field, $old, $new); do_series_categories($old, $new); +# It's complex to determine which items now need to be flushed from memcached. +# As this is expected to be a rare event, we just flush the entire cache. +Bugzilla->memcached->clear_all(); + exit(0); diff --git a/contrib/reorg-tools/migrate_crash_signatures.pl b/contrib/reorg-tools/migrate_crash_signatures.pl index b12446280..4323c1d01 100755 --- a/contrib/reorg-tools/migrate_crash_signatures.pl +++ b/contrib/reorg-tools/migrate_crash_signatures.pl @@ -123,4 +123,10 @@ foreach my $bug (@$bugs) { print "done.\n"; } -$dbh->bz_commit_transaction() if $UPDATE_DB; +if ($UPDATE_DB) { + $dbh->bz_commit_transaction(); + + # It's complex to determine which items now need to be flushed from memcached. + # As this is expected to be a rare event, we just flush the entire cache. + Bugzilla->memcached->clear_all(); +} diff --git a/contrib/reorg-tools/migrate_orange_bugs.pl b/contrib/reorg-tools/migrate_orange_bugs.pl index ae68b227c..4902464a3 100755 --- a/contrib/reorg-tools/migrate_orange_bugs.pl +++ b/contrib/reorg-tools/migrate_orange_bugs.pl @@ -145,6 +145,10 @@ foreach my $bug (@$bugs) { $dbh->bz_commit_transaction() if $doit; if ($doit) { + # It's complex to determine which items now need to be flushed from memcached. + # As this is expected to be a rare event, we just flush the entire cache. + Bugzilla->memcached->clear_all(); + print colored(['green'], "DATABASE WAS UPDATED\n"); } else { diff --git a/contrib/reorg-tools/move_flag_types.pl b/contrib/reorg-tools/move_flag_types.pl index a75b7f497..7b7fe2081 100755 --- a/contrib/reorg-tools/move_flag_types.pl +++ b/contrib/reorg-tools/move_flag_types.pl @@ -162,6 +162,10 @@ if (@$flags) { $flag_update_sth->execute($params{'newid'}, $flag_id); } } + + # It's complex to determine which items now need to be flushed from memcached. + # As this is expected to be a rare event, we just flush the entire cache. + Bugzilla->memcached->clear_all(); } else { print "No flags to move\n"; diff --git a/contrib/reorg-tools/movebugs.pl b/contrib/reorg-tools/movebugs.pl index adc02a1e0..b9acc2443 100755 --- a/contrib/reorg-tools/movebugs.pl +++ b/contrib/reorg-tools/movebugs.pl @@ -173,3 +173,7 @@ Bugzilla::Hook::process('reorg_move_bugs', { bug_ids => $ra_ids } ); $dbh->bz_commit_transaction(); +foreach my $bug_id (@$ra_ids) { + Bugzilla->memcached->clear({ table => 'bugs', id => $bug_id }); +} + diff --git a/contrib/reorg-tools/movecomponent.pl b/contrib/reorg-tools/movecomponent.pl index 702dbc6f0..162942627 100755 --- a/contrib/reorg-tools/movecomponent.pl +++ b/contrib/reorg-tools/movecomponent.pl @@ -193,4 +193,13 @@ $dbh->do("INSERT INTO bugs_activity(bug_id, who, bug_when, fieldid, removed, ($userid, $fieldid, $oldproduct, $newproduct, $compid)); Bugzilla::Hook::process('reorg_move_bugs', { bug_ids => $ra_ids } ) if $doit; -$dbh->bz_commit_transaction() if $doit; + +if ($doit) { + $dbh->bz_commit_transaction(); + + # It's complex to determine which items now need to be flushed from memcached. + # As this is expected to be a rare event, we just flush the entire cache. + Bugzilla->memcached->clear_all(); +} + + diff --git a/contrib/reorg-tools/reset_default_user.pl b/contrib/reorg-tools/reset_default_user.pl index 42a7998de..173d03849 100755 --- a/contrib/reorg-tools/reset_default_user.pl +++ b/contrib/reorg-tools/reset_default_user.pl @@ -136,6 +136,8 @@ foreach my $bug (@$bugs) { $dbh->do("UPDATE bugs SET delta_ts = ?, lastdiffed = ? WHERE bug_id = ?", undef, $timestamp, $timestamp, $bug_id); + Bugzilla->memcached->clear({ table => 'bugs', id => $bug_id }); + print "done.\n"; } } -- cgit v1.2.3-24-g4f1b