Subject Re: [Firebird-Architect] Bi-directional indexes
Author Dmitry Yemanov
"Geoff Worboys" <geoff@...> wrote:
>
> There is also the question of what happens if A has a write
> lock and B has a read lock (or vise-versa).

This is exactly the case we're talking about. Two read locks cannot
deadlock.

During the split, A keeps a write lock for page 1 (to perform the split) and
tries to perform a handoff to obtain a write lock for page 2 (to update its
back pointer), but page 2 is read locked by B which is handing off and hence
in turn waiting for page 1 to be released. As a result, A cannot get a write
lock whilst B cannot get a read lock.


Dmitry