18 #ifndef FOEDUS_XCT_XCT_MANAGER_PIMPL_HPP_
19 #define FOEDUS_XCT_XCT_MANAGER_PIMPL_HPP_
252 uint32_t write_set_size);
280 uint32_t write_set_size)
281 : write_set_(write_set),
283 write_set_size_(write_set_size) {
305 ASSERT_ND(cll_pos_ < cll_->get_last_active_entry());
320 if (write_id < next_write_id) {
328 "XctManagerControlBlock is too large.");
331 #endif // FOEDUS_XCT_XCT_MANAGER_PIMPL_HPP_
void resume_accepting_xct()
Make sure you call this after pause_accepting_xct().
uint32_t write_next_pos_
exclusive end of write-sets of the current record in write-set.
ErrorStack uninitialize_once() override
UniversalLockId universal_lock_id_
Used to order locks in canonical order.
ErrorStack initialize_once() override
void release_and_clear_all_current_locks(thread::Thread *context)
unlocking all acquired locks, used when commit/abort.
~XctManagerControlBlock()=delete
Epoch get_current_global_epoch_weak() const
void precommit_xct_apply(thread::Thread *context, XctId max_xct_id, Epoch *commit_epoch)
Phase 3 of precommit_xct()
ErrorCode precommit_xct_readwrite(thread::Thread *context, Epoch *commit_epoch)
precommit_xct() if the transaction is read-write
Root package of FOEDUS (Fast Optimistic Engine for Data Unification Services).
bool precommit_xct_verify_readwrite(thread::Thread *context, XctId *max_xct_id)
Phase 2 of precommit_xct() for read-write case.
Represents a record of write-access during a transaction.
std::atomic< Epoch::EpochInteger > requested_global_epoch_
If some thread requested to immediately advance epoch, the requested epoch.
void wakeup_epoch_chime_thread()
Represents one thread running on one NUMA core.
void wait_until_resume_accepting_xct(thread::Thread *context)
Forward declarations of classes in transaction package.
bool precommit_xct_verify_readonly(thread::Thread *context, Epoch *commit_epoch)
Phase 2 of precommit_xct() for read-only case.
soc::SharedPolling epoch_chime_wakeup_
Fired to wakeup epoch_chime_thread_.
Epoch get_current_global_epoch() const
Forward declarations of classes in root package.
Persistent status part of Transaction ID.
ErrorCode precommit_xct_lock_batch_track_moved(thread::Thread *context)
Subroutine of precommit_xct_lock to track most of moved records in write-set.
Brings error stacktrace information as return value of functions.
ErrorCode precommit_xct_lock(thread::Thread *context, XctId *max_xct_id)
Phase 1 of precommit_xct()
const LockListPosition kLockListPositionInvalid
Represents a record of read-access during a transaction.
An entry in CLL and RLL, representing a lock that is taken or will be taken.
A polling-wait mechanism that can be placed in shared memory and used from multiple processes...
Typical implementation of Initializable as a skeleton base class.
bool is_stop_requested() const
ErrorCode abort_xct(thread::Thread *context)
const uint32_t write_set_size_
Shared data in XctManagerPimpl.
An iterator over CurrentLockList to find entries along with sorted write-set.
void handle_epoch_chime()
Main routine for epoch_chime_thread_.
void advance_current_global_epoch()
uintptr_t UniversalLockId
Universally ordered identifier of each lock.
CurrentLockListIteratorForWriteSet(const WriteXctAccess *write_set, const CurrentLockList *cll, uint32_t write_set_size)
void wait_for_current_global_epoch(Epoch target_epoch, int64_t wait_microseconds)
ErrorCode begin_xct(thread::Thread *context, IsolationLevel isolation_level)
User transactions related methods.
void next_writes()
Look for next record's write-set(s).
uint32_t write_cur_pos_
inclusive beginning of write-sets of the current record in write-set.
Definitions of IDs in this package and a few related constant values.
Epoch get_requested_global_epoch() const
ErrorCode wait_for_commit(Epoch commit_epoch, int64_t wait_microseconds)
uint32_t LockListPosition
Index in a lock-list, either RLL or CLL.
void precommit_xct_sort_access(thread::Thread *context)
bool precommit_xct_verify_pointer_set(thread::Thread *context)
Returns false if there is any pointer set conflict.
Database engine object that holds all resources and provides APIs.
LockEntry * get_entry(LockListPosition pos)
LockListPosition cll_pos_
CLL entry that corresponds to the current record in write-set.
std::atomic< bool > new_transaction_paused_
If true, all new requests to begin_xct() will be paused until this becomes false. ...
ErrorCode precommit_xct(thread::Thread *context, Epoch *commit_epoch)
This is the gut of commit protocol.
XctManagerControlBlock * control_block_
bool precommit_xct_acquire_writer_lock(thread::Thread *context, WriteXctAccess *write)
std::thread epoch_chime_thread_
This thread keeps advancing the current_global_epoch_.
bool precommit_xct_lock_track_write(thread::Thread *context, WriteXctAccess *entry)
used from precommit_xct_lock() to track moved record
const CurrentLockList *const cll_
XctManagerPimpl(Engine *engine)
IsolationLevel
Specifies the level of isolation during transaction processing.
bool precommit_xct_verify_page_version_set(thread::Thread *context)
Returns false if there is any page version conflict.
void handle_epoch_chime_wait_grace_period(Epoch grace_epoch)
Makes sure all worker threads will commit with an epoch larger than grace_epoch.
Pimpl object of XctManager.
XctManagerControlBlock()=delete
bool precommit_xct_request_writer_lock(thread::Thread *context, WriteXctAccess *write)
void set_requested_global_epoch(Epoch request)
std::atomic< Epoch::EpochInteger > current_global_epoch_
The current epoch of the entire engine.
Sorted list of all locks, either read-lock or write-lock, taken in the current run.
#define ASSERT_ND(x)
A warning-free wrapper macro of assert() that has no performance effect in release mode even when 'x'...
ErrorCode precommit_xct_readonly(thread::Thread *context, Epoch *commit_epoch)
precommit_xct() if the transaction is read-only
std::atomic< bool > epoch_chime_terminate_requested_
Protected by the mutex in epoch_chime_wakeup_.
Forward declarations of classes in thread package.
UniversalLockId owner_lock_id_
Universal Lock ID of the lock in the record.
void pause_accepting_xct()
Pause all begin_xct until you call resume_accepting_xct()
void assert_sorted() const __attribute__((always_inline))
ErrorCode
Enum of error codes defined in error_code.xmacro.
soc::SharedPolling current_global_epoch_advanced_
Fired (broadcast) whenever current_global_epoch_ is advanced.
const WriteXctAccess *const write_set_
bool precommit_xct_try_acquire_writer_locks(thread::Thread *context)
bool precommit_xct_verify_track_read(thread::Thread *context, ReadXctAccess *entry)
used from verification methods to track moved record