Comment 1 for bug 1058100

Revision history for this message
Raghavendra D Prabhu (raghavendra-prabhu) wrote :

That patch was added in 234.1.13 as part of import innodb_io_patches into the tree.

The original code is from 0.15941.195

Now, the wall-time code referred to in the description was also added in as part of 234.1.13

234.1.13 stewart |
                      | cur_time = ut_time_ms();
                      | if (next_itr_time > cur_time) {
                      | os_thread_sleep(ut_min(1000000,
                      | (next_itr_time - cur_time)
                      | * 1000));
                      | next_itr_time = ut_time_ms() + 1000;
                      | } else {
                      | next_itr_time = cur_time + 1000;
                      | }

The thread was suspended for --

  if (trx_sys->rseg_history_len < srv_purge_batch_size
      || (n_total_purged == 0
   && retries >= TRX_SYS_N_RSEGS)) {

It is being woken up unconditionally (does the purge thread get woken up
elsewhere as well?). However, the original condition didn't make sense as well
-- to check if history_len is a perfect multiple of innodb_purge_batch_size.

I think trx_sys->rseg_history_len < srv_purge_batch_size needs to checked in
trx_purge_add_update_undo_to_history before waking up the purge thread (unless
purge thread is not woken anywhere else), otherwise this break the definition
of innodb_purge_batch_size as well.