Ken/Tom,

On Solaris 5.11 snv_96 i86pc I'm seeing failures when running the db2
hash tests found in src/plugins/kdb/db2/libdb2/test.  What is happening
is in test1 there is a put() followed by a get() which is failing with
this error message:

get failed, no such key

I'm running:

./dbtest -o ./t3 hash ./t2

Its failing because in:

__get_item() there is this code to calculate the key->size:

        if (KEY_OFF(cursorp->pagep, cursorp->pgndx) != BIGPAIR) {
                if ((i = prev_realkey(cursorp->pagep, cursorp->pgndx)) ==
                    cursorp->pgndx)
                        key->size = hashp->hdr.bsize -
                            KEY_OFF(cursorp->pagep, cursorp->pgndx);

Now I know that the put() key->size was 5 but after the assignment above
key->size is 65541.  The problem is that on Solaris:

KEY_OFF(cursorp->pagep, cursorp->pgndx) = 65531
hashp->hdr.bsize = 131072

And hashp->hdr.bsize is being set in init_hash here:

        /* Fix bucket size to be optimal for file system */
        if (file != NULL) {
                if (stat(file, &statbuf))
                        return (NULL);
                hashp->hdr.bsize = statbuf.st_blksize;

And statbuf.st_blksize = 131072.  Note that I'm running dbtest on a ZFS
filesystem.  And googling I notice some posts about how ZFS uses
variable block sizes.

So either is the above code is making some bad assumptions or stat() is
buggy.  Thoughts?

-- 
Will Fiveash
Sun Microsystems Inc.
http://opensolaris.org/os/project/kerberos/

Reply via email to