Undocumented purge changes in 5.5
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Percona Server moved to https://jira.percona.com/projects/PS | Status tracked in 5.7 | |||||
5.5 |
Triaged
|
High
|
Unassigned | |||
5.6 |
Invalid
|
Undecided
|
Unassigned | |||
5.7 |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Percona Server 5.5 patches the following:
in trx0purge.c, trx_purge_
// if (!(trx_
/* Inform the purge thread that there is work to do. */
srv_wake_
// }
so it always wakes up the purge thread.
in srv0srv.c, srv_purge_thread(), adds last purge wall-time based throttling:
cur_time = ut_time_ms();
if (next_itr_time > cur_time) {
os_thread_
(next_itr_time - cur_time)
* 1000));
next_itr_time = ut_time_ms() + 1000;
} else {
next_itr_time = cur_time + 1000;
}
The presence of these changes should be justified, and if they are OK, they should be documented.
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 purge_batch_ size.
elsewhere as well?). However, the original condition didn't make sense as well
-- to check if history_len is a perfect multiple of innodb_
I think trx_sys- >rseg_history_ len < srv_purge_ batch_size needs to checked in add_update_ undo_to_ history before waking up the purge thread (unless purge_batch_ size as well.
trx_purge_
purge thread is not woken anywhere else), otherwise this break the definition
of innodb_