#1403 Fix duplicate tickets

v1.0.0
closed
sf-4 (350)
General
nobody
2015-08-20
2011-01-26
No

[#1375] is a duplicate ticket. We need to fix that duplication, and any others. Then make sure the unique index is set in production.

Related

Tickets: #1375

Discussion

  • Dave Brondsema

    Dave Brondsema - 2011-01-26

    description has changed

     
  • Mark Ramm - 2011-01-27
    • size: --> 2
     
  • Dave Brondsema

    Dave Brondsema - 2011-02-07
    • status: open --> in-progress
    • assigned_to: Dave Brondsema
     
  • Dave Brondsema

    Dave Brondsema - 2011-02-07
     
  • Dave Brondsema

    Dave Brondsema - 2011-02-07

    Need to convert app_config_id_1_ticket_num_1 index from regular to unique. Would be good if Ming's update_indexes handled changing the unique flag.

     
  • Dave Brondsema

    Dave Brondsema - 2011-02-08

    I used this query in each of project-data-* to find other duplicates. Found one more.

    db.ticket.group({key:{app_config_id:true,ticket_num:true}, reduce:function(obj,prev){ prev.count++;}, initial: {count: 0}}).forEach(function(r){ if (r.count != 1) { print(r.app_config_id, r.ticket_num, r.count); } })
    

    To fix the duplicates, run:

    use project-data-a;
    g = db.globals.findAndModify({query:{app_config_id:ObjectId("4c3493551be1ce11d8000032")}, update: {$inc: {last_ticket_num:1}}, new: true, fields: {last_ticket_num:true}});
    db.ticket.update({app_config_id:ObjectId("4c3493551be1ce11d8000032"), ticket_num:1375, _id:ObjectId("4d38a4b2b9363c66830000a2")}, {$set: {ticket_num: g.last_ticket_num}});
    
    use project-data-s;
    g = db.globals.findAndModify({query:{app_config_id:ObjectId("4c4723b71be1ce77ee00116a")}, update: {$inc: {last_ticket_num:1}}, new: true, fields: {last_ticket_num:true}});
    db.ticket.update({app_config_id:ObjectId("4c4723b71be1ce77ee00116a"), ticket_num:6, _id:ObjectId("4d41a59db9363c2a20000367")}, {$set: {ticket_num: g.last_ticket_num}});
    

    Then with a new version of ming, run the ensure index command

     
  • Dave Brondsema

    Dave Brondsema - 2011-02-08

    And also run the attached script to update solr.

     
  • Dave Brondsema

    Dave Brondsema - 2011-02-08

    QA: review Ming update, mongo commands in the comment above, and the attached python script. I've tested each with a unit test or manually, so a code review is probably sufficient.

     
  • Dave Brondsema

    Dave Brondsema - 2011-02-08
    • status: in-progress --> code-review
    • assigned_to: Dave Brondsema --> Rick Copéland
     
  • Rick Copeland - 2011-02-09
    • assigned_to: Rick Copéland --> Dave Brondsema
     
  • Rick Copeland - 2011-02-09

    gtg

     
  • Dave Brondsema

    Dave Brondsema - 2011-02-09

    Created https://control.sog.geek.net/sog/trac/ticket/18050 encapsulating all the commands

     
  • Dave Brondsema

    Dave Brondsema - 2011-02-09
    • status: code-review --> blocked
     
  • Dave Brondsema

    Dave Brondsema - 2011-02-09

    Still need to add new version of ming to requirements-common.txt

    After trying the new update_indexes on the Allura models, I saw it drop indexes and not recreate them on children of polymorphic inheritance (ForumAttachment) But they were auto-created later, not sure what's going on entirely.

     
  • Dave Brondsema

    Dave Brondsema - 2011-02-09
    • status: blocked --> in-progress
     
  • Dave Brondsema

    Dave Brondsema - 2011-02-14
    • status: in-progress --> blocked
     
  • Dave Brondsema

    Dave Brondsema - 2011-02-16

    18050 is done, but the tickets have reduplicated

     
  • Dave Brondsema

    Dave Brondsema - 2011-02-16
    • status: blocked --> in-progress
     
  • Dave Brondsema

    Dave Brondsema - 2011-02-17
    • status: in-progress --> closed
     

Log in to post a comment.