82 bool update_rseg_history_len,
148#ifndef UNIV_HOTBACKUP
uint32_t space_id_t
Tablespace identifier.
Definition: api0api.h:49
uint32_t page_no_t
Page number.
Definition: api0api.h:47
Definition: read0read_view_interface.h:33
Rollback segments from a given transaction with trx-no scheduled for purge.
Definition: trx0types.h:554
Page size descriptor.
Definition: page0size.h:50
Track an UNDO tablespace marked for truncate.
Definition: trx0undo_trunc.h:654
The low-level file system.
std::string truncate(const std::string &str, const size_t max_length)
Truncates the given string to max_length code points.
Definition: utils_string.cc:600
byte page_t
Type of the index page.
Definition: page0types.h:152
Query graph global types.
Choose the rollback segment with the smallest trx_no.
Definition: trx0purge.h:250
const page_size_t set_next()
Sets the next rseg to purge in m_purge_sys.
Definition: trx0purge.cc:110
static const TrxUndoRsegs NullElement
Sentinel value.
Definition: trx0purge.h:276
TrxUndoRsegsIterator(trx_purge_t *purge_sys)
Constructor.
Definition: trx0purge.cc:100
Rsegs_array< 2 >::iterator m_iter
Track the current element in m_trx_undo_rseg.
Definition: trx0purge.h:273
TrxUndoRsegsIterator(const TrxUndoRsegsIterator &)
TrxUndoRsegs m_trx_undo_rsegs
The current element to process.
Definition: trx0purge.h:270
TrxUndoRsegsIterator & operator=(const TrxUndoRsegsIterator &)
trx_purge_t * m_purge_sys
The purge system pointer.
Definition: trx0purge.h:267
File space address.
Definition: fil0fil.h:1513
The info structure stored at the beginning of a heap block.
Definition: mem0mem.h:295
Mini-transaction handle and buffer.
Definition: mtr0mtr.h:174
InnoDB condition variable.
Definition: os0event.cc:63
This is the purge pointer/iterator.
Definition: trx0purge.h:119
purge_iter_t()
Definition: trx0purge.h:120
undo_no_t undo_no
Purge has advanced past all records whose undo number is less than this.
Definition: trx0purge.h:130
trx_id_t modifier_trx_id
The transaction that created the undo log record, the Modifier trx id.
Definition: trx0purge.h:137
space_id_t undo_rseg_space
The last undo record resided in this space id.
Definition: trx0purge.h:133
trx_id_t trx_no
Purge has advanced past all transactions whose number is less than this.
Definition: trx0purge.h:126
Definition: que0que.h:301
The structure used in the spin lock implementation of a read-write lock.
Definition: sync0rw.h:362
Definition: usr0sess.h:54
The control structure used in the purge operation.
Definition: trx0purge.h:141
purge_pq_t * purge_queue
Binary min-heap, ordered on TrxUndoRsegs::trx_no.
Definition: trx0purge.h:230
bool next_stored
true if the info of the next record to purge is stored below: if yes, then the transaction number and...
Definition: trx0purge.h:207
volatile purge_state_t state
Purge coordinator thread states, we check this in several places without holding the latch.
Definition: trx0purge.h:167
ulint offset
Page offset for the next undo record to purge, 0 if the dummy record.
Definition: trx0purge.h:217
purge_iter_t iter
Limit up to which we have read and parsed the UNDO log records.
Definition: trx0purge.h:194
TrxUndoRsegsIterator * rseg_iter
Iterator to get the next rseg to process.
Definition: trx0purge.h:226
std::vector< trx_rseg_t * > rsegs_queue
Set of all rseg queue.
Definition: trx0purge.h:246
Read_view_interface * view
The purge will not remove undo logs which are >= this view (purge view)
Definition: trx0purge.h:173
mem_heap_t * heap
Heap for reading the undo log records.
Definition: trx0purge.h:239
purge_iter_t limit
The 'purge pointer' which advances during a purge, and which is used in history list truncation.
Definition: trx0purge.h:198
static thread_local bool is_this_a_purge_thread
Is the this thread related to purge? This is false by default and set to true by srv_purge_coordinato...
Definition: trx0purge.h:243
purge_iter_t done
Indicate 'purge pointer' which have purged already accurately.
Definition: trx0purge.h:201
trx_id_t m_lowest_needed_trx_no
This is computed as a lower-bound of minimum of:
Definition: trx0purge.h:180
que_t * query
The query graph which will do the parallelized purge operation.
Definition: trx0purge.h:170
trx_t * trx
System transaction running the purge query: this trx is not in the trx list of the trx system and it ...
Definition: trx0purge.h:147
ulint hdr_offset
Header byte offset on the page.
Definition: trx0purge.h:223
ulint n_submitted
Count of total tasks submitted to the task queue.
Definition: trx0purge.h:183
page_no_t page_no
Page number for the next undo record to purge, page number of the log header, if dummy record.
Definition: trx0purge.h:214
page_no_t hdr_page_no
Header page of the undo log where the next record to purge belongs.
Definition: trx0purge.h:220
ulint n_stop
Counter to track number stops.
Definition: trx0purge.h:160
PQMutex pq_mutex
Mutex protecting purge_queue.
Definition: trx0purge.h:233
std::atomic< ulint > n_completed
Count of total tasks completed.
Definition: trx0purge.h:186
sess_t * sess
System session running the purge query.
Definition: trx0purge.h:143
trx_rseg_t * rseg
Rollback segment for the next undo record to purge.
Definition: trx0purge.h:210
undo_truncate::Truncate undo_trunc
Track UNDO tablespace marked for truncate.
Definition: trx0purge.h:236
rw_lock_t latch
The latch protecting the purge view.
Definition: trx0purge.h:153
std::atomic< bool > running
true, if purge is active, we check this without the latch too
Definition: trx0purge.h:163
os_event_t event
State signal event.
Definition: trx0purge.h:157
The rollback segment memory object.
Definition: trx0types.h:214
Definition: trx0trx.h:670
The transaction handle.
Definition: trx0trx.h:630
void trx_purge_add_update_undo_to_history(trx_t *trx, trx_undo_ptr_t *undo_ptr, page_t *undo_page, bool update_rseg_history_len, ulint n_added_logs, mtr_t *mtr)
in: mtr
Definition: trx0purge.cc:370
void trx_purge_sys_initialize(uint32_t n_purge_threads, purge_pq_t *purge_queue)
Creates the global purge system control structure and inits the history mutex.
Definition: trx0purge.cc:287
void trx_purge_sys_close(void)
Frees the global purge system control structure.
Definition: trx0purge.cc:321
purge_state_t
Purge states.
Definition: trx0purge.h:102
@ PURGE_STATE_DISABLED
Purge was never started.
Definition: trx0purge.h:107
@ PURGE_STATE_EXIT
Purge has been shutdown.
Definition: trx0purge.h:106
@ PURGE_STATE_RUN
Purge should be running.
Definition: trx0purge.h:104
@ PURGE_STATE_STOP
Purge should be stopped.
Definition: trx0purge.h:105
@ PURGE_STATE_INIT
Purge instance created.
Definition: trx0purge.h:103
void trx_purge_run()
Resume purge, move to PURGE_STATE_RUN.
Definition: trx0purge.cc:2022
trx_purge_t * purge_sys
The global data structure coordinating a purge.
Definition: trx0purge.cc:79
void trx_purge_sys_mem_create()
Initialize in-memory purge structures.
Definition: trx0purge.cc:217
ulint trx_purge(ulint n_purge_threads, ulint limit, bool truncate)
This function runs a purge batch.
Definition: trx0purge.cc:1862
purge_state_t trx_purge_state(void)
Get the purge state.
Definition: trx0purge.cc:1950
static fil_addr_t trx_purge_get_log_from_hist(fil_addr_t node_addr)
Calculates the file address of an undo log header when we have the file address of its history list n...
void trx_purge_stop(void)
Stop purge and wait for it to stop, move to PURGE_STATE_STOP.
Definition: trx0purge.cc:1963
Transaction system global type definitions.
std::priority_queue< TrxUndoRsegs, std::vector< TrxUndoRsegs, ut::allocator< TrxUndoRsegs > >, TrxUndoRsegs > purge_pq_t
Definition: trx0types.h:631
ib_id_t undo_no_t
Undo number.
Definition: trx0types.h:142
std::array< trx_rseg_t *, N > Rsegs_array
Definition: trx0types.h:550
ib_mutex_t PQMutex
Definition: trx0types.h:173
ib_id_t trx_id_t
Transaction identifier (DB_TRX_ID, DATA_TRX_ID)
Definition: trx0types.h:138
Undo truncation handling.
Version control for database, common definitions, and include files.
unsigned long int ulint
Definition: univ.i:403
constexpr space_id_t SPACE_UNKNOWN
Unknown space id.
Definition: univ.i:452