[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [bug] vtable=0x00000000 for the new FSFS when doing simultaneous commits

From: C.A.T.Magic <c.a.t.magic_at_gmx.at>
Date: 2004-05-09 07:28:24 CEST

Greg Hudson wrote:

>>Transmitting file data .svn: Commit failed (details follow):
>>svn: Transaction out of date.
>
> I also fixed this bug, in r9657.

its still there (or maybe another one with the same effect)

but this may be of interrest to you:

console #1:
   svn: Commit failed (details follow):
   svn: Can't open file 'X:/SVNSandbox/TestFSFS/RepoFS/db/ \
              transactions/KBQQdn.txn/rev': The file exists.

console #2:
   Sending Version.h
   svn: Commit failed (details follow):
   svn: Can't read file 'X:/SVNSandbox/TestFSFS/RepoFS/db/ \
              transactions/KBQQdn.txn/0.0': End of file found

obviously, the two processes access the SAME txn folder
and offcourse this results in strange collisions.
(this effect can be reproduced).

i think the bug is here:

   if (apr_file_mktemp (&txn_file, txn_filename, 0, pool) != APR_SUCCESS)
     return svn_error_create (SVN_ERR_FS_CORRUPT, NULL,
                              "Unable to create new transaction.");

   /* Create the transaction directory based on this temporary file. */
   txn_dirname = apr_pstrcat (pool, txn_filename, SVN_FS_FS__TXNS_EXT,
NULL);

   SVN_ERR (svn_io_make_dir_recursively (txn_dirname, pool));

   SVN_ERR (svn_io_file_close (txn_file, pool));

you create a unique filename through apr, but then DELETE
that unique file. and then you try to create a new folder
with the 'deleted' file's name. but since you delete the
unique file first, the name is no longer unique and the
second process is taking the same name.....

i think you have several options:
- use a simple increasing number for the txn folders
   with that number stored similar to db/uuid or db/current
   (+1)
- directly use an uuid
   (+0)
- create the unique file, but then keep it alive as long as
   you also have to keep the 'unique'.txn folder.
   (-0)
- check if svn_io_make_dir_recursively fails and if it does,
   simply try another unique name. (-1, this could loop forever).

=====
:-)
c.a.t.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun May 9 07:28:57 2004

This is an archived mail posted to the Subversion Dev mailing list.