19 template<
class Logrec,
class... Args>
22 bool should_log = smlevel_0::log && smlevel_0::logging_enabled && xd;
31 reinterpret_cast<Logrec*
>(logrec)->construct(args...);
39 if (xd->is_piggy_backed_single_log_sys_xct()) {
42 W_COERCE(ss_m::log->insert(*logrec, &lsn));
44 DBGOUT3(<<
" SSX logged: " << logrec->
type() <<
"\n new_lsn= " << lsn);
50 W_COERCE(ss_m::log->insert(*logrec, &lsn));
51 W_COERCE(xd->update_last_logrec(logrec, lsn));
56 template<
class Logrec,
class PagePtr,
class... Args>
59 bool should_log = smlevel_0::log && smlevel_0::logging_enabled && xd;
67 log_p<page_img_format_log>(p);
71 auto extra_space = p->get_log_volume();
74 p->reset_log_volume();
83 reinterpret_cast<Logrec*
>(logrec)->construct(p, args...);
86 if (p->tag() !=
t_btree_p || p->root() == p->pid()) {
95 if (xd->is_piggy_backed_single_log_sys_xct()) {
98 W_COERCE(ss_m::log->insert(*logrec, &lsn));
101 DBGOUT3(<<
" SSX logged: " << logrec->
type() <<
"\n new_lsn= " << lsn);
107 W_COERCE(ss_m::log->insert(*logrec, &lsn));
108 W_COERCE(xd->update_last_logrec(logrec, lsn));
114 template<
class Logrec,
class PagePtr,
class... Args>
115 static lsn_t log_p(PagePtr p, PagePtr p2,
const Args& ... args) {
117 bool should_log = smlevel_0::log && smlevel_0::logging_enabled && xd;
127 reinterpret_cast<Logrec*
>(logrec)->construct(p, p2, args...);
130 if (p->tag() !=
t_btree_p || p->root() == p->pid()) {
133 if (p2->tag() !=
t_btree_p || p2->root() == p2->pid()) {
144 multi->_page2_prv = p2->get_page_lsn();
148 if (xd->is_piggy_backed_single_log_sys_xct()) {
151 W_COERCE(ss_m::log->insert(*logrec, &lsn));
155 DBGOUT3(<<
" SSX logged: " << logrec->
type() <<
"\n new_lsn= " << lsn);
161 W_COERCE(ss_m::log->insert(*logrec, &lsn));
162 W_COERCE(xd->update_last_logrec(logrec, lsn));
176 template<
class Logrec,
class... Args>
185 reinterpret_cast<Logrec*
>(logrec)->construct(args...);
190 W_COERCE(ss_m::log->insert(*logrec, &lsn));
196 template<
class PagePtr>
198 page->update_page_lsn(new_lsn);
199 page->increment_log_volume(size);
202 template<
class PagePtr>
208 auto comp = ss_m::log->get_page_img_compression();
212 auto vol = page->get_log_volume();
214 page->reset_log_volume();
232 #endif // __XCT_LOGGER_H bool is_multi_page() const
Definition: logrec.h:634
multi_page_log_t * data_ssx_multi()
Definition: logrec.h:676
static xct_t * xct()
return xct this thread is running
Definition: smthread.h:364
static logrec_t * get_logbuf()
Definition: smthread.h:355
const w_rc_t RCOK
Definition: w_rc.h:239
#define w_assert1(x)
Level 1 should not add significant extra time.
Definition: w_base.h:198
void init_xct_info()
Definition: logrec.cpp:224
rc_t end_sys_xct(rc_t result)
Definition: xct.cpp:1711
A transaction. Internal to the storage manager.This class may be used in a limited way for the handli...
Definition: xct.h:185
static void _update_page_lsns(PagePtr page, lsn_t new_lsn, uint32_t size)
Definition: xct_logger.h:197
#define w_assert3(x)
Level 3 definitely adds significant time.
Definition: w_base.h:214
void init_header(kind_t)
Definition: logrec.cpp:201
static lsn_t log_sys(const Args &... args)
Definition: xct_logger.h:177
void set_page_prev_lsn(const lsn_t &lsn)
Definition: logrec.h:573
Base struct for log records that touch multi-pages.
Definition: logrec.h:463
static const lsn_t null
Definition: lsn.h:371
bool is_redo() const
Definition: logrec.h:630
static lsn_t log(const Args &... args)
Definition: xct_logger.h:20
Used to automatically begin/commit/abort a system transaction.
Definition: xct.h:1204
bool valid_header(const lsn_t &lsn_ck=lsn_t::null) const
Definition: logrec.cpp:247
#define DBGOUT3(a)
Definition: w_debug.h:212
Represents a transactional log record.
Definition: logrec.h:143
bool is_piggy_backed_single_log_sys_xct() const
Definition: xct.h:579
void set_xid_prev(tid_t tid, lsn_t last)
Definition: logrec.cpp:232
static lsn_t log_p(PagePtr p, const Args &... args)
Definition: xct_logger.h:57
Log Sequence Number. See Log Sequence Numbers (LSN).
Definition: lsn.h:243
btree page
Definition: generic_page.h:90
void init_page_info(const PagePtr p)
Definition: logrec.h:241
static constexpr u_char get_logrec_cat(kind_t type)
Definition: logrec.h:686
bool is_single_sys_xct() const
Definition: logrec.h:672
Definition: xct_logger.h:10
static bool _should_apply_img_compression(logrec_t::kind_t type, PagePtr page)
Definition: xct_logger.h:203
#define W_COERCE(x)
Call a function or method x, fail catastrophically if error is returned.
Definition: w_rc.h:349
kind_t type() const
Definition: logrec.h:598
static lsn_t log_p(PagePtr p, PagePtr p2, const Args &... args)
Definition: xct_logger.h:115
void set_root_page()
Definition: logrec.h:620
smsize_t length() const
Definition: logrec.h:545
#define ADD_TSTAT(x, y)
Increment statistic named x by y.
Definition: smthread.h:397
kind_t
Definition: logrec.h:149
static logrec_t * _get_logbuf(xct_t *xd)
Definition: xct_logger.h:220
static logrec_t * get_logbuf2()
Definition: smthread.h:359