|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
Subject: RE: Databases... (DB & CDB in particular)
From: Jerrad Pierce (Jerrad.Pierce
networkengines.com)Date: Wed Dec 06 2000 - 11:39:13 CST
- Next message: Wietse Venema: "Re: mailbox quota"
- Previous message: Michael Tokarev: "Re: virtual+aliases trouble"
- Maybe in reply to: Michael Tokarev: "Databases... (DB & CDB in particular)"
- Maybe reply: Jerrad Pierce: "RE: Databases... (DB & CDB in particular)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
So why not modularize? Build an API into postfix to allow for example, the
user to load mod_cdb which handle the CDB magic en lieu of mod_db.
A la Apache, ProFTPD, etc...
>-----Original Message-----
>From: wietse
porcupine.org [mailto:wietse
porcupine.org]
>Sent: Wednesday, December 06, 2000 12:41 PM
>To: postfix-users
postfix.org
>Subject: Re: Databases... (DB & CDB in particular)
>
>
>Michael Ju. Tokarev:
>> Wietse Venema wrote:
>> >
>> > Last week I started looking at this CDB for Postfix implementation
>> > and found that it has problems.
>> >
>> > 1 - CDB tables are read-only by definition, so the flock() file
>> > locking calls should be removed from the dict_cdb.c code.
>> >
>> > 2 - Unlike mkmap_{dbm,hash,btree}_open(), the mkmap_cdb_open()
>> > routine does not correctly handle the case where two processes
>> > attempt to create the same foo.cdb file. The second process
>> > will clobber the temporary foo.cdb.tmp file while the first
>> > process is still writing to it. The first process will rename
>> > foo.cdb.tmp into foo.cdb while the second process is still
>> > writing to it. The second process will then attempt to rename
>> > foo.cdb.tmp into foo.cdb, which has already been renamed by
>> > the first process. The mkmap_{dbm,hash,btree}_open() have
>> > examples of how to use file locks to correctly handle
>simultaneous
>> > attempts to create a database file.
>>
>> That isn't a big issues to implement, really. I'll do that in
>> my patch, thanks for pointing this out. My updates are always
>> single-step (via makefile), so I never worried about concurrent
>> updates. For flocks, I just leaved what's there before (files
>> was made on top of *_db ones from postfix) -- I noticied unnecessary
>> locks, but decided to leave them for now.
>
>With every line being a potential bug, less code is better. It is
>just about the only technque known to me to avoid bugs - write as
>little code as possible.
>
>> > Several open source distributions already ship with CDB libraries
>> > as optional packages. The two I know of are Debian LINUX
>and FreeBSD.
>> > Therefore it seems wring to ship cdb library code with Postfix.
>>
>> Maybe you're right here. Just one "reminder" -- postfix has no
>> dict/map type for that it doesn't require external libraries
>> (not counting unix:passwd_byname etc), and those libraries are
>> a bit troublestone ones (sleepycat is just one example).
>> Reasonably small map type (cdb is just an example) can be put
>> inside postfix (at least to reduce dependances), moreover, it
>> can be made of postfix's quality, that isn't minor thing!
>
>When I need medical help, I go to a doctor, instead of learning
>everything that a doctor already knows. My time is spent better
>doing not doing the doctor's job.
>
>Another reason is that I can't look at cdb code for more than a
>few seconds before I need medical assistance.
>
> Wietse
>
- Next message: Wietse Venema: "Re: mailbox quota"
- Previous message: Michael Tokarev: "Re: virtual+aliases trouble"
- Maybe in reply to: Michael Tokarev: "Databases... (DB & CDB in particular)"
- Maybe reply: Jerrad Pierce: "RE: Databases... (DB & CDB in particular)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]