57
57
extern char* srv_arch_dir;
58
58
#endif /* UNIV_LOG_ARCHIVE */
60
/* store to its own file each table created by an user; data
61
dictionary tables are in the system tablespace 0 */
62
extern my_bool srv_file_per_table;
63
/* The file format to use on new *.ibd files. */
64
extern ulint srv_file_format;
65
/* Whether to check file format during startup.*/
66
extern ulint srv_check_file_format_at_startup;
67
/* Place locks to records only i.e. do not use next-key locking except
68
on duplicate key checking and foreign key checking */
60
extern ibool srv_file_per_table;
69
61
extern ibool srv_locks_unsafe_for_binlog;
71
63
extern ulint srv_n_data_files;
90
82
extern ulint srv_log_buffer_size;
91
83
extern ulong srv_flush_log_at_trx_commit;
93
/* The sort order table of the MySQL latin1_swedish_ci character set
95
extern const byte srv_latin1_ordering[256];
96
extern ulong srv_buf_pool_size; /* requested size in bytes */
97
extern ulong srv_buf_pool_old_size; /* previously requested size */
98
extern ulong srv_buf_pool_curr_size; /* current size in bytes */
99
extern ulint srv_mem_pool_size;
100
extern ulint srv_lock_table_size;
85
extern byte srv_latin1_ordering[256];/* The sort order table of the latin1
87
extern ulint srv_awe_window_size;
102
89
extern ulint srv_n_file_io_threads;
145
132
extern ulong srv_max_buf_pool_modified_pct;
146
133
extern ulong srv_max_purge_lag;
148
extern ulint srv_replication_delay;
134
extern ibool srv_use_awe;
135
extern ibool srv_use_adaptive_hash_indexes;
149
136
/*-------------------------------------------*/
151
138
extern ulint srv_n_rows_inserted;
168
155
extern ulint srv_spin_wait_delay;
169
156
extern ibool srv_priority_boost;
158
extern ulint srv_pool_size;
159
extern ulint srv_mem_pool_size;
160
extern ulint srv_lock_table_size;
173
162
extern ibool srv_print_thread_releases;
174
163
extern ibool srv_print_lock_waits;
175
164
extern ibool srv_print_buf_io;
176
165
extern ibool srv_print_log_io;
177
166
extern ibool srv_print_latch_waits;
178
#else /* UNIV_DEBUG */
179
# define srv_print_thread_releases FALSE
180
# define srv_print_lock_waits FALSE
181
# define srv_print_buf_io FALSE
182
# define srv_print_log_io FALSE
183
# define srv_print_latch_waits FALSE
184
#endif /* UNIV_DEBUG */
186
168
extern ulint srv_activity_count;
187
169
extern ulint srv_fatal_semaphore_wait_threshold;
230
212
doublewrite buffer */
231
213
extern ulint srv_dblwr_pages_written;
233
/* in this variable we store the number of write requests issued */
234
extern ulint srv_buf_pool_write_requests;
236
215
/* here we store the number of times when we had to wait for a free page
237
216
in the buffer pool. It happens when the buffer pool is full and we need
238
217
to make a flush, in order to be able to read or create a page. */
297
276
#define SRV_FORCE_NO_LOG_REDO 6 /* do not do the log roll-forward
298
277
in connection with recovery */
300
/** Types of threads existing in the system. */
301
enum srv_thread_type {
302
SRV_COM = 1, /**< threads serving communication and queries */
303
SRV_CONSOLE, /**< thread serving console */
304
SRV_WORKER, /**< threads serving parallelized queries and
305
queries released from lock wait */
307
/* Utility threads */
308
SRV_BUFFER, /**< thread flushing dirty buffer blocks */
309
SRV_RECOVERY, /**< threads finishing a recovery */
310
SRV_INSERT, /**< thread flushing the insert buffer to disk */
312
SRV_MASTER /**< the master thread, (whose type number must
316
279
/*************************************************************************
317
280
Boots Innobase server. */
322
285
/* out: DB_SUCCESS or error code */
323
286
/*************************************************************************
324
287
Initializes the server. */
329
292
/*************************************************************************
330
293
Frees the OS fast mutex created in srv_boot(). */
335
298
/*************************************************************************
336
299
Initializes the synchronization primitives, memory system, and the thread
337
300
local storage. */
340
303
srv_general_init(void);
341
304
/*==================*/
342
305
/*************************************************************************
343
306
Gets the number of threads in the system. */
346
309
srv_get_n_threads(void);
347
310
/*===================*/
348
311
/*************************************************************************
349
312
Returns the calling thread type. */
352
315
srv_get_thread_type(void);
353
316
/*=====================*/
354
317
/* out: SRV_COM, ... */
355
318
/*************************************************************************
356
319
Sets the info describing an i/o thread current state. */
359
322
srv_set_io_thread_op_info(
360
323
/*======================*/
364
327
/*************************************************************************
365
328
Releases threads of the type given from suspension in the thread table.
366
329
NOTE! The server mutex has to be reserved by the caller! */
369
332
srv_release_threads(
370
333
/*================*/
371
/* out: number of threads
372
released: this may be < n if
373
not enough threads were
374
suspended at the moment */
375
enum srv_thread_type type, /* in: thread type */
376
ulint n); /* in: number of threads to release */
334
/* out: number of threads released: this may be
335
< n if not enough threads were suspended at the
337
ulint type, /* in: thread type */
338
ulint n); /* in: number of threads to release */
377
339
/*************************************************************************
378
340
The master thread controlling the server. */
381
343
srv_master_thread(
382
344
/*==============*/
389
351
in the MySQL interface. Note that there is a small chance that the master
390
352
thread stays suspended (we do not protect our operation with the kernel
391
353
mutex, for performace reasons). */
394
356
srv_active_wake_master_thread(void);
395
357
/*===============================*/
396
358
/***********************************************************************
397
359
Wakes up the master thread if it is suspended or being suspended. */
400
362
srv_wake_master_thread(void);
401
363
/*========================*/
402
364
/*************************************************************************
403
365
Puts an OS thread to wait if there are too many concurrent threads
404
366
(>= srv_thread_concurrency) inside InnoDB. The threads wait in a FIFO queue. */
407
369
srv_conc_enter_innodb(
408
370
/*==================*/
411
373
/*************************************************************************
412
374
This lets a thread enter InnoDB regardless of the number of threads inside
413
375
InnoDB. This must be called when a thread ends a lock wait. */
416
378
srv_conc_force_enter_innodb(
417
379
/*========================*/
420
382
/*************************************************************************
421
383
This must be called when a thread exits InnoDB in a lock wait or at the
422
384
end of an SQL statement. */
425
387
srv_conc_force_exit_innodb(
426
388
/*=======================*/
440
402
!= DB_SUCCESS when we return. DB_LOCK_WAIT_TIMEOUT and DB_DEADLOCK
441
403
are possible errors. DB_DEADLOCK is returned if selective deadlock
442
404
resolution chose this transaction as a victim. */
445
407
srv_suspend_mysql_thread(
446
408
/*=====================*/
449
411
/************************************************************************
450
412
Releases a MySQL OS thread waiting for a lock to be released, if the
451
413
thread is already suspended. */
454
416
srv_release_mysql_thread_if_suspended(
455
417
/*==================================*/
458
420
/*************************************************************************
459
421
A thread which wakes up threads whose lock wait may have lasted too long.
460
422
This also prints the info output by various InnoDB monitors. */
463
425
srv_lock_timeout_and_monitor_thread(
464
426
/*================================*/
468
430
/*************************************************************************
469
431
A thread which prints warnings about semaphore waits which have lasted
470
432
too long. These can be used to track bugs which cause hangs. */
473
435
srv_error_monitor_thread(
474
436
/*=====================*/
490
452
/**********************************************************************
491
453
Function to pass InnoDB status variables to MySQL */
494
456
srv_export_innodb_status(void);
495
457
/*=====================*/
459
/* Types for the threads existing in the system. Threads of types 4 - 9
460
are called utility threads. Note that utility threads are mainly disk
461
bound, except that version threads 6 - 7 may also be CPU bound, if
462
cleaning versions from the buffer pool. */
464
#define SRV_COM 1 /* threads serving communication and queries */
465
#define SRV_CONSOLE 2 /* thread serving console */
466
#define SRV_WORKER 3 /* threads serving parallelized queries and
467
queries released from lock wait */
468
#define SRV_BUFFER 4 /* thread flushing dirty buffer blocks,
469
not currently in use */
470
#define SRV_RECOVERY 5 /* threads finishing a recovery,
471
not currently in use */
472
#define SRV_INSERT 6 /* thread flushing the insert buffer to disk,
473
not currently in use */
474
#define SRV_MASTER 7 /* the master thread, (whose type number must
497
477
/* Thread slot in the thread table */
498
478
typedef struct srv_slot_struct srv_slot_t;
538
518
ulint innodb_pages_written;
539
519
ulint innodb_row_lock_waits;
540
520
ulint innodb_row_lock_current_waits;
541
ib_int64_t innodb_row_lock_time;
521
ib_longlong innodb_row_lock_time;
542
522
ulint innodb_row_lock_time_avg;
543
523
ulint innodb_row_lock_time_max;
544
524
ulint innodb_rows_read;