There was 3 possible solutions offered for
and first of them was committed into codebase :
> mark parent page with btr_dont_gc flag before CCH_HANDOFF and clear this mark after return from add_node
> Easy to implement but make additional page fetches with LCK_write lock which is not necessary in most cases.
There was (private) reports about performance loss in some specific scenarios so new solution was implemented :
Replace btr_dont_gc flag by special kind of lock and restore original page locking scheme.
Instead of set btr_dont_gc flag acquire shared lock with page number as a key.
Instead of clear btr_dont_gc flag release already acquired lock.
Instead of test for btr_dont_gc flag acquire exclusive lock with page number as a key in no-wait mode and release it immediately.
Acquiring of this new locks must be done only after page fetch, i.e. after obtaining page lock .