Full_Name: Pierangelo Masarati Version: HEAD/re23 OS: irrelevant URL: ftp://ftp.openldap.org/incoming/ Submission from: (NULL) (81.72.89.40) Submitted by: ando I believe there are (at least) two issues with back-sql: 1) cached db handle AVL access in backsql_get_db_conn() is not protected by mutex, as insertion/deletion. 2) cached db handles are shared by operations performed by the same client connection, so concurrent operations use the same db handle. I believe each write operation should use a separate handle in order to be atomic. Issue (1) will be fixed shortly; issue (2) will be fixed as soon as I finish rewriting db handle code. In this sense I think it's meaningless to share handles for write operations based on the client connection. All in all, the same user is always used to access the DB, and access control is done by the backend, while there's no guarantee the client will serialize requests. So a separate pool of handles could be maintained and used for write operations only; handles wouldn't need to be created all times, they can be reused. Only, they need to be used exclusively by one operation, so that SQLTransact() is only called for the specified sequence of operations. The pool could be fixed size, deferring operations when busy, or grow on request. p.
changed notes moved from Incoming to Software Bugs
ando@sys-net.it wrote: > In this sense I think it's meaningless to share > handles for write operations based on the client connection. All in all, the > same user is always used to access the DB, and access control is done by the > backend, while there's no guarantee the client will serialize requests. So a > separate pool of handles could be maintained and used for write operations only; > handles wouldn't need to be created all times, they can be reused. Only, they > need to be used exclusively by one operation, so that SQLTransact() is only > called for the specified sequence of operations. The pool could be fixed size, > deferring operations when busy, or grow on request. Actually, there's no need to cache handles based on the connection or so. It's better to have connections cached per-thread, to make sure they can only be used one at a time. p. Ing. Pierangelo Masarati OpenLDAP Core Team SysNet s.r.l. via Dossi, 8 - 27100 Pavia - ITALIA http://www.sys-net.it --------------------------------------- Office: +39 02 23998309 Mobile: +39 333 4963172 Email: pierangelo.masarati@sys-net.it ---------------------------------------
changed notes
changed notes changed state Open to Release
changed notes changed state Release to Closed
moved from Software Bugs to Archive.Software Bugs
back-sql fixed in re23 reworked in HEAD
*** Issue 5199 has been marked as a duplicate of this issue. ***