[postgis-tickets] [PostGIS] #4684: concurrent topology construction routine may result in invalid topology

PostGIS trac at osgeo.org
Sun Jul 12 00:16:20 PDT 2020


#4684: concurrent topology construction routine may result in invalid topology
-----------------------+-------------------
  Reporter:  laopsahl  |      Owner:  strk
      Type:  defect    |     Status:  new
  Priority:  medium    |  Milestone:
 Component:  topology  |    Version:  3.0.x
Resolution:            |   Keywords:
-----------------------+-------------------

Comment (by laopsahl):

 First I create a empty database

 {{{
 psql postgres -c'create database t1'
 }}}

 Then add code and data needed for testing

 {{{
 psql t1 -f db_topo_bug_4684_init.sql
 }}}

 In the tests below we break input up lines that do not intersects any cell
 border and insert them into topology layer.
 There is only thread working at each cell at the same time


 In this I run 4 threads in parallel (With parallel I have tests showing
 that it run more than 10 times faster, than using a single thread)
 I have got it to fail on mac a (with 2 dual core cpu) and Dell server
 (with 16 dual core cpu).
 It may fail after 1 or after or 20 loops and it to be seems totally random
 where in the map the error happens
 I have seen max 3 topo errors and they can occur in in cells not spatially
 not connected.

 FAILING test : db_topo_bug_4684_test_fail.sql


 {{{
 time psql t1 -f db_topo_bug_4684_test_fail.sql 2>&1|tee
 db_topo_bug_4684_test_fail.log

 PL/pgSQL function inline_code_block line 9 at CALL
 LOCATION:  exec_stmt_raise, pl_exec.c:3827
   ?column?  |       error       | id1 |  id2
 ------------+-------------------+-----+--------
  validation | face has no rings |  49 | [NULL]
 (1 row)


 }}}


 Here I run single thread and I have never got it to fail.
 OK test : db_topo_bug_4684_test_ok.sql

 Test with job_type 2 with many parallel , should return something like
 this

 {{{
 time psql t1 -f db_topo_bug_4684_test_ok.sql 2>&1|tee
 db_topo_bug_4684_test_ok.log

 }}}

-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/4684#comment:14>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list