#45267 [Opn->Csd]: Revisit locking in DBA for DB4
| From: | sixd@php.net | Date: | Thu, 19 Jun 2008 22:47:39 +0000 |
| Subject: | #45267 [Opn->Csd]: Revisit locking in DBA for DB4 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-125906@lists.php.net to get a copy of this message | ||
ID: 45267
Updated by: sixd@php.net
Reported By: sixd@php.net
-Status: Open
+Status: Closed
Bug Type: DBM/DBA related
Operating System: Linux
PHP Version: 5.3CVS-2008-06-14 (CVS)
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
DBA with BDB 4 nows uses DBA's file locking so datafile corruption
should no longer be possible.
A side effect of re-introducing DBA-enforced locking is that "reading
during write" (see tests/dba_db4.phpt) is not allowed. This is
consistent with all other DBA drivers.
Previous Comments:
------------------------------------------------------------------------
[2008-06-14 00:58:05] sixd@php.net
Description:
------------
The locking for DBA with DB4 needs to be revisited.
The way DB_INIT_LOCK and DB_FCNTL_LOCKING are passed to DB4, and
the use of DBA_LOCK_EXT in dba.c seem to be based on the assumption
that BDB will do locking. This isn't true with the way BDB is used by
DBA.
See http://bugs.php.net/bug.php?id=45266 for why
DB_INIT_LOCK isn't
valid. DB_FCNTL_LOCKING is undocumented. It implies that PHP does
locking. It just tells BDB when to release file handles.
Perhaps the easiest solution is for dba.c to use DBA_LOCK_ALL, but
I'm not fully aware of the implications of this flag.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=45267&edit=1