Various libdb2 test programs use the MPOOL_IGNOREPIN flag to examine
arbitrary mpool pages that may or may not be pinned. This flag is
apparently intended to allow fetching pages that are already pinned,
and to avoid setting the MPOOL_PINNED flag. When there was a cache
hit, mpool_get was setting MPOOL_PINNED anyway, causing aborts when
using debugging programs such as dbtest and bttest.
Fix this inconsistency by not setting MPOOL_PINNED when returning a
cached page when the caller requested MPOOL_IGNOREPIN. In bttest, add
MPOOL_IGNOREPIN to allow dumping of pages while they are pinned
without disrupting their pinned status.
ticket: 8478
TAILQ_INSERT_TAIL(&mp->lqh, bp, q);
/* Return a pinned page. */
- bp->flags |= MPOOL_PINNED;
+ if (!(flags & MPOOL_IGNOREPIN))
+ bp->flags |= MPOOL_PINNED;
return (bp->page);
}
pg = atoi(argv[1]);
t = db->internal;
- if ((h = mpool_get(t->bt_mp, pg, 0)) == NULL) {
+ if ((h = mpool_get(t->bt_mp, pg, MPOOL_IGNOREPIN)) == NULL) {
(void)printf("getpage of %ld failed\n", pg);
return;
}
__bt_dmpage(h);
else
__bt_dpage(db, h);
- mpool_put(t->bt_mp, h, 0);
}
#endif