[GRASS-dev] [GRASS GIS] #2258: t.create creates DB always in the PERMANENT

GRASS GIS trac at osgeo.org
Thu Apr 24 19:55:57 PDT 2014


#2258: t.create creates DB always in the PERMANENT
-------------------------+--------------------------------------------------
 Reporter:  martinl      |       Owner:  grass-dev@…              
     Type:  defect       |      Status:  new                      
 Priority:  normal       |   Milestone:  7.0.0                    
Component:  Temporal     |     Version:  unspecified              
 Keywords:  t.register   |    Platform:  Unspecified              
      Cpu:  Unspecified  |  
-------------------------+--------------------------------------------------

Comment(by glynn):

 Replying to [comment:5 huhabla]:

 > > Does it handle race conditions, i.e. where two users both try to
 create the database at the same time?
 >
 > No. How does GRASS handle the race condition in case two user try to
 create a mapset with the same name at the same time?

 One of the mkdir() calls will fail, and G_make_mapset() will return -1 to
 its caller.

 This is correct behaviour for creating a new mapset, which is supposed to
 "belong" to the user creating it. Creating a mapset should be a distinct
 operation from using an existing mapset. If a mapset with that name
 already exists, creation should fail; a "create" operation shouldn't just
 use an existing mapset (typically, incorrect ownership will prevent this).

 This wouldn't be correct behaviour for creating a shared database, where
 the desired semantics are "use it if it exists, otherwise create it". In
 the event of a race condition, the process should either create the
 database (if it won the race) or use the existing database (if it lost the
 race). In neither case should it fail.

-- 
Ticket URL: <http://trac.osgeo.org/grass/ticket/2258#comment:6>
GRASS GIS <http://grass.osgeo.org>



More information about the grass-dev mailing list