~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Monty Taylor
  • Date: 2010-11-26 22:50:54 UTC
  • mfrom: (1953.1.6 build)
  • Revision ID: mordred@inaugust.com-20101126225054-sg90svw8579t5p3i
Stewart - InnoDB 1.1.1
Monty - Fixed some autoconf tests which were returning false positives.

Show diffs side-by-side

added added

removed removed

Lines of Context:
101
101
/** Whether to check file format during startup.  A value of
102
102
DICT_TF_FORMAT_MAX + 1 means no checking ie. FALSE.  The default is to
103
103
set it to the highest format we support. */
104
 
extern ulint    srv_check_file_format_at_startup;
 
104
extern ulint    srv_max_file_format_at_startup;
105
105
/** Place locks to records only i.e. do not use next-key locking except
106
106
on duplicate key checking and foreign key checking */
107
107
extern ibool    srv_locks_unsafe_for_binlog;
108
108
#endif /* !UNIV_HOTBACKUP */
109
109
 
 
110
/* If this flag is TRUE, then we will use the native aio of the
 
111
OS (provided we compiled Innobase with it in), otherwise we will
 
112
use simulated aio we build below with threads.
 
113
Currently we support native aio on windows and linux */
 
114
extern my_bool  srv_use_native_aio;
110
115
extern ulint    srv_n_data_files;
111
116
extern char**   srv_data_file_names;
112
117
extern ulint*   srv_data_file_sizes;
142
147
# endif /* UNIV_HOTBACKUP */
143
148
#endif /* BUILD_DRIZZLE */
144
149
extern ulint    srv_buf_pool_size;      /*!< requested size in bytes */
 
150
extern ulint    srv_buf_pool_instances; /*!< requested number of buffer pool instances */
145
151
extern ulint    srv_buf_pool_old_size;  /*!< previously requested size */
146
152
extern ulint    srv_buf_pool_curr_size; /*!< current size in bytes */
147
153
extern ulint    srv_mem_pool_size;
269
275
log buffer and have to flush it */
270
276
extern ulint srv_log_waits;
271
277
 
 
278
/* the number of purge threads to use from the worker pool (currently 0 or 1) */
 
279
extern ulong srv_n_purge_threads;
 
280
 
 
281
/* the number of records to purge in one batch */
 
282
extern ulong srv_purge_batch_size;
 
283
 
272
284
/* variable that counts amount of data read in total (in bytes) */
273
285
extern ulint srv_data_read;
274
286
 
310
322
 
311
323
/** The server system */
312
324
extern srv_sys_t*       srv_sys;
 
325
 
 
326
# ifdef UNIV_PFS_THREAD
 
327
/* Keys to register InnoDB threads with performance schema */
 
328
extern mysql_pfs_key_t  trx_rollback_clean_thread_key;
 
329
extern mysql_pfs_key_t  io_handler_thread_key;
 
330
extern mysql_pfs_key_t  srv_lock_timeout_thread_key;
 
331
extern mysql_pfs_key_t  srv_error_monitor_thread_key;
 
332
extern mysql_pfs_key_t  srv_monitor_thread_key;
 
333
extern mysql_pfs_key_t  srv_master_thread_key;
 
334
 
 
335
/* This macro register the current thread and its key with performance
 
336
schema */
 
337
#  define pfs_register_thread(key)                      \
 
338
do {                                                            \
 
339
        if (PSI_server) {                                       \
 
340
                struct PSI_thread* psi = PSI_server->new_thread(key, NULL, 0);\
 
341
                if (psi) {                                      \
 
342
                        PSI_server->set_thread(psi);            \
 
343
                }                                               \
 
344
        }                                                       \
 
345
} while (0)
 
346
 
 
347
/* This macro delist the current thread from performance schema */
 
348
#  define pfs_delete_thread()                           \
 
349
do {                                                            \
 
350
        if (PSI_server) {                                       \
 
351
                PSI_server->delete_current_thread();            \
 
352
        }                                                       \
 
353
} while (0)
 
354
# endif /* UNIV_PFS_THREAD */
 
355
 
313
356
#endif /* !UNIV_HOTBACKUP */
314
357
 
