Merge lp:~vkolesnikov/pbxt/pbxt-bug-489088 into lp:pbxt

Proposed by Vladimir Kolesnikov
Status: Merged
Merged at revision: not available
Proposed branch: lp:~vkolesnikov/pbxt/pbxt-bug-489088
Merge into: lp:pbxt
Diff against target: 61 lines (+27/-1)
2 files modified
ChangeLog (+4/-0)
src/myxt_xt.cc (+23/-1)
To merge this branch: bzr merge lp:~vkolesnikov/pbxt/pbxt-bug-489088
Reviewer Review Type Date Requested Status
PBXT Core Pending
Review via email: mp+15421@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Paul McCullagh (paul-mccullagh) wrote :

Hi Vlad,

Could you please add a release note.

Revision history for this message
Vladimir Kolesnikov (vkolesnikov) wrote :

done!

lp:~vkolesnikov/pbxt/pbxt-bug-489088 updated
744. By Vladimir Kolesnikov

added a release note

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ChangeLog'
2--- ChangeLog 2009-11-25 15:02:05 +0000
3+++ ChangeLog 2009-11-30 14:30:26 +0000
4@@ -1,6 +1,10 @@
5 PBXT Release Notes
6 ==================
7
8+------- 1.0.09g RC3 - not yet released
9+
10+RN290: Fixed bug #489088: On shutdown MySQL reports: [Warning] Plugin 'PBXT' will be forced to shutdown
11+
12 ------- 1.0.09f RC3 - 2009-11-25
13
14 RN290: Fixed bug #345524: pbxt does not compile on 64 bit windows. Currently atomic operations are not supported on this platform.
15
16=== modified file 'src/myxt_xt.cc'
17--- src/myxt_xt.cc 2009-11-27 14:12:44 +0000
18+++ src/myxt_xt.cc 2009-11-30 14:30:26 +0000
19@@ -3093,12 +3093,23 @@
20 return NULL;
21 }
22
23- if (!(new_thd = new THD())) {
24+ if (!(new_thd = new THD)) {
25 my_thread_end();
26 xt_register_error(XT_REG_CONTEXT, XT_ERR_MYSQL_ERROR, 0, "Unable to create MySQL thread (THD)");
27 return NULL;
28 }
29
30+ /*
31+ * If PBXT is the default storage engine, then creating any THD objects will add extra
32+ * references to the PBXT plugin object and will effectively deadlock the plugin so
33+ * that server will have to force plugin shutdown. To avoid deadlocking and forced shutdown
34+ * we must dereference the plugin after creating THD objects.
35+ */
36+ LEX_STRING& plugin_name = (*new_thd->variables.table_plugin)->name;
37+ if ((plugin_name.length == 4) && (strncmp(plugin_name.str, "PBXT", plugin_name.length) == 0)) {
38+ (*new_thd->variables.table_plugin)->ref_count--;
39+ }
40+
41 new_thd->thread_stack = (char *) &new_thd;
42 new_thd->store_globals();
43 lex_start(new_thd);
44@@ -3134,6 +3145,17 @@
45 close_thread_tables(thd);
46 #endif
47
48+ /*
49+ * In myxt_create_thread we decremented plugin ref-count to avoid dead-locking.
50+ * Here we need to increment ref-count to avoid assertion failures.
51+ */
52+ if (thd->variables.table_plugin) {
53+ LEX_STRING& plugin_name = (*thd->variables.table_plugin)->name;
54+ if ((plugin_name.length == 4) && (strncmp(plugin_name.str, "PBXT", plugin_name.length) == 0)) {
55+ (*thd->variables.table_plugin)->ref_count++;
56+ }
57+ }
58+
59 delete thd;
60
61 /* Remember that we don't have a THD */

Subscribers

People subscribed via source and target branches