81 #include <boost/filesystem.hpp> 345 class sm_stats_cache_t;
351 class key_ranges_map;
375 return o << p.
_tid <<
':' << (
const lsn_t&)p;
405 class ss_m :
public smlevel_top {
406 friend class prologue_rc_t;
407 friend class log_entry;
408 friend class coordinator;
539 static void set_shutdown_flag(
bool clean);
549 static void set_shutdown_filthy(
bool filthy);
556 static rc_t log_file_was_archived(
const char* logfile);
558 rc_t _truncate_log();
563 void _construct_once();
565 void _destruct_once();
569 void _finish_recovery();
572 static xct_t* _new_xct(
576 bool single_log_sys_xct =
false);
603 static rc_t begin_xct(
628 static rc_t begin_xct(
646 static rc_t begin_xct(
662 static rc_t begin_sys_xct(
663 bool single_log_sys_xct =
false,
680 static rc_t commit_xct(
682 lsn_t* plastlsn =
nullptr);
698 static rc_t commit_xct(
701 lsn_t* plastlsn =
nullptr);
709 static rc_t commit_sys_xct();
726 static rc_t chain_xct(
744 static rc_t chain_xct(
bool lazy =
false);
785 static rc_t commit_xct_group(
804 static rc_t abort_xct();
839 static uint32_t num_active_xcts();
847 smthread_t::attach_xct(x);
887 static rc_t dump_xcts(ostream& o);
897 static xct_state_t state_xct(
const xct_t* x);
907 static off_t xct_log_space_needed();
921 static rc_t xct_reserve_log_space(off_t amt);
936 static rc_t checkpoint();
942 static rc_t force_volume();
947 static rc_t dump_buffers(ostream& o);
949 static rc_t dump_locks(ostream& o);
951 static rc_t dump_locks();
961 static rc_t gather_xct_stats(
970 static rc_t gather_stats(
989 static rc_t set_disk_delay(u_int milli_sec);
995 static rc_t sync_log(
bool block =
true);
1001 static rc_t flush_until(
lsn_t& anlsn,
bool block =
true);
1013 static rc_t get_durable_lsn(
lsn_t& anlsn);
1026 static void dump_page_lsn_chain(std::ostream& o,
const PageID& pid,
1027 const lsn_t& max_lsn);
1038 static void dump_page_lsn_chain(std::ostream& o,
const PageID& pid);
1048 static void dump_page_lsn_chain(std::ostream& o);
1056 static rc_t verify_volume(
1118 static rc_t create_index(
1142 static rc_t touch_index(
StoreID stid, uint64_t& page_count);
1157 static rc_t create_assoc(
1163 static rc_t create_assoc(
1176 static rc_t update_assoc(
1189 static rc_t put_assoc(
1204 static rc_t overwrite_assoc(
1214 static rc_t destroy_assoc(
1234 static rc_t find_assoc(
1264 static rc_t verify_index(
StoreID stid,
int hash_bits,
bool& consistent);
1273 bool for_update =
false);
1303 bool check_only =
false,
1307 static rc_t activate_archiver();
1320 void _set_option_logsize();
1322 static rc_t _set_store_property(
1324 store_property_t property);
1326 static rc_t _get_store_property(
1328 store_property_t& property);
1330 static rc_t _begin_xct(
1334 bool sys_xct =
false,
1335 bool single_log_sys_xct =
false);
1337 static rc_t _commit_xct(
1342 static rc_t _commit_xct_group(
1346 static rc_t _chain_xct(
1350 static rc_t _abort_xct(
1357 static rc_t _get_store_info(
1365 static store_flag_t _make_store_flag(store_property_t property);
1394 template<
class ostream>
Lock Manager API.See Orthogonal Key Value Locking and Light-weight Intent Lock.
Definition: lock.h:27
u_long page_size
compile-time constant. Settable in
Definition: smstats.h:226
static xct_t * xct()
return xct this thread is running
Definition: smthread.h:364
friend ostream & operator<<(ostream &o, const sm_save_point_t &p)
Definition: sm.h:374
uint32_t smsize_t
Definition: basics.h:41
Definition: lock_lil.h:147
static int _instance_cnt
Definition: sm.h:1318
u_long max_btree_entry_size
Largest permissible size in bytes of an index entry (key,value pair)
Definition: smstats.h:242
smlevel_0::concurrency_t concurrency_t
Definition: sm.h:413
A transaction. Internal to the storage manager.This class may be used in a limited way for the handli...
Definition: xct.h:185
Page handle for B-Tree data page.
Definition: btree_page_h.h:185
Definition: btree_verify.h:84
uint32_t StoreID
Definition: basics.h:47
Key string class which can represent a few special values.
Definition: w_key.h:47
Start-up parameters for the storage engine. See OPTIONS.
Definition: sm_options.h:24
Information about a store that can be queried by the client.
Definition: sm.h:1377
uint32_t PageID
Definition: basics.h:45
This is the SHORE Storage Manager API.
Definition: sm.h:405
Configuration Information.
Definition: smstats.h:221
Log Sequence Number. See Log Sequence Numbers (LSN).
Definition: lsn.h:243
sm_store_property_t store_property_t
Definition: sm.h:417
Handle class for pages that may be fixed (i.e., paged in by the main buffer manager, zero::buffer_pool::BufferPool)
Definition: fixable_page_h.h:26
static const sm_options & get_options()
Definition: sm.h:1312
static void detach_xct(xct_t *x)
Definition: smthread.cpp:396
std::array< long, enum_to_base(sm_stat_id::stat_max)> sm_stats_t
Definition: smstats.h:205
static constexpr int WAIT_SPECIFIED_BY_XCT
Definition: timeout.h:30
Return code for most functions and methods.
Definition: w_rc.h:87
static sm_options _options
Definition: sm.h:1310
PageID root
Root page if this is an index.
Definition: sm.h:1389
friend istream & operator>>(istream &i, sm_save_point_t &p)
Definition: sm.h:378
sm_save_point_t()
Definition: sm.h:372
tid_t tid() const
Definition: sm.h:383
StoreID store
store number
Definition: sm.h:1386
Represents a lock mode of one key entry in the OKVL lock manager.
Definition: w_okvl.h:95
The means of identifying a desired or held lock.
Definition: lock_s.h:41
u_long lg_rec_page_space
Definition: smstats.h:235
bool logging
True if logging is on.
Definition: smstats.h:257
Vector: a set of {pointer,length} pairs for memory manipulation.
Definition: vec_t.h:313
static void attach_xct(xct_t *x)
Attach the given transaction to the currently-running smthread_t.
Definition: sm.h:846
smlevel_0::xct_state_t xct_state_t
Definition: sm.h:415
~sm_store_info_t()
Definition: sm.h:1383
static constexpr int WAIT_SPECIFIED_BY_THREAD
Definition: timeout.h:29
u_long buffer_pool_size
Size in KB of buffer pool.
Definition: smstats.h:238
uint64_t tid_t
Definition: tid_t.h:59
sm_store_info_t()
Definition: sm.h:1379
tid_t _tid
Definition: sm.h:390
static void detach_xct()
Detach any attached from the currently-running smthread_t.
Definition: sm.h:857
concurrency_t
Lock granularities.
Definition: sm_base.h:256
friend class ss_m
Definition: sm.h:388
A point to which a transaction can roll back.
Definition: sm.h:370