• 
      

    Support the new RawFileDiffData migration in condensediffs.

    Review Request #6227 — Created Aug. 13, 2014 and submitted

    Information

    Review Board
    master
    0b8f843...

    Reviewers

    condensediffs has been updated to handle the migration of
    LegacyFileDiffData entries to RawFileDiffData. A lot of work went into
    optimizing this. These are converted in batches, with minimal SQL
    queries on a modern database (read: not sqlite3).

    A run of condensediffs on a copy of a real-world database containing
    650,000 diffs (all stored in LegacyFileDiffData entries) took 15 minutes
    to convert, with a space savings of 80% (3.6GB down to 714MB).

    Ran this many, many times without problems.

    This was tested on sqlite, MySQL, and PostgreSQL.

    Description From Last Updated

    We should probably mark these strings for translation. Here and below.

    daviddavid

    Since there's only one entry here, how about the single-line format? % {'count': total_count}

    daviddavid

    You need to pass since into N_ here as a third argument (so it knows which one to choose)

    daviddavid

    What if these tables already exist (say, a previous run of this failed in some unexpected way)?

    daviddavid
    reviewbot
    1. Tool: PEP8 Style Checker
      Processed Files:
          reviewboard/diffviewer/management/commands/condensediffs.py
          reviewboard/diffviewer/managers.py
      
      
      
      Tool: Pyflakes
      Processed Files:
          reviewboard/diffviewer/management/commands/condensediffs.py
          reviewboard/diffviewer/managers.py
      
      
    2. 
        
    david
    1. 
        
    2. Show all issues

      We should probably mark these strings for translation. Here and below.

    3. Show all issues

      Since there's only one entry here, how about the single-line format?

      % {'count': total_count}
      
    4. reviewboard/diffviewer/managers.py (Diff revision 1)
       
       
       
      Show all issues

      What if these tables already exist (say, a previous run of this failed in some unexpected way)?

      1. Then that sucks and we'll deal.

        I thought about that but looked at what Django's doing. They do a bunch of these tests, and don't even attempt to handle the case of the tables already existing. I figure if it happens, we can help with that and address it then, but if Django hasn't hit issues with this so far, we're not likely to.

      2. OK.

      3. Okay, everything does support DROP TABLE IF EXISTS, so nevermind, I'll add it.

    5. 
        
    chipx86
    reviewbot
    1. Tool: PEP8 Style Checker
      Processed Files:
          reviewboard/diffviewer/management/commands/condensediffs.py
          reviewboard/diffviewer/managers.py
      
      
      
      Tool: Pyflakes
      Processed Files:
          reviewboard/diffviewer/management/commands/condensediffs.py
          reviewboard/diffviewer/managers.py
      
      
    2. 
        
    david
    1. 
        
    2. Show all issues

      You need to pass since into N_ here as a third argument (so it knows which one to choose)

      1. ungettext works that way, but ungettext_lazy works using this format. That's also how the other strings for hours, minutes, etc. work in this function.

    3. 
        
    david
    1. Ship It!

    2. 
        
    chipx86
    Review request changed
    Status:
    Completed
    Change Summary:
    Pushed to master (6909af3)