Commit ea0ae42d authored by Jan Lindström's avatar Jan Lindström Committed by GitHub

Merge pull request #250 from sensssz/10.1-vats

A few fixes for VATS in 10.1
parents 4edd4ad6 74961760
libmariadb @ c8dd0899
Subproject commit c8dd0899d484ad698ec2da5bc8e3d19ff8b623b9
...@@ -1335,6 +1335,20 @@ NUMERIC_BLOCK_SIZE NULL ...@@ -1335,6 +1335,20 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON ENUM_VALUE_LIST OFF,ON
READ_ONLY YES READ_ONLY YES
COMMAND_LINE_ARGUMENT NONE COMMAND_LINE_ARGUMENT NONE
VARIABLE_NAME INNODB_LOCK_SCHEDULE_ALGORITHM
SESSION_VALUE NULL
GLOBAL_VALUE fcfs
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE fcfs
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE ENUM
VARIABLE_COMMENT The algorithm Innodb uses for deciding which locks to grant next when a lock is released. Possible values are FCFS grant the locks in First-Come-First-Served order; VATS use the Variance-Aware-Transaction-Scheduling algorithm, which uses an Eldest-Transaction-First heuristic.
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST fcfs,vats
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME INNODB_LOCK_WAIT_TIMEOUT VARIABLE_NAME INNODB_LOCK_WAIT_TIMEOUT
SESSION_VALUE 50 SESSION_VALUE 50
GLOBAL_VALUE 50 GLOBAL_VALUE 50
......
...@@ -1553,7 +1553,7 @@ thd_is_replication_slave_thread( ...@@ -1553,7 +1553,7 @@ thd_is_replication_slave_thread(
/*============================*/ /*============================*/
THD* thd) /*!< in: thread handle */ THD* thd) /*!< in: thread handle */
{ {
return((ibool) thd_slave_thread(thd)); return thd && ((ibool) thd_slave_thread(thd));
} }
/******************************************************************//** /******************************************************************//**
......
...@@ -44,10 +44,10 @@ extern ibool lock_print_waits; ...@@ -44,10 +44,10 @@ extern ibool lock_print_waits;
#endif /* UNIV_DEBUG */ #endif /* UNIV_DEBUG */
/** Alternatives for innodb_lock_schedule_algorithm, which can be changed by /** Alternatives for innodb_lock_schedule_algorithm, which can be changed by
setting innodb_lock_schedule_algorithm. */ setting innodb_lock_schedule_algorithm. */
enum innodb_lock_schedule_algorithm_t { enum innodb_lock_schedule_algorithm_t {
INNODB_LOCK_SCHEDULE_ALGORITHM_FCFS, /*!< First Come First Served */ INNODB_LOCK_SCHEDULE_ALGORITHM_FCFS, /*!< First Come First Served */
INNODB_LOCK_SCHEDULE_ALGORITHM_VATS /*!< Variance-Aware-Transaction-Scheduling */ INNODB_LOCK_SCHEDULE_ALGORITHM_VATS /*!< Variance-Aware-Transaction-Scheduling */
}; };
extern ulong innodb_lock_schedule_algorithm; extern ulong innodb_lock_schedule_algorithm;
......
...@@ -844,6 +844,8 @@ struct trx_t{ ...@@ -844,6 +844,8 @@ struct trx_t{
time_t start_time; /*!< time the trx state last time became time_t start_time; /*!< time the trx state last time became
TRX_STATE_ACTIVE */ TRX_STATE_ACTIVE */
clock_t start_time_micro; /*!< start time of transaction in
microseconds */
trx_id_t id; /*!< transaction id */ trx_id_t id; /*!< transaction id */
XID xid; /*!< X/Open XA transaction XID xid; /*!< X/Open XA transaction
identification to identify a identification to identify a
......
This diff is collapsed.
...@@ -919,6 +919,8 @@ trx_start_low( ...@@ -919,6 +919,8 @@ trx_start_low(
trx->start_time = ut_time(); trx->start_time = ut_time();
trx->start_time_micro = clock();
MONITOR_INC(MONITOR_TRX_ACTIVE); MONITOR_INC(MONITOR_TRX_ACTIVE);
} }
......
...@@ -1826,7 +1826,7 @@ thd_is_replication_slave_thread( ...@@ -1826,7 +1826,7 @@ thd_is_replication_slave_thread(
/*============================*/ /*============================*/
THD* thd) /*!< in: thread handle */ THD* thd) /*!< in: thread handle */
{ {
return((ibool) thd_slave_thread(thd)); return thd && ((ibool) thd_slave_thread(thd));
} }
/******************************************************************//** /******************************************************************//**
......
...@@ -46,10 +46,10 @@ extern ibool lock_print_waits; ...@@ -46,10 +46,10 @@ extern ibool lock_print_waits;
#endif /* UNIV_DEBUG */ #endif /* UNIV_DEBUG */
/** Alternatives for innodb_lock_schedule_algorithm, which can be changed by /** Alternatives for innodb_lock_schedule_algorithm, which can be changed by
setting innodb_lock_schedule_algorithm. */ setting innodb_lock_schedule_algorithm. */
enum innodb_lock_schedule_algorithm_t { enum innodb_lock_schedule_algorithm_t {
INNODB_LOCK_SCHEDULE_ALGORITHM_FCFS, /*!< First Come First Served */ INNODB_LOCK_SCHEDULE_ALGORITHM_FCFS, /*!< First Come First Served */
INNODB_LOCK_SCHEDULE_ALGORITHM_VATS /*!< Variance-Aware-Transaction-Scheduling */ INNODB_LOCK_SCHEDULE_ALGORITHM_VATS /*!< Variance-Aware-Transaction-Scheduling */
}; };
extern ulong innodb_lock_schedule_algorithm; extern ulong innodb_lock_schedule_algorithm;
......
...@@ -877,6 +877,8 @@ struct trx_t{ ...@@ -877,6 +877,8 @@ struct trx_t{
time_t start_time; /*!< time the trx state last time became time_t start_time; /*!< time the trx state last time became
TRX_STATE_ACTIVE */ TRX_STATE_ACTIVE */
clock_t start_time_micro; /*!< start time of transaction in
microseconds */
trx_id_t id; /*!< transaction id */ trx_id_t id; /*!< transaction id */
XID xid; /*!< X/Open XA transaction XID xid; /*!< X/Open XA transaction
identification to identify a identification to identify a
......
This diff is collapsed.
...@@ -1117,6 +1117,8 @@ trx_start_low( ...@@ -1117,6 +1117,8 @@ trx_start_low(
trx->start_time = ut_time(); trx->start_time = ut_time();
trx->start_time_micro = clock();
MONITOR_INC(MONITOR_TRX_ACTIVE); MONITOR_INC(MONITOR_TRX_ACTIVE);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment