57
57
extern char* srv_arch_dir;
58
58
#endif /* UNIV_LOG_ARCHIVE */
60
extern ibool srv_file_per_table;
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 */
61
69
extern ibool srv_locks_unsafe_for_binlog;
63
71
extern ulint srv_n_data_files;
82
90
extern ulint srv_log_buffer_size;
83
91
extern ulong srv_flush_log_at_trx_commit;
85
extern byte srv_latin1_ordering[256];/* The sort order table of the latin1
87
extern ulint srv_awe_window_size;
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;
89
102
extern ulint srv_n_file_io_threads;
132
145
extern ulong srv_max_buf_pool_modified_pct;
133
146
extern ulong srv_max_purge_lag;
134
extern ibool srv_use_awe;
135
extern ibool srv_use_adaptive_hash_indexes;
148
extern ulint srv_replication_delay;
136
149
/*-------------------------------------------*/
138
151
extern ulint srv_n_rows_inserted;
155
168
extern ulint srv_spin_wait_delay;
156
169
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;
162
173
extern ibool srv_print_thread_releases;
163
174
extern ibool srv_print_lock_waits;
164
175
extern ibool srv_print_buf_io;
165
176
extern ibool srv_print_log_io;
166
177
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 */
168
186
extern ulint srv_activity_count;
169
187
extern ulint srv_fatal_semaphore_wait_threshold;
212
230
doublewrite buffer */
213
231
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;
215
236
/* here we store the number of times when we had to wait for a free page
216
237
in the buffer pool. It happens when the buffer pool is full and we need
217
238
to make a flush, in order to be able to read or create a page. */
276
297
#define SRV_FORCE_NO_LOG_REDO 6 /* do not do the log roll-forward
277
298
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
279
316
/*************************************************************************
280
317
Boots Innobase server. */
285
322
/* out: DB_SUCCESS or error code */
286
323
/*************************************************************************
287
324
Initializes the server. */
292
329
/*************************************************************************
293
330
Frees the OS fast mutex created in srv_boot(). */
298
335
/*************************************************************************
299
336
Initializes the synchronization primitives, memory system, and the thread
300
337
local storage. */
303
340
srv_general_init(void);
304
341
/*==================*/
305
342
/*************************************************************************
306
343
Gets the number of threads in the system. */
309
346
srv_get_n_threads(void);
310
347
/*===================*/
311
348
/*************************************************************************
312
349
Returns the calling thread type. */
315
352
srv_get_thread_type(void);
316
353
/*=====================*/
317
354
/* out: SRV_COM, ... */
318
355
/*************************************************************************
319
356
Sets the info describing an i/o thread current state. */
322
359
srv_set_io_thread_op_info(
323
360
/*======================*/
327
364
/*************************************************************************
328
365
Releases threads of the type given from suspension in the thread table.
329
366
NOTE! The server mutex has to be reserved by the caller! */
332
369
srv_release_threads(
333
370
/*================*/
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 */
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 */
339
377
/*************************************************************************
340
378
The master thread controlling the server. */
343
381
srv_master_thread(
344
382
/*==============*/
351
389
in the MySQL interface. Note that there is a small chance that the master
352
390
thread stays suspended (we do not protect our operation with the kernel
353
391
mutex, for performace reasons). */
356
394
srv_active_wake_master_thread(void);
357
395
/*===============================*/
358
396
/***********************************************************************
359
397
Wakes up the master thread if it is suspended or being suspended. */
362
400
srv_wake_master_thread(void);
363
401
/*========================*/
364
402
/*************************************************************************
365
403
Puts an OS thread to wait if there are too many concurrent threads
366
404
(>= srv_thread_concurrency) inside InnoDB. The threads wait in a FIFO queue. */
369
407
srv_conc_enter_innodb(
370
408
/*==================*/
373
411
/*************************************************************************
374
412
This lets a thread enter InnoDB regardless of the number of threads inside
375
413
InnoDB. This must be called when a thread ends a lock wait. */
378
416
srv_conc_force_enter_innodb(
379
417
/*========================*/
382
420
/*************************************************************************
383
421
This must be called when a thread exits InnoDB in a lock wait or at the
384
422
end of an SQL statement. */
387
425
srv_conc_force_exit_innodb(
388
426
/*=======================*/
402
440
!= DB_SUCCESS when we return. DB_LOCK_WAIT_TIMEOUT and DB_DEADLOCK
403
441
are possible errors. DB_DEADLOCK is returned if selective deadlock
404
442
resolution chose this transaction as a victim. */
407
445
srv_suspend_mysql_thread(
408
446
/*=====================*/
411
449
/************************************************************************
412
450
Releases a MySQL OS thread waiting for a lock to be released, if the
413
451
thread is already suspended. */
416
454
srv_release_mysql_thread_if_suspended(
417
455
/*==================================*/
420
458
/*************************************************************************
421
459
A thread which wakes up threads whose lock wait may have lasted too long.
422
460
This also prints the info output by various InnoDB monitors. */
425
463
srv_lock_timeout_and_monitor_thread(
426
464
/*================================*/
430
468
/*************************************************************************
431
469
A thread which prints warnings about semaphore waits which have lasted
432
470
too long. These can be used to track bugs which cause hangs. */
435
473
srv_error_monitor_thread(
436
474
/*=====================*/
452
490
/**********************************************************************
453
491
Function to pass InnoDB status variables to MySQL */
456
494
srv_export_innodb_status(void);
457
495
/*=====================*/
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
477
497
/* Thread slot in the thread table */
478
498
typedef struct srv_slot_struct srv_slot_t;
518
538
ulint innodb_pages_written;
519
539
ulint innodb_row_lock_waits;
520
540
ulint innodb_row_lock_current_waits;
521
ib_longlong innodb_row_lock_time;
541
ib_int64_t innodb_row_lock_time;
522
542
ulint innodb_row_lock_time_avg;
523
543
ulint innodb_row_lock_time_max;
524
544
ulint innodb_rows_read;