[OPEN-ILS-DEV] Upgrade to 2.2-alpha1

Dan Scott dan at coffeecode.net
Thu Nov 24 13:14:01 EST 2011


Hi Martha:

Thanks for the testing report

On Tue, Nov 22, 2011 at 03:50:36PM -0500, Martha Driscoll wrote:
> I am attempting to upgrade a 2.1.0 system (debian-squeeze) to
> 2.2-alpha1.  This system went through a few release candidates
> before going to 2.1.0.  I am running into problems with the upgrade
> script 2.1-2.2-alpha1.sql.
> 
> First problem:
> 2.1-2.2-alpha1.sql:3: ERROR:  column "applied_to" of relation
> "upgrade_log" does not exist
> LINE 1: INSERT INTO config.upgrade_log (version, applied_to) VALUES ...
> 
> I removed the applied_to column since it does not exist in the database:

Right, that gets added later. I'll push a fix for that.

> 
> --INSERT INTO config.upgrade_log (version, applied_to) VALUES
> ('2.2-alpha1');
> INSERT INTO config.upgrade_log (version) VALUES ('2.2-alpha1');
> 
> I also had to comment out these drop functions that are part of 0526
> since I don't have the column and functions mentioned:
> -- DROP objects that might have existed from a prior run of 0526
> --ALTER TABLE config.upgrade_log DROP COLUMN applied_to;
> --DROP FUNCTION evergreen.upgrade_list_applied_deprecates(TEXT);
> --DROP FUNCTION evergreen.upgrade_list_applied_supersedes(TEXT);
> 
> I'm not sure if previous upgrades already removed those, but
> commenting out the lines enabled the script to continue.

Yes, we should move these outside of the main transaction, I think. On
the bright side, they occur early so people won't waste a lot of time on
running the upgrade script only to have it die after a few hours; on the
other hand, it would be better for it to just work out of the box.

I suppose we could create a function temporarily that checks to see if
that column and those functions exist and drops them if they do; that
way everything could be kept inside the transaction and no worrisome
"ERROR" messages would be displayed during the upgrade.
 
> My next problem is with the part of the script that is applying 0640.
> 
> I'm getting this error:
> 
> psql:Open-ILS/src/sql/Pg/2.1-2.2-alpha1.sql:5622: ERROR:  cannot
> ALTER TABLE "control_set_authority_field" because it has pending
> trigger events
> 
> I'm not sure what to do here. Any suggestions?

Huh. I didn't run into that error during my recent tests of the upgrade
script in our dev environment (running on PostgreSQL 9.0.4 on Debian
Squeeze).  What version of PostgreSQL & distro are you running on, just
for the sake of comparison?

As far as moving forward, I would suggest customizing your version of
the upgrade script to add a COMMIT; BEGIN; clause just before the ALTER
TABLE statement. That way, if the ALTER TABLE or some subsequent
statement fails, you won't lose all of the changes that have been
applied successfully to that point. Then you can focus on just the last
transaction (split it out to a separate file or whatever) and tweak
until you make your way through everything successfully.

> I also ran into the problem with SimpleServer 1.15 not finding
> yaz/facet.h but fixed that as per Dan's fix to Makefile.install.
> Hurray for chat logs!

Yay! 

Thanks again for your findings; they really help us shake things out.


More information about the Open-ils-dev mailing list