mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
MDEV-20220: Merge 5.7 P_S replication table 'replication_applier_status_by_worker
Step 3: ====== Preserve worker pool information on either STOP SLAVE/Error. In case STOP SLAVE is executed worker threads will be gone, hence worker threads will be unavailable. Querying the table at this stage will give empty rows. To address this case when worker threads are about to stop, due to an error or forced stop, create a backup pool and preserve the data which is relevant to populate performance schema table. Clear the backup pool upon slave start.
This commit is contained in:
@ -7,6 +7,7 @@
|
||||
struct rpl_parallel;
|
||||
struct rpl_parallel_entry;
|
||||
struct rpl_parallel_thread_pool;
|
||||
extern struct rpl_parallel_thread_pool pool_bkp_for_pfs;
|
||||
|
||||
class Relay_log_info;
|
||||
struct inuse_relaylog;
|
||||
@ -257,6 +258,38 @@ struct rpl_parallel_thread {
|
||||
};
|
||||
|
||||
|
||||
struct pool_bkp_for_pfs{
|
||||
uint32 count;
|
||||
bool inited;
|
||||
struct rpl_parallel_thread **rpl_thread_arr;
|
||||
void init(uint32 thd_count)
|
||||
{
|
||||
DBUG_ASSERT(thd_count);
|
||||
rpl_thread_arr= (rpl_parallel_thread **)
|
||||
my_malloc(PSI_INSTRUMENT_ME,
|
||||
thd_count * sizeof(rpl_parallel_thread*),
|
||||
MYF(MY_WME | MY_ZEROFILL));
|
||||
for (uint i=0; i<thd_count; i++)
|
||||
rpl_thread_arr[i]= (rpl_parallel_thread *)
|
||||
my_malloc(PSI_INSTRUMENT_ME, sizeof(rpl_parallel_thread),
|
||||
MYF(MY_WME | MY_ZEROFILL));
|
||||
count= thd_count;
|
||||
inited= true;
|
||||
}
|
||||
|
||||
void destroy()
|
||||
{
|
||||
if (inited)
|
||||
{
|
||||
for (uint i=0; i<count; i++)
|
||||
my_free(rpl_thread_arr[i]);
|
||||
|
||||
my_free(rpl_thread_arr);
|
||||
rpl_thread_arr= NULL;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
struct rpl_parallel_thread_pool {
|
||||
struct rpl_parallel_thread **threads;
|
||||
struct rpl_parallel_thread *free_list;
|
||||
@ -270,8 +303,10 @@ struct rpl_parallel_thread_pool {
|
||||
is in progress.
|
||||
*/
|
||||
bool busy;
|
||||
struct pool_bkp_for_pfs pfs_bkp;
|
||||
|
||||
rpl_parallel_thread_pool();
|
||||
void copy_pool_for_pfs(Relay_log_info *rli);
|
||||
int init(uint32 size);
|
||||
void destroy();
|
||||
void deactivate();
|
||||
|
Reference in New Issue
Block a user