315
358
/** Types of raw partitions in innodb_data_file_path */
450
493
        void*   arg);   /*!< in: a dummy parameter required by
451
494
                        os_thread_create */
452
495
/*******************************************************************//**
 
496
Wakes up the purge thread if it's not already awake. */
 
497
UNIV_INTERN
 
498
void
 
499
srv_wake_purge_thread(void);
 
500
/*=======================*/
 
501
/*******************************************************************//**
453
502
Tells the Innobase server that there has been activity in the database
454
503
and wakes up the master thread if it is suspended (not sleeping). Used
455
504
in the MySQL interface. Note that there is a small chance that the master
465
514
void
466
515
srv_wake_master_thread(void);
467
516
/*========================*/
 
517
/*******************************************************************//**
 
518
Tells the purge thread that there has been activity in the database
 
519
and wakes up the purge thread if it is suspended (not sleeping).  Note
 
520
that there is a small chance that the purge thread stays suspended
 
521
(we do not protect our operation with the kernel mutex, for
 
522
performace reasons). */
 
523
UNIV_INTERN
 
524
void
 
525
srv_wake_purge_thread_if_not_active(void);
 
526
/*=====================================*/
468
527
/*********************************************************************//**
469
528
Puts an OS thread to wait if there are too many concurrent threads
470
529
(>= srv_thread_concurrency) inside InnoDB. The threads wait in a FIFO queue. */
571
630
srv_export_innodb_status(void);
572
631
/*==========================*/
573
632
 
574
 
/** Thread slot in the thread table */
575
 
typedef struct srv_slot_struct  srv_slot_t;
576
 
 
577
 
/** Thread table is an array of slots */
578
 
typedef srv_slot_t      srv_table_t;
 
633
/******************************************************************//**
 
634
Increment the server activity counter. */
 
635
UNIV_INTERN
 
636
void
 
637
srv_inc_activity_count(void);
 
638
/*=========================*/
 
639
 
 
640
/*********************************************************************//**
 
641
Asynchronous purge thread.
 
642
@return a dummy parameter */
 
643
UNIV_INTERN
 
644
os_thread_ret_t
 
645
srv_purge_thread(
 
646
/*=============*/
 
647
        void*   arg __attribute__((unused))); /*!< in: a dummy parameter
 
648
                                              required by os_thread_create */
 
649
 
 
650
/**********************************************************************//**
 
651
Enqueues a task to server task queue and releases a worker thread, if there
 
652
is a suspended one. */
 
653
UNIV_INTERN
 
654
void
 
655
srv_que_task_enqueue_low(
 
656
/*=====================*/
 
657
        que_thr_t*      thr);   /*!< in: query thread */
 
658
 
 
659
/**********************************************************************//**
 
660
Check whether any background thread is active.
 
661
@return FALSE if all are are suspended or have exited. */
 
662
UNIV_INTERN
 
663
ibool
 
664
srv_is_any_background_thread_active(void);
 
665
/*======================================*/
579
666
 
580
667
/** Status variables to be passed to MySQL */
581
668
struct export_var_struct{
631
718
        ulint innodb_rows_deleted;              /*!< srv_n_rows_deleted */
632
719
};
633
720
 
 
721
/** Thread slot in the thread table */
 
722
typedef struct srv_slot_struct  srv_slot_t;
 
723
  
 
724
/** Thread table is an array of slots */
 
725
typedef srv_slot_t      srv_table_t;
 
726
 
634
727
/** The server system struct */
635
728
struct srv_sys_struct{
636
729
        srv_table_t*    threads;        /*!< server thread table */
639
732
};
640
733
 
641
734
extern ulint    srv_n_threads_active[];
642
 
 
643
735
#else /* !UNIV_HOTBACKUP */
 
736
# define srv_use_adaptive_hash_indexes          FALSE
644
737
# define srv_use_checksums                      TRUE
645
 
# define srv_use_adaptive_hash_indexes          FALSE
 
738
# define srv_use_native_aio                     FALSE
646
739
# define srv_force_recovery                     0UL
647
740
# define srv_set_io_thread_op_info(t,info)      ((void) 0)
648
741
# define srv_is_being_started                   0