virtual void invoke(logrec_t& r) { // Dump stats on each tick log record if (r.type() == logrec_t::t_tick_sec || r.type() == logrec_t::t_tick_msec) { dumpStats(r.lsn()); return; } // Code copied from chkpt_t::scan_log if (r.is_redo()) { // Ignore metadata pages if (r.pid() % alloc_cache_t::extent_size == 0 || r.pid() == stnode_page::stpid) { return; } lsn_t lsn = r.lsn(); w_assert0(r.is_redo()); chkpt.mark_page_dirty(r.pid(), lsn, lsn); if (r.is_multi_page()) { w_assert0(r.pid2() != 0); chkpt.mark_page_dirty(r.pid2(), lsn, lsn); } updates++; } else if (r.type() == logrec_t::t_page_write) { char* pos = r.data(); PageID pid = *((PageID*) pos); pos += sizeof(PageID); lsn_t clean_lsn = *((lsn_t*) pos); pos += sizeof(lsn_t); uint32_t count = *((uint32_t*) pos); PageID end = pid + count; while (pid < end) { chkpt.mark_page_clean(pid, clean_lsn); pid++; } page_writes += count; } else if (r.type() == logrec_t::t_xct_end) { commits++; } }
void VerifyHandler::invoke(logrec_t& r) { w_assert0(r.valid_header()); lsn_t lsn = r.lsn(); PageID pid = r.pid(); if (r.is_redo()) { checkRedo(r, pid, lsn, r.page_prev_lsn()); if (r.is_multi_page()) { checkRedo(r, r.pid2(), lsn, r.page2_prev_lsn()); } if (alloc_cache_t::is_alloc_pid(pid)) { // checkAlloc(r); } } if (merge) { w_assert0(pid >= lastPID); if (pid == lastPID) { w_assert0(lsn > lastLSN); } w_assert0(merge || lsn >= minLSN); w_assert0(merge || lsn <= maxLSN); } lastLSN = lsn; lastPID = pid; count++; }