diff options
author | Sergei Golubchik <serg@mariadb.org> | 2015-01-31 21:48:47 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2015-01-31 21:48:47 +0100 |
commit | 4b21cd21fef2763d757aa15681c9c9a7ed5db3c9 (patch) | |
tree | e9e233392b47f93de12cecce1f7f403ce26057b0 /sql/rpl_parallel.h | |
parent | 0b049b40124d72d77c008d4441e4db2e77f0f127 (diff) | |
parent | a06624d61f36c70edd63adcfe2803bb7a8564de5 (diff) | |
download | mariadb-git-4b21cd21fef2763d757aa15681c9c9a7ed5db3c9.tar.gz |
Merge branch '10.0' into merge-wip
Diffstat (limited to 'sql/rpl_parallel.h')
-rw-r--r-- | sql/rpl_parallel.h | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/sql/rpl_parallel.h b/sql/rpl_parallel.h index 2062c89e62e..f1145d4cc4e 100644 --- a/sql/rpl_parallel.h +++ b/sql/rpl_parallel.h @@ -39,9 +39,12 @@ struct inuse_relaylog; rpl_parallel_entry::count_committing_event_groups has reached gco->next_gco->wait_count. - - When gco->wait_count is reached for a worker and the wait completes, - the worker frees gco->prev_gco; at this point it is guaranteed not to - be needed any longer. + - The gco lives until all its event groups have completed their commit. + This is detected by rpl_parallel_entry::last_committed_sub_id being + greater than or equal gco->last_sub_id. Once this happens, the gco is + freed. Note that since update of last_committed_sub_id can happen + out-of-order, the thread that frees a given gco can be for any later + event group, not necessarily an event group from the gco being freed. */ struct group_commit_orderer { /* Wakeup condition, used with rpl_parallel_entry::LOCK_parallel_entry. */ @@ -50,6 +53,16 @@ struct group_commit_orderer { group_commit_orderer *prev_gco; group_commit_orderer *next_gco; /* + The sub_id of last event group in this the previous GCO. + Only valid if prev_gco != NULL. + */ + uint64 prior_sub_id; + /* + The sub_id of the last event group in this GCO. Only valid when next_gco + is non-NULL. + */ + uint64 last_sub_id; + /* This flag is set when this GCO has been installed into the next_gco pointer of the previous GCO. */ @@ -190,7 +203,8 @@ struct rpl_parallel_thread { LOCK_rpl_thread mutex. */ void free_rgi(rpl_group_info *rgi); - group_commit_orderer *get_gco(uint64 wait_count, group_commit_orderer *prev); + group_commit_orderer *get_gco(uint64 wait_count, group_commit_orderer *prev, + uint64 first_sub_id); /* Put a gco on the local free list, to be later released to the global free list by batch_free(). |