Re: [Maria-developers] [Commits] Rev 2851: MWL#132: Transaction coordinator plugin. in http://bazaar.launchpad.net/~maria-captains/maria/5.1
Hi!
"knielsen" == knielsen <knielsen@knielsen-hq.org> writes:
knielsen> At http://bazaar.launchpad.net/~maria-captains/maria/5.1 knielsen> ------------------------------------------------------------ knielsen> revno: 2851 knielsen> revision-id: knielsen@knielsen-hq.org-20101004104808-asb7wcxoeg417j7d knielsen> parent: knielsen@knielsen-hq.org-20101001084957-02tl9sdzevoaiao7 knielsen> committer: knielsen@knielsen-hq.org knielsen> branch nick: work-5.1-mwl132 knielsen> timestamp: Mon 2010-10-04 12:48:08 +0200 knielsen> message: knielsen> MWL#132: Transaction coordinator plugin. <cut knielsen> +++ b/sql/log.cc 2010-10-04 10:48:08 +0000 knielsen> @@ -6531,6 +6531,39 @@ err1: knielsen> "--tc-heuristic-recover={commit|rollback}"); knielsen> return 1; knielsen> } knielsen> + knielsen> +static TC_LOG * knielsen> +tc_log_mmap_register(void *arg __attribute__((unused)), int yield) knielsen> +{ knielsen> + if (yield || total_ha_2pc <= 1) knielsen> + return NULL; knielsen> + knielsen> + return &tc_log_mmap; knielsen> +} <cut> knielsen> +++ b/sql/mysqld.cc 2010-10-04 10:48:08 +0000 knielsen> @@ -4283,10 +4283,11 @@ a file name for --log-bin-index option", knielsen> } knielsen> #endif knielsen> - tc_log= (total_ha_2pc > 1 ? (opt_bin_log ? knielsen> - (TC_LOG *) &mysql_bin_log : knielsen> - (TC_LOG *) &tc_log_mmap) : knielsen> - (TC_LOG *) &tc_log_dummy); According to the old code, the tc_log_mmap_register() should use: if (yield || total_ha_2pc <= 1 || opt_bin_log) return NULL; Was this an intentional change ? If yes, there should have been a comment about it. Regards, Monty
Michael Widenius <monty@askmonty.org> writes:
knielsen> +++ b/sql/log.cc 2010-10-04 10:48:08 +0000 knielsen> @@ -6531,6 +6531,39 @@ err1: knielsen> "--tc-heuristic-recover={commit|rollback}"); knielsen> return 1; knielsen> } knielsen> + knielsen> +static TC_LOG * knielsen> +tc_log_mmap_register(void *arg __attribute__((unused)), int yield) knielsen> +{ knielsen> + if (yield || total_ha_2pc <= 1) knielsen> + return NULL; knielsen> + knielsen> + return &tc_log_mmap; knielsen> +}
<cut>
knielsen> +++ b/sql/mysqld.cc 2010-10-04 10:48:08 +0000 knielsen> @@ -4283,10 +4283,11 @@ a file name for --log-bin-index option", knielsen> } knielsen> #endif
knielsen> - tc_log= (total_ha_2pc > 1 ? (opt_bin_log ? knielsen> - (TC_LOG *) &mysql_bin_log : knielsen> - (TC_LOG *) &tc_log_mmap) : knielsen> - (TC_LOG *) &tc_log_dummy);
According to the old code, the tc_log_mmap_register() should use:
if (yield || total_ha_2pc <= 1 || opt_bin_log) return NULL;
Was this an intentional change ?
It is not a behavior change. If opt_bin_log is set, then in the first round (yield==true), the mmap plugin will yield, and the binlog plugin will select itself as TC. If opt_bin_log is not set, then binlog plugin will not register as TC and mmap (or dummy) will register themselves as fallback TC in the second round (yield==false). The idea is to generalise the test to handle the case of a custom binlog plugin, in which case a hard-coded check of opt_bin_log is not sufficient.
If yes, there should have been a comment about it.
Thanks for your remarks, I will try to clarify the comments. - Kristian.
participants (2)
-
Kristian Nielsen
-
Michael Widenius