Uploaded image for project: 'OpenMRS Core'
  1. OpenMRS Core
  2. TRUNK-549

Issue with long running liquibase updates

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Must
    • Resolution: Fixed
    • None
    • OpenMRS 1.5.0
    • None
    • None

    Description

      So I was updating a database with lots of observations and ran into an issue that caused me to interrupt the update process and shutdown my laptop.

      When I restarted my laptop (and the update process) the DatabaseUpdater threw an exception that prevented interrupted update from being processed. Basically, the update process was in the middle of a changeset when I shutdown. Re-executing that changeset caused the first few few statements to be retried, and as such, they failed.

      We need to be able to rollback unfinished transactions/changesets or figure out a way to rerun changesets that were partially completed. Or at the very least, for now, display the changeset ID in the web interface when an error occurs and tell them to contact an OpenMRS developer to help fix the problem. I also think we should be more effusive with the logging for liquibase updates. We should also show exactly which SQL command is being run since the following isn't helpful when there are 20 tables which are getting the "uuid" column.

      INFO: Adding "uuid" column to all tables.  (This may take a while on large databases)
      

      This is a minor annoyance for developers. My workaround was to comment out the part of the changeset that had already been executed (everything up until the "ALTER TABLE obs ADD COLUMN uuid;" had been executed successfully), redeploy the application, and rerun the liquibase updates.

      However, while it might not be a big deal to developers, I think this might be a much more painful issue for implementers who are stuck waiting for a long running update to finish (without any visual indication of progress - see TRAC-1512) and unwittingly restart tomcat thinking that might help things along, only to find that they've hosed their system and the ability to update the database.

      <changeSet id="20090402-1515" author="bwolfe">
        <comment>Adding "uuid" column to all tables.  (This may take a while on large databases)</comment>		
        <!-- "UUID" is translated by liquibase into the appropriate column type -->
        <addColumn tableName="cohort">
          <column name="uuid" type="UUID" />
        </addColumn>
        <!-- more of the same ... -->
      </changeSet>
      

      Gliffy Diagrams

        Attachments

          Issue Links

            Activity

              People

                bwolfe Ben Wolfe
                jmiranda Justin Miranda [X] (Inactive)
                Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: