core: on pivot, flush the cached ids outside of the pivot transaction.