20 #include <glog/logging.h>
34 uint16_t in_node_ordinal)
74 LOG(INFO) <<
"Ignored a dummy epoch marker while replaying epoch marker log on Logger-"
75 <<
id_ <<
". marker=" << epoch_marker;
80 LOG(FATAL) <<
"Exceeded kMaxEpochHistory. Unexpected.";
106 for (; pos < count; ++pos) {
107 uint32_t abs_pos =
control_block_->wrap_epoch_history_index(head + pos);
116 LOG(INFO) <<
"No epoch mark found for " << prev_epoch <<
" in logger-" <<
id_
117 <<
" This usually happens when there was no transactional log before system shutdown";
126 for (; pos < count; ++pos) {
127 uint32_t abs_pos =
control_block_->wrap_epoch_history_index(head + pos);
std::vector< uint64_t > oldest_log_files_offset_begin_
Indicates the inclusive beginning of active region in the oldest log file.
void copy_logger_state(savepoint::Savepoint *new_savepoint) const
Called from log manager's copy_logger_states.
uint16_t in_node_ordinal_
Root package of FOEDUS (Fast Optimistic Engine for Data Unification Services).
a contiguous range of log entries that might span multiple files.
std::vector< uint64_t > current_log_files_offset_durable_
Indicates the exclusive end of durable region in the current log file.
The information we maintain in savepoint manager and externalize to a file.
Epoch old_epoch_
Epoch before this switch.
uint64_t log_file_offset_
LogRange get_log_range(Epoch prev_epoch, Epoch until_epoch)
Constructs the range of log entries that represent the given epoch ranges.
LogFileOrdinal log_file_ordinal_
LogFileOrdinal begin_file_ordinal
LoggerControlBlock * control_block_
The shared data on shared memory that has been initialized in some SOC or master engine.
Database engine object that holds all resources and provides APIs.
A log type to declare a switch of epoch in a logger or the engine.
Epoch get_durable_epoch() const
Returns this logger's durable epoch.
void wakeup_for_durable_epoch(Epoch desired_durable_epoch)
Wakes up this logger if its durable_epoch has not reached the given epoch yet.
Auto-lock scope object for SharedMutex.
void wakeup()
Wakes up this logger if it is sleeping.
Attachable Resources on Shared Memory.
Epoch new_epoch_
Epoch after this switch.
std::vector< log::LogFileOrdinal > oldest_log_files_
Ordinal of the oldest active log file in each logger.
Max number of active epoch histories.
Atomic fence methods and load/store with fences that work for both C++11/non-C++11 code...
void memory_fence_acquire()
Equivalent to std::atomic_thread_fence(std::memory_order_acquire).
LogFileOrdinal end_file_ordinal
void add_epoch_history(const EpochMarkerLogType &epoch_marker)
Append a new epoch history.
#define ASSERT_ND(x)
A warning-free wrapper macro of assert() that has no performance effect in release mode even when 'x'...
uint16_t LoggerId
Typedef for an ID of Logger.
std::vector< log::LogFileOrdinal > current_log_files_
Indicates the log file each logger is currently appending to.
Represents an event where a logger switched its epoch.