29 #include "trx0rseg.ic"
41 UNIV_INTERN mysql_pfs_key_t rseg_mutex_key;
70 block =
fseg_create(space, 0, TRX_RSEG + TRX_RSEG_FSEG_HEADER, mtr);
78 buf_block_dbg_add_level(block, SYNC_RSEG_HEADER_NEW);
95 for (i = 0; i < TRX_RSEG_N_SLOTS; i++) {
122 mutex_free(&rseg->
mutex);
136 MONITOR_DEC(MONITOR_NUM_UNDO_SLOT_CACHED);
138 trx_undo_mem_free(undo);
149 MONITOR_DEC(MONITOR_NUM_UNDO_SLOT_CACHED);
151 trx_undo_mem_free(undo);
187 ulint sum_of_undo_sizes;
194 rseg->page_no = page_no;
196 mutex_create(rseg_mutex_key, &rseg->
mutex, SYNC_RSEG);
205 rseg_header + TRX_RSEG_MAX_SIZE,
MLOG_4BYTES, mtr);
212 rseg_header + TRX_RSEG_HISTORY_SIZE,
MLOG_4BYTES, mtr)
213 + 1 + sum_of_undo_sizes;
215 len =
flst_get_len(rseg_header + TRX_RSEG_HISTORY, mtr);
229 rseg->
space, rseg->zip_size, node_addr.
page,
238 rseg_queue.
rseg = rseg;
262 trx_rseg_create_instance(
270 for (i = 0; i < TRX_SYS_N_RSEGS; i++) {
286 rseg = trx_rseg_mem_create(
287 i, space, zip_size, page_no, ib_bh, mtr);
317 if (slot_no != ULINT_UNDEFINED) {
324 space, 0, ULINT_MAX, slot_no, &mtr);
335 rseg = trx_rseg_mem_create(
336 slot_no, space, zip_size, page_no,
358 trx_rseg_create_instance(sys_header, ib_bh, mtr);
377 ulint n_undo_tablespaces = 0;
378 ulint space_ids_aux[TRX_SYS_N_RSEGS + 1];
384 for (i = 0; i < TRX_SYS_N_RSEGS; i++) {
400 for (j = 0; j < n_undo_tablespaces; ++j) {
401 if (space_ids[j] == space) {
408 ut_a(n_undo_tablespaces <= i);
409 space_ids[n_undo_tablespaces++] =
space;
416 ut_a(n_undo_tablespaces <= TRX_SYS_N_RSEGS);
418 space_ids[n_undo_tablespaces] = ULINT_UNDEFINED;
420 if (n_undo_tablespaces > 0) {
421 ut_ulint_sort(space_ids, space_ids_aux, 0, n_undo_tablespaces);
424 return(n_undo_tablespaces);