~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/innobase/include/srv0srv.h

Renamed strings to mystrings, for include/lib naming consistency.

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
extern char*    srv_arch_dir;
58
58
#endif /* UNIV_LOG_ARCHIVE */
59
59
 
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;
70
62
 
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;
92
84
 
93
 
/* The sort order table of the MySQL latin1_swedish_ci character set
94
 
collation */
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
 
86
                                        character set */
 
87
extern ulint    srv_awe_window_size;
101
88
 
102
89
extern ulint    srv_n_file_io_threads;
103
90
 
144
131
 
145
132
extern ulong    srv_max_buf_pool_modified_pct;
146
133
extern ulong    srv_max_purge_lag;
147
 
 
148
 
extern ulint    srv_replication_delay;
 
134
extern ibool    srv_use_awe;
 
135
extern ibool    srv_use_adaptive_hash_indexes;
149
136
/*-------------------------------------------*/
150
137
 
151
138
extern ulint    srv_n_rows_inserted;
168
155
extern ulint    srv_spin_wait_delay;
169
156
extern ibool    srv_priority_boost;
170
157
 
 
158
extern  ulint   srv_pool_size;
 
159
extern  ulint   srv_mem_pool_size;
 
160
extern  ulint   srv_lock_table_size;
171
161
 
172
 
#ifdef UNIV_DEBUG
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 */
185
167
 
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;
232
214
 
233
 
/* in this variable we store the number of write requests issued */
234
 
extern ulint srv_buf_pool_write_requests;
235
 
 
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 */
299
278
 
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 */
306
 
#if 0
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 */
311
 
#endif
312
 
        SRV_MASTER      /**< the master thread, (whose type number must
313
 
                        be biggest) */
314
 
};
315
 
 
316
279
/*************************************************************************
317
280
Boots Innobase server. */
318
 
UNIV_INTERN
 
281
 
319
282
ulint
320
283
srv_boot(void);
321
284
/*==========*/
322
285
                        /* out: DB_SUCCESS or error code */
323
286
/*************************************************************************
324
287
Initializes the server. */
325
 
UNIV_INTERN
 
288
 
326
289
void
327
290
srv_init(void);
328
291
/*==========*/
329
292
/*************************************************************************
330
293
Frees the OS fast mutex created in srv_boot(). */
331
 
UNIV_INTERN
 
294
 
332
295
void
333
296
srv_free(void);
334
297
/*==========*/
335
298
/*************************************************************************
336
299
Initializes the synchronization primitives, memory system, and the thread
337
300
local storage. */
338
 
UNIV_INTERN
 
301
 
339
302
void
340
303
srv_general_init(void);
341
304
/*==================*/
342
305
/*************************************************************************
343
306
Gets the number of threads in the system. */
344
 
UNIV_INTERN
 
307
 
345
308
ulint
346
309
srv_get_n_threads(void);
347
310
/*===================*/
348
311
/*************************************************************************
349
312
Returns the calling thread type. */
350
313
 
351
 
enum srv_thread_type
 
314
ulint
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. */
357
 
UNIV_INTERN
 
320
 
358
321
void
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! */
367
 
UNIV_INTERN
 
330
 
368
331
ulint
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
 
336
                        moment */
 
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. */
379
 
UNIV_INTERN
 
341
 
380
342
os_thread_ret_t
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). */
392
 
UNIV_INTERN
 
354
 
393
355
void
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. */
398
 
UNIV_INTERN
 
360
 
399
361
void
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. */
405
 
UNIV_INTERN
 
367
 
406
368
void
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. */
414
 
UNIV_INTERN
 
376
 
415
377
void
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. */
423
 
UNIV_INTERN
 
385
 
424
386
void
425
387
srv_conc_force_exit_innodb(
426
388
/*=======================*/
428
390
                        thread */
429
391
/*************************************************************************
430
392
This must be called when a thread exits InnoDB. */
431
 
UNIV_INTERN
 
393
 
432
394
void
433
395
srv_conc_exit_innodb(
434
396
/*=================*/
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. */
443
 
UNIV_INTERN
 
405
 
444
406
void
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. */
452
 
UNIV_INTERN
 
414
 
453
415
void
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. */
461
 
UNIV_INTERN
 
423
 
462
424
os_thread_ret_t
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. */
471
 
UNIV_INTERN
 
433
 
472
434
os_thread_ret_t
473
435
srv_error_monitor_thread(
474
436
/*=====================*/
477
439
                        os_thread_create */
478
440
/**********************************************************************
479
441
Outputs to a file the output of the InnoDB Monitor. */
480
 
UNIV_INTERN
 
442
 
481
443
void
482
444
srv_printf_innodb_monitor(
483
445
/*======================*/
489
451
 
490
452
/**********************************************************************
491
453
Function to pass InnoDB status variables to MySQL */
492
 
UNIV_INTERN
 
454
 
493
455
void
494
456
srv_export_innodb_status(void);
495
457
/*=====================*/
496
458
 
 
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. */
 
463
 
 
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
 
475
                                be biggest) */
 
476
 
497
477
/* Thread slot in the thread table */
498
478
typedef struct srv_slot_struct  srv_slot_t;
499
479
 
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;