Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
54f2ca00
Commit
54f2ca00
authored
Nov 27, 2009
by
Paul McCullagh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merged with trunk
parent
d825d44f
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
49 additions
and
15 deletions
+49
-15
storage/pbxt/src/ha_pbxt.cc
storage/pbxt/src/ha_pbxt.cc
+11
-4
storage/pbxt/src/locklist_xt.h
storage/pbxt/src/locklist_xt.h
+7
-2
storage/pbxt/src/myxt_xt.cc
storage/pbxt/src/myxt_xt.cc
+26
-0
storage/pbxt/src/myxt_xt.h
storage/pbxt/src/myxt_xt.h
+2
-0
storage/pbxt/src/restart_xt.cc
storage/pbxt/src/restart_xt.cc
+1
-9
storage/pbxt/src/tabcache_xt.cc
storage/pbxt/src/tabcache_xt.cc
+2
-0
No files found.
storage/pbxt/src/ha_pbxt.cc
View file @
54f2ca00
...
...
@@ -1145,6 +1145,7 @@ static int pbxt_init(void *p)
pbxt_hton
->
panic
=
pbxt_panic
;
/* Panic call */
pbxt_hton
->
show_status
=
pbxt_show_status
;
pbxt_hton
->
flags
=
HTON_NO_FLAGS
;
/* HTON_CAN_RECREATE - Without this flags TRUNCATE uses delete_all_rows() */
pbxt_hton
->
slot
=
(
uint
)
-
1
;
/* assign invald value, so we know when it's inited later */
#if defined(MYSQL_SUPPORTS_BACKUP) && defined(XT_ENABLE_ONLINE_BACKUP)
pbxt_hton
->
get_backup_engine
=
pbxt_backup_engine
;
#endif
...
...
@@ -1227,7 +1228,9 @@ static int pbxt_init(void *p)
* Only real problem, 2 threads try to load the same
* plugin at the same time.
*/
#if MYSQL_VERSION_ID < 60014
myxt_mutex_unlock
(
&
LOCK_plugin
);
#endif
#endif
/* Can't do this here yet, because I need a THD! */
...
...
@@ -1262,7 +1265,9 @@ static int pbxt_init(void *p)
if
(
thd
)
myxt_destroy_thread
(
thd
,
FALSE
);
#ifndef DRIZZLED
#if MYSQL_VERSION_ID < 60014
myxt_mutex_lock
(
&
LOCK_plugin
);
#endif
#endif
}
#endif
...
...
@@ -5817,17 +5822,19 @@ static MYSQL_SYSVAR_INT(max_threads, pbxt_max_threads,
NULL
,
NULL
,
0
,
0
,
20000
,
1
);
#endif
#ifndef DEBUG
static
MYSQL_SYSVAR_BOOL
(
support_xa
,
pbxt_support_xa
,
PLUGIN_VAR_OPCMDARG
,
"Enable PBXT support for the XA two-phase commit, default is enabled"
,
NULL
,
NULL
,
TRUE
);
#else
static
MYSQL_SYSVAR_BOOL
(
support_xa
,
pbxt_support_xa
,
PLUGIN_VAR_OPCMDARG
,
#ifdef DEBUG
"Enable PBXT support for the XA two-phase commit, default is disabled (due to assertion failure in MySQL)"
,
/* The problem is, in MySQL an assertion fails in debug mode:
* Assertion failed: (total_ha_2pc == (ulong) opt_bin_log+1), function ha_recover, file handler.cc, line 1557.
*/
NULL
,
NULL
,
FALSE
);
#else
"Enable PBXT support for the XA two-phase commit, default is enabled"
,
NULL
,
NULL
,
TRUE
);
#endif
static
struct
st_mysql_sys_var
*
pbxt_system_variables
[]
=
{
...
...
storage/pbxt/src/locklist_xt.h
View file @
54f2ca00
...
...
@@ -24,11 +24,16 @@
#ifndef __xt_locklist_h__
#define __xt_locklist_h__
/*
* XT_THREAD_LOCK_INFO and DEBUG_LOCKING code must be updated to avoid calls to xt_get_self() as it can be called before hton->slot is
* assigned by MySQL which is used by xt_get_self()
*/
#ifdef DEBUG
#define XT_THREAD_LOCK_INFO
//
#define XT_THREAD_LOCK_INFO
#ifndef XT_WIN
/* We need DEBUG_LOCKING in order to enable pthread function wrappers */
#define DEBUG_LOCKING
//
#define DEBUG_LOCKING
#endif
#endif
...
...
storage/pbxt/src/myxt_xt.cc
View file @
54f2ca00
...
...
@@ -3364,3 +3364,29 @@ XTDDColumn *XTDDColumnFactory::createFromMySQLField(XTThread *self, TABLE *my_ta
return
col
;
}
/*
* -----------------------------------------------------------------------
* utilities
*/
/*
* MySQL (not sure about Drizzle) first calls hton->init and then assigns the plugin a thread slot
* which is used by xt_get_self(). This is a problem as pbxt_init() starts a number of daemon threads
* which could try to use the slot before it is assigned. This code waits till slot is inited.
* We cannot directly check hton->slot as in some versions of MySQL it can be 0 before init which is a
* valid value.
*/
extern
ulong
total_ha
;
xtPublic
void
myxt_wait_pbxt_plugin_slot_assigned
(
XTThread
*
self
)
{
#ifdef DRIZZLED
static
LEX_STRING
plugin_name
=
{
C_STRING_WITH_LEN
(
"PBXT"
)
};
while
(
!
self
->
t_quit
&&
!
Registry
::
singleton
().
find
(
&
plugin_name
))
xt_sleep_milli_second
(
1
);
#else
while
(
!
self
->
t_quit
&&
(
pbxt_hton
->
slot
>=
total_ha
))
xt_sleep_milli_second
(
1
);
#endif
}
storage/pbxt/src/myxt_xt.h
View file @
54f2ca00
...
...
@@ -95,4 +95,6 @@ class XTDDColumnFactory
static
XTDDColumn
*
createFromMySQLField
(
XTThread
*
self
,
STRUCT_TABLE
*
,
Field
*
);
};
void
myxt_wait_pbxt_plugin_slot_assigned
(
XTThread
*
self
);
#endif
storage/pbxt/src/restart_xt.cc
View file @
54f2ca00
...
...
@@ -3251,15 +3251,7 @@ static void *xn_xres_run_recovery_thread(XTThreadPtr self)
if
(
!
(
mysql_thread
=
(
THD
*
)
myxt_create_thread
()))
xt_throw
(
self
);
#ifdef DRIZZLED
static
LEX_STRING
plugin_name
=
{
C_STRING_WITH_LEN
(
"PBXT"
)
};
while
(
!
xres_recovery_thread
->
t_quit
&&
!
Registry
::
singleton
().
find
(
&
plugin_name
))
xt_sleep_milli_second
(
1
);
#else
while
(
!
xres_recovery_thread
->
t_quit
&&
!
ha_resolve_by_legacy_type
(
mysql_thread
,
DB_TYPE_PBXT
))
xt_sleep_milli_second
(
1
);
#endif
myxt_wait_pbxt_plugin_slot_assigned
(
self
);
if
(
!
xres_recovery_thread
->
t_quit
)
{
try_
(
a
)
{
...
...
storage/pbxt/src/tabcache_xt.cc
View file @
54f2ca00
...
...
@@ -1150,6 +1150,8 @@ static void *tabc_fr_run_thread(XTThreadPtr self)
int
count
;
void
*
mysql_thread
;
myxt_wait_pbxt_plugin_slot_assigned
(
self
);
mysql_thread
=
myxt_create_thread
();
while
(
!
self
->
t_quit
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment