~raghavendra-prabhu/percona-xtrabackup/Bug-1182995

« back to all changes in this revision

Viewing changes to src/xtrabackup.cc

  • Committer: Alexey Kopytov
  • Date: 2013-05-16 18:03:01 UTC
  • mfrom: (595.1.1 2.1)
  • Revision ID: akopytov@gmail.com-20130516180301-c23mooyxyglif3wh
MergedĀ lp:~akopytov/percona-xtrabackup/bug1079700-2.1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1813
1813
        return(zip_size);
1814
1814
}
1815
1815
 
 
1816
/**********************************************************************//**
 
1817
Closes a file. */
 
1818
static
 
1819
void
 
1820
xb_fil_node_close_file(
 
1821
/*===================*/
 
1822
        fil_node_t*     node)   /*!< in: file node */
 
1823
{
 
1824
        ibool   ret;
 
1825
 
 
1826
        mutex_enter(&fil_system->mutex);
 
1827
 
 
1828
        ut_ad(node);
 
1829
        ut_a(node->n_pending == 0);
 
1830
        ut_a(node->n_pending_flushes == 0);
 
1831
#if MYSQL_VERSION_ID >= 50600
 
1832
        ut_a(!node->being_extended);
 
1833
#endif
 
1834
 
 
1835
        if (!node->open) {
 
1836
 
 
1837
                mutex_exit(&fil_system->mutex);
 
1838
 
 
1839
                return;
 
1840
        }
 
1841
 
 
1842
        ret = os_file_close(node->handle);
 
1843
        ut_a(ret);
 
1844
 
 
1845
        node->open = FALSE;
 
1846
 
 
1847
        ut_a(fil_system->n_open > 0);
 
1848
        fil_system->n_open--;
 
1849
#if MYSQL_VERSION_ID >= 50600
 
1850
        fil_n_file_opened--;
 
1851
#endif
 
1852
 
 
1853
        if (node->space->purpose == FIL_TABLESPACE &&
 
1854
            !trx_sys_sys_space(node->space->id)) {
 
1855
 
 
1856
                ut_a(UT_LIST_GET_LEN(fil_system->LRU) > 0);
 
1857
 
 
1858
                /* The node is in the LRU list, remove it */
 
1859
                UT_LIST_REMOVE(LRU, fil_system->LRU, node);
 
1860
        }
 
1861
 
 
1862
        mutex_exit(&fil_system->mutex);
 
1863
}
 
1864
 
1816
1865
/* TODO: We may tune the behavior (e.g. by fil_aio)*/
1817
1866
 
1818
1867
static
2497
2546
                    srv_n_write_io_threads,
2498
2547
                    SRV_MAX_N_PENDING_SYNC_IOS);
2499
2548
 
2500
 
        fil_init(srv_file_per_table ? 50000 : 5000,
2501
 
                 srv_max_n_open_files);
 
2549
        fil_init(srv_file_per_table ? 50000 : 5000, LONG_MAX);
2502
2550
 
2503
2551
        fsp_init();
2504
2552
 
2541
2589
                return(DB_ERROR);
2542
2590
        }
2543
2591
 
2544
 
        err = fil_load_single_table_tablespaces(xb_check_if_open_tablespace);
2545
 
        if (err != DB_SUCCESS) {
2546
 
                return(err);
2547
 
        }
2548
 
 
2549
2592
#if MYSQL_VERSION_ID >= 50600
2550
2593
        /* Add separate undo tablespaces to fil_system */
2551
2594
 
2558
2601
        }
2559
2602
#endif
2560
2603
 
 
2604
        /* It is important to call fil_load_single_table_tablespace() after
 
2605
        srv_undo_tablespaces_init(), because fil_is_user_tablespace_id() *
 
2606
        relies on srv_undo_tablespaces_open to be properly initialized */
 
2607
 
 
2608
        err = fil_load_single_table_tablespaces(xb_check_if_open_tablespace);
 
2609
        if (err != DB_SUCCESS) {
 
2610
                return(err);
 
2611
        }
 
2612
 
2561
2613
        return(DB_SUCCESS);
2562
2614
}
2563
2615
 
2851
2903
 
2852
2904
        xb_set_innodb_read_only();
2853
2905
 
 
2906
        srv_backup_mode = TRUE;
 
2907
 
2854
2908
        /* initialize components */
2855
2909
        if(innodb_init_param())
2856
2910
                exit(EXIT_FAILURE);