Re: Problems with secondary indices 4.4.20 -
04-26-2006
, 08:08 PM
Hi Dave,
Do you have any custom comparison callbacks on the secondary? (Either
DB->set_bt_compare or DB->set_dup_compare). Invalid comparison
functions could lead to the kind of behavior you're describing.
As far as locking is concerned, the c_pget call doesn't require write
locks, but the read locks it takes will block with the write locks
acquired by the c_put. There is no way to lock the primary first when
you start with a secondary key -- DB doesn't know what page in the
primary to lock.
In fact, the c_put code attempts to lock the secondary first, but when
updating an existing primary record, we need to know what is being
overwritten in order to remove the old secondary entries, which means
that the primary has to be locked before the secondary.
Regards,
Michael. |