Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #11663, #11664, #11877: SQL DOMAIN; import logs (rebased); FS delete log trigger #2191

Merged
merged 17 commits into from
Apr 1, 2014

Conversation

mtbc
Copy link
Member

@mtbc mtbc commented Mar 21, 2014

Fixes:

Check that everything still seems to work: can import, view, delete images; can view import logs.

Breaking so needs label from @sbesson? Also @qidane should glance at some of the changes.

@mtbc mtbc changed the title fix #11663, #11877: SQL DOMAIN; import logs (rebased); FS delete log trigger fix #11663, #11664, #11877: SQL DOMAIN; import logs (rebased); FS delete log trigger Mar 21, 2014
@sbesson
Copy link
Member

sbesson commented Mar 21, 2014

Breaking label added.

if (!getNullable()) {
sb.append(" not null");
}
if (getUnique()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where are these UNIQUE and NOT NULL handled?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I too had wondered how they still take effect. I believe it is through getUnique() and getNullable() being accessed at http://github.com/openmicroscopy/openmicroscopy/blob/develop/components/dsl/resources/ome/dsl/object.vm#L1006.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had removed them partly because, with them included, schema.sql gets a number of not null not null (sic) definitions.

@mtbc
Copy link
Member Author

mtbc commented Mar 21, 2014

There is pleasing greenness at http://ci.openmicroscopy.org/view/Breaking/.

@will-moore
Copy link
Member

Import, viewing and deleting images works fine. Noticed that import logs when viewed in Insight all terminate with "Step 4" as the last line, but this is also true in the 'latest' build on trout, so it's nothing to do with this PR.
All working fine.

@mtbc
Copy link
Member Author

mtbc commented Mar 24, 2014

@joshmoore
Copy link
Member

Asked offline by @sbesson, I don't have any objections to this. I'm slightly worried about the drop of the UNIQUE and NOT NULL, but those should become apparent if the feature is every used. I also wonder if there is any issue with older PG versions. But as long as we have a ticket to test 5.1 with the oldest version of PG that we support (which we can discuss), then 👍 to have this in the merge build.

@mtbc
Copy link
Member Author

mtbc commented Mar 25, 2014

In the conditional it was applying only for floats anyway; there is also, say, column share.data which is bytea not null. Once this is in I could open another, non-breaking, PR if you like that adds them in to columnDefinition for all types where applicable: I guess even if not needed they do no harm.

@mtbc
Copy link
Member Author

mtbc commented Mar 25, 2014

In general we should have some testing (maybe a CI node) with minimum versions of prerequisites installed, not just PostgreSQL.

@qidane
Copy link
Contributor

qidane commented Mar 25, 2014

Looks good!

@sbesson sbesson removed the breaking label Mar 25, 2014
@sbesson
Copy link
Member

sbesson commented Mar 25, 2014

breaking label removed

@sbesson
Copy link
Member

sbesson commented Mar 25, 2014

[hudson@ome-c6100-3 ~]$ pg_dump -U omero -Fc -f ~/OMERO-5.1-merge-deploy-25032014.db.dump OMERO-5.1-merge-deploy
[hudson@ome-c6100-3 ~]$ file ~/OMERO-5.1-merge-deploy-25032014.db.dump
/home/hudson/OMERO-5.1-merge-deploy-25032014.db.dump: PostgreSQL custom database dump - v1.12-0
[hudson@ome-c6100-3 ~]$  psql -U omero OMERO-5.1-merge-deploy --set ON_ERROR_STOP=1 < /opt/hudson/workspace/OMERO-5.1-breaking-upgrade/VERSION/LAST_DEV/label/ome-c6100-3/OMERO.server/sql/psql/OMERO5.1DEV__2/OMERO5.1DEV__1.sql 
BEGIN
CREATE FUNCTION
 omero_assert_db_version 
-------------------------

(1 row)

DROP FUNCTION
INSERT 0 1
CREATE FUNCTION
ERROR:  update or delete on table "annotation" violates foreign key constraint "fkimageannotationlink_child_annotation" on table "imageannotationlink"
DETAIL:  Key (id)=(11305) is still referenced from table "imageannotationlink".
CONTEXT:  SQL statement "DELETE FROM annotation WHERE id = import.annotation_id"
PL/pgSQL function upgrade_import_logs() line 39 at SQL statement
[hudson@ome-c6100-3 ~]$ 

Need some investigation. Relabelled as breaking

@mtbc
Copy link
Member Author

mtbc commented Mar 25, 2014

Somebody had actually attached import logs to an image! The upgrade script is now fixed to anticipate such strangeness.

@mtbc
Copy link
Member Author

mtbc commented Mar 25, 2014

--rebased-to #2203 upgrade script change in latest commit

@sbesson
Copy link
Member

sbesson commented Mar 25, 2014

[hudson@ome-c6100-3 ~]$ psql -U omero OMERO-5.1-merge-deploy --set ON_ERROR_STOP=1 < /opt/hudson/workspace/OMERO-5.1-breaking-upgrade/VERSION/LAST_DEV/label/ome-c6100-3/OMERO.server/sql/psql/OMERO5.1DEV__2/OMERO5.1DEV__1.sql 
BEGIN
CREATE FUNCTION
omero_assert_db_version 
-------------------------

(1 row)

DROP FUNCTION
INSERT 0 1
CREATE FUNCTION
upgrade_import_logs 
---------------------

(1 row)

DROP FUNCTION
CREATE FUNCTION
CREATE DOMAIN
CREATE DOMAIN
CREATE DOMAIN
CREATE DOMAIN
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ERROR:  value for domain positive_float violates check constraint "positive_float_check"

As discussed in devteam, this is related to some kymograph images with a zero p.physicalsizey value. Another edge-case to handle as part of this script (nullify the illegal values as suggested by @mtbc?)

Additionally, we should fix our kymograph script to prevent zero-valued physical sizes to be set /cc @will-moore

@mtbc
Copy link
Member Author

mtbc commented Mar 25, 2014

Nulling done in latest commit and http://trac.openmicroscopy.org.uk/ome/ticket/12128 filed about kymograph script.

@sbesson sbesson removed the breaking label Mar 27, 2014
@sbesson
Copy link
Member

sbesson commented Mar 27, 2014

[hudson@ome-c6100-3 ~]$  pg_dump -U omero -Fc -f ~/OMERO-5.1-merge-deploy-27032014.db.dump OMERO-5.1-merge-deploy
[hudson@ome-c6100-3 ~]$ file ~/OMERO-5.1-merge-deploy-25032014.db.dump
/home/hudson/OMERO-5.1-merge-deploy-25032014.db.dump: PostgreSQL custom database dump - v1.12-0
[hudson@ome-c6100-3 ~]$ psql -U omero OMERO-5.1-merge-deploy --set ON_ERROR_STOP=1 < /opt/hudson/workspace/OMERO-5.1-breaking-upgrade/VERSION/LAST_DEV/label/ome-c6100-3/OMERO.server/sql/psql/OMERO5.1DEV__2/OMERO5.1DEV__1.sql 
BEGIN
CREATE FUNCTION
 omero_assert_db_version 
-------------------------

(1 row)

DROP FUNCTION
INSERT 0 1
CREATE FUNCTION
 upgrade_import_logs 
---------------------

(1 row)

DROP FUNCTION
CREATE FUNCTION
CREATE DOMAIN
CREATE DOMAIN
CREATE DOMAIN
CREATE DOMAIN
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
UPDATE 0
UPDATE 3
UPDATE 0
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
UPDATE 1
                                 status                                 
------------------------------------------------------------------------
                                                                       +
                                                                       +
                                                                       +
 YOU HAVE SUCCESSFULLY UPGRADED YOUR DATABASE TO VERSION OMERO5.1DEV__2+
                                                                       +
                                                                       +

(1 row)

COMMIT
[hudson@ome-c6100-3 ~]$

exclude label removed and http://ci.openmicroscopy.org/job/OMERO-5.1-merge-daily/86/ restarted

@ximenesuk
Copy link
Contributor

I've checked the DB upgrade; importing, viewing, deleting and image; viewing the import log; the relevant integration test and the relevant tables in the DB. Everything looks good and assuming everyone is otherwise happy with this PR having been in the breaking job up until now then I'd say this is good to merge.

@sbesson
Copy link
Member

sbesson commented Mar 27, 2014

Waiting for @joshmoore and/or @jburel to sign-off on this PR. OMERO-5.1-latest-deploy will need to be ugpraded.

@joshmoore
Copy link
Member

👍 for this. Leaving @sbesson to run the upgrade script.

joshmoore added a commit that referenced this pull request Apr 1, 2014
fix #11663, #11664, #11877: SQL DOMAIN; import logs (rebased); FS delete log trigger
@joshmoore joshmoore merged commit 09cd2fb into ome:develop Apr 1, 2014
@sbesson
Copy link
Member

sbesson commented Apr 1, 2014

[hudson@ome-c6100-3 ~]$ pg_dump -U omero -Fc -f ~/OMERO-5.1-latest-deploy-01042014.db.dump OMERO-5.1-latest-deploy
[hudson@ome-c6100-3 ~]$ file ~/OMERO-5.1-latest-deploy-01042014.db.dump
/home/hudson/OMERO-5.1-latest-deploy-01042014.db.dump: PostgreSQL custom database dump - v1.12-0
[hudson@ome-c6100-3 ~]$  psql -U omero OMERO-5.1-latest-deploy --set ON_ERROR_STOP=1 < /opt/hudson/workspace/OMERO-5.1-breaking-upgrade/VERSION/LAST_DEV/label/ome-c6100-3/OMERO.server/sql/psql/OMERO5.1DEV__2/OMERO5.1DEV__1.sql 
BEGIN
CREATE FUNCTION
 omero_assert_db_version 
-------------------------

(1 row)

DROP FUNCTION
INSERT 0 1
CREATE FUNCTION
 upgrade_import_logs 
---------------------

(1 row)

DROP FUNCTION
CREATE FUNCTION
CREATE DOMAIN
CREATE DOMAIN
CREATE DOMAIN
CREATE DOMAIN
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
UPDATE 0
UPDATE 0
UPDATE 0
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
UPDATE 1
                                 status                                 
------------------------------------------------------------------------
                                                                       +
                                                                       +
                                                                       +
 YOU HAVE SUCCESSFULLY UPGRADED YOUR DATABASE TO VERSION OMERO5.1DEV__2+
                                                                       +
                                                                       +

(1 row)

COMMIT
[hudson@ome-c6100-3 ~]$ 

@mtbc mtbc deleted the model-changes branch April 1, 2014 19:24
@mtbc
Copy link
Member Author

mtbc commented Apr 1, 2014

At least it ran smoothly that time! Thank you all.

@mtbc
Copy link
Member Author

mtbc commented Apr 4, 2014

--rebased-from #2055
(moved from description so scc can see all)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants