This mostly reverts commit 1915cb96. Too many concurrency issues. Retains the improvement to syncprov_sessionlog_cmp