1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Upgrade TL_WRITE_CONCURRENT_INSERT to TL_WRITE_LOW_PRIORITY if

--low-priority-updates is used and the file has holes.


Docs/manual.texi:
  Changelog
sql/sql_insert.cc:
  Fixed that sleeptime is 0 for new insert delayed threads.
This commit is contained in:
unknown
2001-07-18 23:34:04 +03:00
parent 2cbf3b9b53
commit 0e66a78a4d
5 changed files with 11 additions and 5 deletions

View File

@ -24702,7 +24702,7 @@ The meanings of the configuration parameters are the following:
@multitable @columnfractions .30 .70 @multitable @columnfractions .30 .70
@item @code{innodb_data_home_dir} @tab @item @code{innodb_data_home_dir} @tab
The common part of the directory path for all innobase data files. The common part of the directory path for all InnoDB data files.
@item @code{innodb_data_file_path} @tab @item @code{innodb_data_file_path} @tab
Paths to individual data files and their sizes. The full directory path Paths to individual data files and their sizes. The full directory path
to each data file is acquired by concatenating innodb_data_home_dir to to each data file is acquired by concatenating innodb_data_home_dir to
@ -45728,6 +45728,8 @@ not yet 100% confident in this code.
@appendixsubsec Changes in release 3.23.40 @appendixsubsec Changes in release 3.23.40
@itemize @bullet @itemize @bullet
@item @item
Fixed problem with @code{--low-priority-updates} and @code{INSERT}'s.
@item
Added @code{slave_wait_timeout} for replication. Added @code{slave_wait_timeout} for replication.
@item @item
Fixed problem with @code{UPDATE} and BDB tables. Fixed problem with @code{UPDATE} and BDB tables.

View File

@ -65,6 +65,7 @@ enum thr_lock_type { TL_IGNORE=-1,
extern ulong max_write_lock_count; extern ulong max_write_lock_count;
extern my_bool thr_lock_inited; extern my_bool thr_lock_inited;
extern enum thr_lock_type thr_upgraded_concurrent_insert_lock;
typedef struct st_thr_lock_data { typedef struct st_thr_lock_data {
pthread_t thread; pthread_t thread;

View File

@ -85,6 +85,7 @@ multiple read locks.
my_bool thr_lock_inited=0; my_bool thr_lock_inited=0;
ulong locks_immediate = 0L, locks_waited = 0L; ulong locks_immediate = 0L, locks_waited = 0L;
enum thr_lock_type thr_upgraded_concurrent_insert_lock = TL_WRITE;
/* The following constants are only for debug output */ /* The following constants are only for debug output */
#define MAX_THREADS 100 #define MAX_THREADS 100
@ -514,7 +515,7 @@ int thr_lock(THR_LOCK_DATA *data,enum thr_lock_type lock_type)
} }
} }
else if (lock_type == TL_WRITE_CONCURRENT_INSERT && ! lock->check_status) else if (lock_type == TL_WRITE_CONCURRENT_INSERT && ! lock->check_status)
data->type=lock_type= TL_WRITE; /* not supported */ data->type=lock_type= thr_upgraded_concurrent_insert_lock;
if (lock->write.data) /* If there is a write lock */ if (lock->write.data) /* If there is a write lock */
{ {
@ -556,7 +557,7 @@ int thr_lock(THR_LOCK_DATA *data,enum thr_lock_type lock_type)
{ /* no scheduled write locks */ { /* no scheduled write locks */
if (lock_type == TL_WRITE_CONCURRENT_INSERT && if (lock_type == TL_WRITE_CONCURRENT_INSERT &&
(*lock->check_status)(data->status_param)) (*lock->check_status)(data->status_param))
data->type=lock_type=TL_WRITE; /* Upgrade lock */ data->type=lock_type= thr_upgraded_concurrent_insert_lock;
if (!lock->read.data || if (!lock->read.data ||
(lock_type <= TL_WRITE_DELAYED && (lock_type <= TL_WRITE_DELAYED &&
@ -943,10 +944,10 @@ my_bool thr_upgrade_write_delay_lock(THR_LOCK_DATA *data)
DBUG_ENTER("thr_upgrade_write_delay_lock"); DBUG_ENTER("thr_upgrade_write_delay_lock");
pthread_mutex_lock(&lock->mutex); pthread_mutex_lock(&lock->mutex);
if (data->type == TL_UNLOCK || data->type == TL_WRITE) /* Aborted */ if (data->type == TL_UNLOCK || data->type >= TL_WRITE_LOW_PRIORITY)
{ {
pthread_mutex_unlock(&lock->mutex); pthread_mutex_unlock(&lock->mutex);
DBUG_RETURN(data->type == TL_UNLOCK); DBUG_RETURN(data->type == TL_UNLOCK); /* Test if Aborted */
} }
check_locks(lock,"before upgrading lock",0); check_locks(lock,"before upgrading lock",0);
/* TODO: Upgrade to TL_WRITE_CONCURRENT_INSERT in some cases */ /* TODO: Upgrade to TL_WRITE_CONCURRENT_INSERT in some cases */

View File

@ -3563,6 +3563,7 @@ static void get_options(int argc,char **argv)
break; break;
case OPT_LOW_PRIORITY_UPDATES: case OPT_LOW_PRIORITY_UPDATES:
thd_startup_options|=OPTION_LOW_PRIORITY_UPDATES; thd_startup_options|=OPTION_LOW_PRIORITY_UPDATES;
thr_upgraded_concurrent_insert_lock= TL_WRITE_LOW_PRIORITY;
low_priority_updates=1; low_priority_updates=1;
break; break;
case OPT_BOOTSTRAP: case OPT_BOOTSTRAP:

View File

@ -871,6 +871,7 @@ static pthread_handler_decl(handle_delayed_insert,arg)
/* Add thread to THD list so that's it's visible in 'show processlist' */ /* Add thread to THD list so that's it's visible in 'show processlist' */
pthread_mutex_lock(&LOCK_thread_count); pthread_mutex_lock(&LOCK_thread_count);
thd->thread_id=thread_id++; thd->thread_id=thread_id++;
thd->end_time();
threads.append(thd); threads.append(thd);
pthread_mutex_unlock(&LOCK_thread_count); pthread_mutex_unlock(&LOCK_thread_count);