71 #include <unordered_map> 83 page_lsn(
lsn_t::null),
84 clean_lsn(
lsn_t::null) {}
92 if (page > page_lsn) {
95 if (rec >= clean_lsn && rec < rec_lsn) {
101 if (clean > clean_lsn) {
124 state(
xct_t::xct_active),
125 last_lsn(
lsn_t::null),
129 return state != xct_t::xct_ended;
134 locks.push_back({mode, hash});
139 state = xct_t::xct_ended;
143 if (last > last_lsn) {
146 if (first < first_lsn && !first.
is_null()) {
152 typedef unordered_map<PageID, buf_tab_entry_t>
buf_tab_t;
154 typedef unordered_map<tid_t, xct_tab_entry_t>
xct_tab_t;
202 void add_backup(
const char* path,
lsn_t backupLSN);
212 return last_scan_start;
227 void dump(ostream& out);
229 void serialize_binary(ofstream& ofs);
234 void set_redo_low_water_mark(
lsn_t lsn);
242 class chkpt_thread_t;
264 virtual void do_work();
266 void take(
chkpt_t* chkpt =
nullptr);
285 if (!_min_rec_lsn.is_null() && _min_rec_lsn <
min) {
288 if (!_min_xct_lsn.is_null() && _min_xct_lsn <
min) {
bool ignore_restore
Definition: chkpt.h:174
bool _print_propstats
Definition: chkpt.h:314
long _chkpt_count
Definition: chkpt.h:295
void update_lsns(lsn_t first, lsn_t last)
Definition: chkpt.h:142
lsn_t get_last_scan_start() const
Definition: chkpt.h:211
Definition: worker_thread.h:12
buf_tab_entry_t()
Definition: chkpt.h:81
lsn_t clean_lsn
Definition: chkpt.h:79
bool ongoing_restore
Definition: chkpt.h:187
string bkp_path
Definition: chkpt.h:181
bool is_active() const
Definition: chkpt.h:128
A transaction. Internal to the storage manager.This class may be used in a limited way for the handli...
Definition: xct.h:185
uint32_t lock_hash
Definition: chkpt.h:109
lsn_t last_lsn
Definition: chkpt.h:119
Start-up parameters for the storage engine. See OPTIONS.
Definition: sm_options.h:24
chkpt_t curr_chkpt
Definition: chkpt.h:297
std::vector< uint32_t > restore_tab
Definition: chkpt.h:185
static const lsn_t null
Definition: lsn.h:371
std::mutex chkpt_mutex
Definition: chkpt.h:299
lsn_t bkp_lsn
Definition: chkpt.h:183
bool _use_log_archive
Definition: chkpt.h:310
xct_tab_entry_t()
Definition: chkpt.h:123
bool is_dirty() const
Definition: chkpt.h:86
Represents a transactional log record.
Definition: logrec.h:143
lsn_t _min_rec_lsn
Definition: chkpt.h:304
buf_tab_t buf_tab
Definition: chkpt.h:177
uint32_t PageID
Definition: basics.h:45
void add_lock(okvl_mode mode, uint32_t hash)
Definition: chkpt.h:132
Log Sequence Number. See Log Sequence Numbers (LSN).
Definition: lsn.h:243
const T max(const T x, const T y)
Definition: w_minmax.h:45
bool _log_based
Definition: chkpt.h:312
void mark_ended()
Definition: chkpt.h:138
lsn_t page_lsn
Definition: chkpt.h:78
lsn_t last_scan_start
Definition: chkpt.h:162
lsn_t _min_xct_lsn
Definition: chkpt.h:306
lsn_t get_min_rec_lsn()
Definition: chkpt.h:268
lsn_t rec_lsn
Definition: chkpt.h:77
Represents a lock mode of one key entry in the OKVL lock manager.
Definition: w_okvl.h:95
size_t _dirty_page_count
Definition: chkpt.h:316
xct_t * xct()
Definition: smthread.h:575
void mark_dirty(lsn_t page, lsn_t rec)
Definition: chkpt.h:90
lsn_t _last_end_lsn
Definition: chkpt.h:308
okvl_mode lock_mode
Definition: chkpt.h:108
lsn_t get_min_active_lsn()
Definition: chkpt.h:283
lsn_t get_min_xct_lsn()
Definition: chkpt.h:272
uint64_t tid_t
Definition: tid_t.h:59
PageID restore_page_cnt
Definition: chkpt.h:189
std::ofstream _propstats_ofs
Definition: chkpt.h:318
bool is_null() const
Definition: lsn.h:357
const T min(const T x, const T y)
Definition: w_minmax.h:52
unordered_map< tid_t, xct_tab_entry_t > xct_tab_t
Definition: chkpt.h:154
tid_t get_highest_tid()
Definition: chkpt.h:219
tid_t highest_tid
Definition: chkpt.h:160
lsn_t first_lsn
Definition: chkpt.h:120
vector< lock_info_t > locks
Definition: chkpt.h:121
void set_highest_tid(tid_t tid)
Definition: chkpt.h:223
xct_tab_t xct_tab
Definition: chkpt.h:179
smlevel_0::xct_state_t state
Definition: chkpt.h:117
void mark_clean(lsn_t clean)
Definition: chkpt.h:100
void set_last_scan_start(lsn_t l)
Definition: chkpt.h:215
unordered_map< PageID, buf_tab_entry_t > buf_tab_t
Definition: chkpt.h:152