[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: BDB, endian



Howard,

I would be very much in favor of such a change. The main problem I'm having at 
the moment in having to maintain LDAP servers on multiple platforms are that 
the databases are not portable across platforms. The issues are:

1. The ID's do not have a fixed, platform-independent, data-type associated
    with them, i.e. on 32-bit platforms the ID's are 32-bit integer values and
    on 64-bit platforms the ID's are 64-bit integer values.
2. The ID's do not have a fixed, platform-independent, representation format
     associated with them when they are stored in the database, i.e.  
     byte-orders differ between little-endian machines and big-endian
     machines.

These 2 issues prevent me from being able to just copy the databases across to 
the different platforms whenever a database corruption occurs, or I need to 
resync the database contents with an other database. The method I have to use 
now (running a slapcat on the source machine and a slapadd on the destination 
machine) takes way too long for the multi-million entries LDAP directory I'm 
maintaining.

I would be very pleased if these issues could be resolved. I guess your 
suggestion already takes care of issue 2, but I would be very happy if we 
could fix issue 1 while we are at it.
By the way, we should do this for both the bdb backend as the ldbm backend.

Just my $0.02.

    Best regards,

        Gertjan.

On Tuesday 18 November 2003 21:19, Howard Chu wrote:
> back-bdb currently uses custom sort functions with its Btree databases
> because otherwise the integer entry IDs don't sort correctly on
> little-endian (e.g. Intel) systems. The use of custom sort functions means
> it's unsafe to use SleepyCat's db_dump/db_load to backup/restore databases
> on little-endian machines.
>
> An alternative is to byteswap all of the entry IDs when they go to/from the
> database. I think this may impose a slight performance cost, but it would
> make the generic tools safe for use. Any thoughts on whether to make this
> change?
>
>   -- Howard Chu
>   Chief Architect, Symas Corp.       Director, Highland Sun
>   http://www.symas.com               http://highlandsun.com/hyc
>   Symas: Premier OpenSource Development and Support