~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/srv/srv0start.c

  • Committer: Brian Aker
  • Date: 2010-12-18 00:43:02 UTC
  • Revision ID: brian@tangent.org-20101218004302-4ivzuuzdkblyqe18
Refactor naming for integers.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1159
1159
 
1160
1160
                srv_use_native_aio = FALSE;
1161
1161
                break;
 
1162
 
 
1163
        case OS_WIN2000:
 
1164
        case OS_WINXP:
 
1165
                /* On 2000 and XP, async IO is available. */
 
1166
                srv_use_native_aio = TRUE;
 
1167
                break;
 
1168
 
1162
1169
        default:
1163
 
                /* On Win 2000 and XP use async i/o */
 
1170
                /* Vista and later have both async IO and condition variables */
1164
1171
                srv_use_native_aio = TRUE;
 
1172
                srv_use_native_conditions = TRUE;
1165
1173
                break;
1166
1174
        }
1167
1175
 
1230
1238
        maximum number of threads that can wait in the 'srv_conc array' for
1231
1239
        their time to enter InnoDB. */
1232
1240
 
1233
 
#if defined(__NETWARE__)
1234
 
 
1235
 
        /* Create less event semaphores because Win 98/ME had
1236
 
        difficulty creating 40000 event semaphores.  Comment from
1237
 
        Novell, Inc.: also, these just take a lot of memory on
1238
 
        NetWare. */
1239
 
        srv_max_n_threads = 1000;
1240
 
#else
1241
1241
        if (srv_buf_pool_size >= 1000 * 1024 * 1024) {
1242
1242
                /* If buffer pool is less than 1000 MB,
1243
1243
                assume fewer threads. Also use only one
1254
1254
                                                especially in 64-bit
1255
1255
                                                computers */
1256
1256
        }
1257
 
#endif
 
1257
 
1258
1258
        err = srv_boot();
1259
1259
 
1260
1260
        if (err != DB_SUCCESS) {
1327
1327
        fil_init(srv_file_per_table ? 50000 : 5000,
1328
1328
                 srv_max_n_open_files);
1329
1329
 
 
1330
        /* Print time to initialize the buffer pool */
 
1331
        ut_print_timestamp(stderr);
 
1332
        fprintf(stderr,
 
1333
                "  InnoDB: Initializing buffer pool, size =");
 
1334
 
 
1335
        if (srv_buf_pool_size >= 1024 * 1024 * 1024) {
 
1336
                fprintf(stderr,
 
1337
                        " %.1fG\n",
 
1338
                        ((double) srv_buf_pool_size) / (1024 * 1024 * 1024));
 
1339
        } else {
 
1340
                fprintf(stderr,
 
1341
                        " %.1fM\n",
 
1342
                        ((double) srv_buf_pool_size) / (1024 * 1024));
 
1343
        }
 
1344
 
1330
1345
        err = buf_pool_init(srv_buf_pool_size, srv_buf_pool_instances);
1331
1346
 
 
1347
        ut_print_timestamp(stderr);
 
1348
        fprintf(stderr,
 
1349
                "  InnoDB: Completed initialization of buffer pool\n");
 
1350
 
1332
1351
        if (err != DB_SUCCESS) {
1333
1352
                fprintf(stderr,
1334
1353
                        "InnoDB: Fatal error: cannot allocate the memory"
1696
1715
        /* fprintf(stderr, "Max allowed record size %lu\n",
1697
1716
        page_get_free_space_of_empty() / 2); */
1698
1717
 
 
1718
        if (trx_doublewrite == NULL) {
 
1719
                /* Create the doublewrite buffer to a new tablespace */
 
1720
 
 
1721
                trx_sys_create_doublewrite_buf();
 
1722
        }
 
1723
 
 
1724
        /* Here the double write buffer has already been created and so
 
1725
        any new rollback segments will be allocated after the double
 
1726
        write buffer. The default segment should already exist.
 
1727
        We create the new segments only if it's a new database or
 
1728
        the database was shutdown cleanly. */
 
1729
 
 
1730
        /* Note: When creating the extra rollback segments during an upgrade
 
1731
        we violate the latching order, even if the change buffer is empty.
 
1732
        We make an exception in sync0sync.c and check srv_is_being_started
 
1733
        for that violation. It cannot create a deadlock because we are still
 
1734
        running in single threaded mode essentially. Only the IO threads
 
1735
        should be running at this stage. */
 
1736
 
 
1737
        trx_sys_create_rsegs(TRX_SYS_N_RSEGS - 1);
 
1738
 
1699
1739
        /* Create the thread which watches the timeouts for lock waits */
1700
1740
        os_thread_create(&srv_lock_timeout_thread, NULL,
1701
1741
                         thread_ids + 2 + SRV_MAX_N_IO_THREADS);
1710
1750
 
1711
1751
        srv_is_being_started = FALSE;
1712
1752
 
1713
 
        if (trx_doublewrite == NULL) {
1714
 
                /* Create the doublewrite buffer to a new tablespace */
1715
 
 
1716
 
                trx_sys_create_doublewrite_buf();
1717
 
        }
1718
 
 
1719
 
        /* Here the double write buffer has already been created and so
1720
 
        any new rollback segments will be allocated after the double
1721
 
        write buffer. The default segment should already exist.
1722
 
        We create the new segments only if it's a new database or
1723
 
        the database was shutdown cleanly. */
1724
 
 
1725
 
        trx_sys_create_rsegs(TRX_SYS_N_RSEGS - 1);
1726
 
 
1727
1753
        err = dict_create_or_check_foreign_constraint_tables();
1728
1754
 
1729
1755
        if (err != DB_SUCCESS) {
1838
1864
        if (srv_print_verbose_log) {
1839
1865
                ut_print_timestamp(stderr);
1840
1866
                fprintf(stderr,
1841
 
                        " InnoDB %s started; "
 
1867
                        "  InnoDB %s started; "
1842
1868
                        "log sequence number %"PRIu64"\n",
1843
1869
                        INNODB_VERSION_STR, srv_start_lsn);
1844
1870
        }
1925
1951
/*=============================*/
1926
1952
{
1927
1953
        ulint   i;
1928
 
#ifdef __NETWARE__
1929
 
        extern ibool panic_shutdown;
1930
 
#endif
1931
1954
        if (!srv_was_started) {
1932
1955
                if (srv_is_being_started) {
1933
1956
                        ut_print_timestamp(stderr);
1956
1979
                        "InnoDB will do a crash recovery!\n");
1957
1980
        }
1958
1981
 
1959
 
#ifdef __NETWARE__
1960
 
        if (!panic_shutdown)
1961
 
#endif
1962
 
                logs_empty_and_mark_files_at_shutdown();
 
1982
        logs_empty_and_mark_files_at_shutdown();
1963
1983
 
1964
1984
        if (srv_conc_n_threads != 0) {
1965
1985
                fprintf(stderr,
2126
2146
 
2127
2147
        return((int) DB_SUCCESS);
2128
2148
}
2129
 
 
2130
 
#ifdef __NETWARE__
2131
 
void set_panic_flag_for_netware()
2132
 
{
2133
 
        extern ibool panic_shutdown;
2134
 
        panic_shutdown = TRUE;
2135
 
}
2136
 
#endif /* __NETWARE__ */
2137
2149
#endif /* !UNIV_HOTBACKUP */