libfoedus-core
FOEDUS Core Library
|
A system transaction is a special transaction that changes nothing logically. It changes only physical structures. For example, it splits a page or expand a physical record without changing their logical data to help normal, user transactions (Xct).
There are several prior work in databases to use system tranasctions. System transactions in FOEDUS differ a bit from others in the following sense:
System transactions are not exposed to users, so the whole file is _impl.
![]() |
Classes | |
struct | foedus::xct::SysxctFunctor |
A functor representing the logic in a system transaction via virtual-function. More... | |
struct | foedus::xct::SysxctLockEntry::LessThan |
for std::binary_search() etc without creating the object More... | |
struct | foedus::xct::SysxctLockEntry |
An entry in CLL/RLL for system transactions. More... | |
struct | foedus::xct::SysxctWorkspace |
Per-thread reused work memory for system transactions. More... | |
Functions | |
template<typename MCS_ADAPTOR , typename ENCLOSURE_RELEASE_ALL_LOCKS_FUNCTOR > | |
ErrorCode | foedus::xct::run_nested_sysxct_impl (SysxctFunctor *functor, MCS_ADAPTOR mcs_adaptor, uint32_t max_retries, SysxctWorkspace *workspace, UniversalLockId enclosing_max_lock_id, ENCLOSURE_RELEASE_ALL_LOCKS_FUNCTOR enclosure_release_all_locks_functor) |
Runs a system transaction nested in a user transaction. More... | |
|
inline |
Runs a system transaction nested in a user transaction.
[in] | context | the enclosing user transaction's thread. |
[in] | functor | the functor content of the system transaction. |
[in] | mcs_adaptor | abstracts MCS interface. |
[in] | max_retries | How many times at most to retry the same system transaction if it aborts. 0 means no retries (default behavior). It retries when the return value of the functor was RaceAbort or LockAbort. Other return values are immediately propagated. |
[in,out] | workspace | Resource for system transaction. |
[in] | enclosing_max_lock_id | largest lock-id held by outer transaction. |
[in] | enclosure_release_all_locks_functor | when the system transaction gets a race abort, it might call this back to release all locks in the outer transaction. |
System transactions are much more casual transactions than user transactions. They are begun/committed for a small function or a few. In order to make sure we release related resources in SysxctWorkspace, we should always use this function.
This function is for the majority of system transaction usecases where a normal user transaction needs to physically change some page/record and invokes a system transaction.
Definition at line 496 of file sysxct_impl.hpp.
References foedus::kErrorCodeXctLockAbort, foedus::kErrorCodeXctRaceAbort, foedus::kErrorCodeXctTwoSysXcts, foedus::xct::kNullUniversalLockId, foedus::xct::SysxctWorkspace::lock_list_, foedus::xct::SysxctFunctor::run(), foedus::xct::SysxctWorkspace::running_sysxct_, and UNLIKELY.
Referenced by foedus::thread::ThreadPimpl::run_nested_sysxct().