Log Manager, which writes out transactional logs.
This package contains classes that control transactional logging.
- Decentralized Logging
- Unlike traditional log manager in DBMS, this log manager is decentralized, meaning each log writer writes to its own file concurrently. This eliminates the bottleneck in log manager when there are a large number of cores. The basic idea to guarantee serializability is the epoch-based commit protocol, which does the check on all loggers before returning the results to client in a way similar to group-commit.
- Thread-private log buffer
- Each ThreadLoadBugger instance maintains a thread-local log buffer that is filled by the thread without any synchronization or blocking. The logger collects them and writes them out to log files. A single log writer handles one or more transactional threads (cores), and a single NUMA node hosts one or more log writers.
- See also
- foedus::log::ThreadLogBuffer
- Log Writer
- Each Logger instance writes out files suffixed with ordinal (eg ".0", ".1"...). The older logs files are deactivated and deleted after log gleaner consumes them.
- See also
- foedus::log::Logger
- Global Durable Epoch
- An important job of Log Manager is to maintain the global durable epoch. Log manager is the module to determine when it's safe to advance the global durable epoch. It makes sure all loggers flushed their logs up to the epoch, invoked required fsync(), and also takes a savepoint before it announces the new global durable epoch.
- See also
- foedus::log::LogManager
|
void | _dummy_static_size_check__COUNTER__ () |
|
LogCodeKind | get_log_code_kind (LogCode code) |
| Returns the kind of the given log code. More...
|
|
bool | is_valid_log_type (LogCode code) |
| Returns if the LogCode value exists. More...
|
|
const char * | get_log_type_name (LogCode code) |
| Returns the names of LogCode enum defined in log_type.xmacro. More...
|
|
template<typename LOG_TYPE > |
constexpr LogCode | get_log_code () |
| Returns LogCode for the log type defined in log_type.xmacro. More...
|
|
template<> |
constexpr LogCode | get_log_code< foedus::log::FillerLogType > () |
|
template<> |
constexpr LogCode | get_log_code< foedus::log::EpochMarkerLogType > () |
|
template<> |
constexpr LogCode | get_log_code< foedus::storage::DropLogType > () |
|
template<> |
constexpr LogCode | get_log_code< foedus::storage::array::ArrayCreateLogType > () |
|
template<> |
constexpr LogCode | get_log_code< foedus::storage::array::ArrayOverwriteLogType > () |
|
template<> |
constexpr LogCode | get_log_code< foedus::storage::array::ArrayIncrementLogType > () |
|
template<> |
constexpr LogCode | get_log_code< foedus::storage::sequential::SequentialTruncateLogType > () |
|
template<> |
constexpr LogCode | get_log_code< foedus::storage::sequential::SequentialCreateLogType > () |
|
template<> |
constexpr LogCode | get_log_code< foedus::storage::sequential::SequentialAppendLogType > () |
|
template<> |
constexpr LogCode | get_log_code< foedus::storage::hash::HashCreateLogType > () |
|
template<> |
constexpr LogCode | get_log_code< foedus::storage::hash::HashOverwriteLogType > () |
|
template<> |
constexpr LogCode | get_log_code< foedus::storage::hash::HashInsertLogType > () |
|
template<> |
constexpr LogCode | get_log_code< foedus::storage::hash::HashDeleteLogType > () |
|
template<> |
constexpr LogCode | get_log_code< foedus::storage::hash::HashUpdateLogType > () |
|
template<> |
constexpr LogCode | get_log_code< foedus::storage::masstree::MasstreeCreateLogType > () |
|
template<> |
constexpr LogCode | get_log_code< foedus::storage::masstree::MasstreeOverwriteLogType > () |
|
template<> |
constexpr LogCode | get_log_code< foedus::storage::masstree::MasstreeInsertLogType > () |
|
template<> |
constexpr LogCode | get_log_code< foedus::storage::masstree::MasstreeDeleteLogType > () |
|
template<> |
constexpr LogCode | get_log_code< foedus::storage::masstree::MasstreeUpdateLogType > () |
|
void | invoke_apply_engine (void *log_buffer, thread::Thread *context) |
| Invokes the apply logic for an engine-wide log type. More...
|
|
void | invoke_apply_storage (void *log_buffer, Engine *engine, storage::StorageId id) |
| Invokes the apply logic for a storage-wide log type. More...
|
|
void | invoke_apply_record (void *log_buffer, thread::Thread *context, storage::StorageId storage_id, xct::RwLockableXctId *owner_id_address, char *payload_address) |
| Invokes the apply logic for a record-wise log type. More...
|
|
void | invoke_assert_valid (void *log_buffer) |
| Invokes the assertion logic of each log type. More...
|
|
void | invoke_ostream (const void *buffer, std::ostream *ptr) |
| Invokes the ostream operator for the given log type defined in log_type.xmacro. More...
|
|
std::ostream & | operator<< (std::ostream &o, const LogHeader &v) |
|
std::ostream & | operator<< (std::ostream &o, const FillerLogType &v) |
|
std::ostream & | operator<< (std::ostream &o, const EpochMarkerLogType &v) |
|
std::ostream & | operator<< (std::ostream &o, const EpochHistory &v) |
|
bool | is_log_aligned (uint64_t offset) |
|
uint64_t | align_log_ceil (uint64_t offset) |
|
uint64_t | align_log_floor (uint64_t offset) |
|
std::ostream & | operator<< (std::ostream &o, const Logger &v) |
|
std::ostream & | operator<< (std::ostream &o, const MetaLogBuffer &v) |
|
void | on_non_durable_meta_log_found (const log::LogHeader *entry, Epoch durable_epoch, uint64_t offset) |
|
std::ostream & | operator<< (std::ostream &o, const MetaLogger &v) |
|
std::ostream & | operator<< (std::ostream &o, const ThreadLogBuffer &v) |
|
std::ostream & | operator<< (std::ostream &o, const ThreadLogBufferMeta &v) |
|
std::ostream & | operator<< (std::ostream &o, const ThreadEpockMark &v) |
|
std::ostream& foedus::log::operator<< |
( |
std::ostream & |
o, |
|
|
const Logger & |
v |
|
) |
| |
Definition at line 533 of file logger_impl.cpp.
References foedus::Attachable< CONTROL_BLOCK >::control_block_, foedus::log::LoggerControlBlock::current_ordinal_, foedus::log::LoggerControlBlock::epoch_history_count_, foedus::log::LoggerControlBlock::epoch_history_head_, foedus::fs::DirectIoFile::get_current_offset(), foedus::log::LoggerRef::get_durable_epoch(), foedus::log::LoggerRef::id_, foedus::log::LoggerRef::in_node_ordinal_, foedus::log::LoggerControlBlock::marked_epoch_, foedus::log::LoggerRef::numa_node_, foedus::log::LoggerControlBlock::oldest_file_offset_begin_, and foedus::log::LoggerControlBlock::oldest_ordinal_.
535 <<
"<id_>" << v.id_ <<
"</id_>"
536 <<
"<numa_node_>" <<
static_cast<int>(v.numa_node_) <<
"</numa_node_>"
537 <<
"<in_node_ordinal_>" << static_cast<int>(v.in_node_ordinal_) <<
"</in_node_ordinal_>"
538 <<
"<log_folder_>" << v.log_folder_ <<
"</log_folder_>";
539 o <<
"<assigned_thread_ids_>";
540 for (
auto thread_id : v.assigned_thread_ids_) {
541 o <<
"<thread_id>" << thread_id <<
"</thread_id>";
543 o <<
"</assigned_thread_ids_>";
544 o <<
"<durable_epoch_>" << v.get_durable_epoch() <<
"</durable_epoch_>"
545 <<
"<marked_epoch_>" << v.control_block_->marked_epoch_ <<
"</marked_epoch_>"
546 <<
"<oldest_ordinal_>" << v.control_block_->oldest_ordinal_ <<
"</oldest_ordinal_>"
547 <<
"<oldest_file_offset_begin_>" << v.control_block_->oldest_file_offset_begin_
548 <<
"</oldest_file_offset_begin_>"
549 <<
"<current_ordinal_>" << v.control_block_->current_ordinal_ <<
"</current_ordinal_>";
551 o <<
"<current_file_>";
552 if (v.current_file_) {
553 o << *v.current_file_;
557 o <<
"</current_file_>";
559 o <<
"<current_file_path_>" << v.current_file_path_ <<
"</current_file_path_>";
561 o <<
"<current_file_length_>";
562 if (v.current_file_) {
563 o << v.current_file_->get_current_offset();
567 o <<
"</current_file_length_>";
569 o <<
"<epoch_history_head>"
570 << v.control_block_->epoch_history_head_ <<
"</epoch_history_head>";
571 o <<
"<epoch_history_count>"
572 << v.control_block_->epoch_history_count_ <<
"</epoch_history_count>";