HUE-7692 [editor] Upgrade failure from from CDH <= 5.4

Review Request #12101 - Created Nov. 29, 2017 and submitted

Jean-Francois Desjeans Gauthier
hue
master
HUE-7692
hue
jgauthier
commit 749fb6fe5a59444f246939f3e6cb589d1db69ae2
Author: jdesjean <jgauthier@cloudera.com>
Date:   Tue Nov 28 17:14:48 2017 -0800

    HUE-7692 - [editor] Upgrade failure from from CDH <= 5.4

:100644 100644 7b98e8503a... 0fa47815c3... M	desktop/core/src/desktop/migrations/0016_auto__add_unique_document2_uuid_version_is_history.py

Pushed to HUE-7692

  • 0
  • 0
  • 5
  • 0
  • 5
Description From Last Updated
  1. 
      
  2. 'manual merging' --> 'manual merging or deletion'

    ' and the rerun of the migrations'

    ?

  3. Then wondering if we should link to how to use the Hue Shell: http://gethue.com/hue-api-execute-some-builtin-commands/ and

    from desktop.models import Document2

    Document2.objects.filter(id__in=[]).delete()

  4. 
      
  1. 
      
  2. Good work!

    1. If the customer runs the following from hue shell it will still fail if they have activated a newer CDH and hence they would be trying to do this in the first place. They have to run it with the hue shell of the older CDH install for the delete to succeed.

    from desktop.models import Document2
    Document2.objects.filter(id__in=[50428L, 50700L]).delete()

    1. Probably being nitpicky by asking for newlines and more whitespace formatting in this output to make it easier to read.

    RuntimeError: Found duplicated Document2 records! [50428L, 50700L]. This will require manual merging or deletion of the Document2 records with duplicate ids and rerunning the migration.For more information on manipulating Hue built in objects, have a look at our blog: http://gethue.com/hue-api-execute-some-builtin-commands/For example, to delete Document2 records with duplicate ids execute the following:from desktop.models import Document2Document2.objects.filter(id__in=[]).delete()

  3. 
      
  1. 
      
  2. Nice, one issue though it that it will delete all the docs, while we should instead keep the latest and delete the oldest? (so need another list of oldest_duplicated_ids?)

  3. 
      
  1. *** My only comment is that the obj.filter().delete() will fail since they will be executing the new Hue scripts when reading the blog *** 
    *** The only things they can do is either point to the old Hue scripts and run the delete() or remove the id(s) in the database directly ***
    
    
    This will require manual merging or deletion of the Document2 records with duplicate ids and rerunning the migration.
    For more information on manipulating Hue built in objects, have a look at our blog: http://gethue.com/hue-api-execute-some-builtin-commands/
    For example, to delete Document2 records with the oldest duplicated ids execute the following:
    
    from desktop.models import Document2
    Document2.objects.filter(id__in=[50700L]).delete()
  2. 
      
  1. Ship It!
  2. 
      
Review request changed

Status: Closed (submitted)

Loading...