Opened 7 years ago

Closed 7 years ago

#4000 closed defect (fixed)

unpackaged--2.5.0dev upgrade test fails due to postgis.backend being redefined

Reported by: strk Owned by: pramsey
Priority: medium Milestone: PostGIS 2.5.0
Component: postgis Version: master
Keywords: Cc:

Description

cd regress
./run_test.pl -v --sfcgal --upgrade --extension --upgrade-path unpackaged--
2.5.0dev regress_sfcgal.sql 

Upgrade path: unpackaged --> 2.5.0dev
PATH is /home/strk/perl5/bin:/home/strk/perl5/bin:/home/strk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/lib/go-1.8/bin:/home/strk/bin:/home/strk/go/bin:/home/strk/bin:/home/strk/go/bin
Checking for shp2pgsql ... found
Checking for pgsql2shp ... found
Checking for raster2pgsql ... found
TMPDIR is /tmp/pgis_reg
Creating database 'postgis_reg' 
Loading PostGIS into 'postgis_reg' 
  /usr/src/postgis/repository-sync-scripts/postgis/regress/00-regress-install/share/contrib/postgis/postgis.sql
  /usr/src/postgis/repository-sync-scripts/postgis/regress/00-regress-install/share/contrib/postgis/postgis_comments.sql
  /usr/src/postgis/repository-sync-scripts/postgis/regress/00-regress-install/share/contrib/postgis/postgis_proc_set_search_path.sql
Loading Raster into 'postgis_reg'
  /usr/src/postgis/repository-sync-scripts/postgis/regress/00-regress-install/share/contrib/postgis/rtpostgis.sql
  /usr/src/postgis/repository-sync-scripts/postgis/regress/00-regress-install/share/contrib/postgis/raster_comments.sql
  /usr/src/postgis/repository-sync-scripts/postgis/regress/00-regress-install/share/contrib/postgis/rtpostgis_proc_set_search_path.sql
Loading SFCGAL into 'postgis_reg'
  /usr/src/postgis/repository-sync-scripts/postgis/regress/00-regress-install/share/contrib/postgis/sfcgal.sql
  /usr/src/postgis/repository-sync-scripts/postgis/regress/00-regress-install/share/contrib/postgis/sfcgal_comments.sql
Upgrading PostGIS in 'postgis_reg' using: CREATE EXTENSION postgis VERSION '2.5.0dev' FROM unpackaged
Upgrading PostGIS SFCGAL in 'postgis_reg' using: CREATE EXTENSION postgis_sfcgal VERSION '2.5.0dev' FROM unpackaged
PostgreSQL 9.6.6 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 6.3.0-12ubuntu2) 6.3.0 20170406, 64-bit
  Postgis 2.5.0dev - r16335 - 2018-01-18 21:56:50
  scripts 2.5.0dev r16335
  raster scripts 2.5.0dev r16335
  GEOS: 3.7.0dev-CAPI-1.11.0 c60c5e3d
  PROJ: Rel. 4.9.3, 15 August 2016
  SFCGAL: 1.3.0
  GDAL: GDAL 2.3.0dev, released 2017/99/99

Running tests

 regress_sfcgal .. failed (diff expected obtained: /tmp/pgis_reg/test_1_diff)
-----------------------------------------------------------------------------
--- regress_sfcgal_expected     2018-01-18 11:03:16.489351339 +0100
+++ /tmp/pgis_reg/test_1_out    2018-01-20 08:15:48.911376245 +0100
@@ -1,4 +1,5 @@
 postgis_sfcgal_version|1
+WARNING:  'postgis.backend' is already set and cannot be changed until you reconnect
 ST_Tesselate|GEOMETRYCOLLECTION(POINT(4 4),TIN(((0 1,1 0,1 1,0 1)),((0 1,0 0,1 0,0 1))))
 ST_3DArea|1
 ST_Extrude_point|LINESTRING Z (0 0 0,1 0 0)
-----------------------------------------------------------------------------
 uninstall .. ok (4581)

Run tests: 2
Failed: 1

The bug is also exposed by Debbie: https://debbie.postgis.net/job/PostGIS_Regress/8456/console

Change History (6)

comment:1 by strk, 7 years ago

I guess the problem is NOT cought by sfcgal/regress.sql snippet to find mixed probin because it's just the module path changing (from $libdir to 00-regress etc):

SELECT distinct 'unexpected probin', proname || ':' || probin
FROM pg_proc
WHERE probin like '%postgis%'
  AND probin NOT LIKE '%' ||
    substring(postgis_lib_version() from '([0-9]*\.[0-9]*)')
    || '%'
ORDER BY 2;

That test should be improved to make it clearer what the failure is

comment:2 by strk, 7 years ago

I've added a —nodrop to the run_test.pl call to further inspect and I confirm the upgrade is failing to upgrade some objects:

postgis_reg=# select count(*), probin from pg_proc where probin like '%postgis%' group by probin;
107|$libdir/rtpostgis-2.5
16|/usr/src/postgis/repository-sync-scripts/postgis/regress/00-regress-install/lib/postgis-2.5
460|$libdir/postgis-2.5

The above means that 16 postgis objects are not upgraded from unpackaged. The checking code is failing to catch this because it only checks for version compatibility, which is ok in this case (both are 2.5) - we need a version that also checks for library path to match…

comment:3 by strk, 7 years ago

The 16 functions we fail to upgrade:

st_3dintersection
postgis_sfcgal_version
st_3ddifference
st_3dunion
st_tesselate
st_3darea
st_extrude
st_forcelhr
st_orientation
st_minkowskisum
st_straightskeleton
st_approximatemedialaxis
st_isplanar
st_volume
st_makesolid
st_issolid

comment:4 by strk, 7 years ago

In 16344:

Improve check for probin consistency

See #4000

comment:5 by strk, 7 years ago

The problem is that unpackaged upgrade does NOT include minor upgrade at all here. I've added that in #3913 for "postgis" and "postgis_topology", this ticket confirms it's missing for "postgis_sfgal"

comment:6 by strk, 7 years ago

Resolution: fixed
Status: newclosed

In 16345:

Include minor upgrade in sfcgal unpackaged upgrade

Closes #3913 again (for sfcgal) and hopefully fixes #4000

Note: See TracTickets for help on using tickets.