~percona-dev/percona-xtrabackup/55_on_freebsd

« back to all changes in this revision

Viewing changes to fix_innodb_for_backup51.patch

  • Committer: kinoyasu
  • Date: 2010-10-20 10:18:21 UTC
  • Revision ID: kinoyasu@gauntlet4-20101020101821-q94pmvnuxsv8y2ga
--apply-log-only option for all versions

Show diffs side-by-side

added added

removed removed

Lines of Context:
513
513
 extern ulint   srv_pool_size;
514
514
 extern ulint   srv_awe_window_size;
515
515
 extern ulint   srv_mem_pool_size;
516
 
@@ -133,6 +136,9 @@
 
516
@@ -133,6 +136,10 @@
517
517
 extern ulong   srv_max_purge_lag;
518
518
 extern ibool   srv_use_awe;
519
519
 extern ibool   srv_use_adaptive_hash_indexes;
520
520
+
521
521
+extern ibool   srv_read_only;
522
522
+extern ibool   srv_fake_write;
 
523
+extern ibool   srv_apply_log_only;
523
524
 /*-------------------------------------------*/
524
525
 
525
526
 extern ulint   srv_n_rows_inserted;
617
618
                /* Recovery is running and no operations on the log files are
618
619
                allowed yet (the variable name .._no_ibuf_.. is misleading) */
619
620
 
 
621
@@ -3056,6 +3058,7 @@
 
622
        for the 'very fast' shutdown, because the InnoDB layer may have
 
623
        committed or prepared transactions and we don't want to lose them. */
 
624
 
 
625
+       if (!srv_apply_log_only) {
 
626
        if (trx_n_mysql_transactions > 0
 
627
            || UT_LIST_GET_LEN(trx_sys->trx_list) > 0) {
 
628
 
 
629
@@ -3063,6 +3066,7 @@
 
630
 
 
631
                goto loop;
 
632
        }
 
633
+       }
 
634
 
 
635
        if (srv_fast_shutdown == 2) {
 
636
                /* In this fastest shutdown we do not flush the buffer pool:
620
637
diff -ru mysql-5.1.50_orig/storage/innobase/log/log0recv.c mysql-5.1.50/storage/innobase/log/log0recv.c
621
638
--- mysql-5.1.50_orig/storage/innobase/log/log0recv.c   2010-08-04 02:24:20.000000000 +0900
622
639
+++ mysql-5.1.50/storage/innobase/log/log0recv.c        2010-08-25 19:00:40.221017756 +0900
744
761
        }
745
762
 
746
763
        contiguous_lsn = ut_dulint_align_down(recv_sys->scanned_lsn,
 
764
@@ -2908,6 +2915,7 @@
 
765
        /* Switch latching order checks on in sync0sync.c */
 
766
        sync_order_checks_on = TRUE;
 
767
 #endif
 
768
+       if (!srv_apply_log_only) {
 
769
        if (srv_force_recovery < SRV_FORCE_NO_TRX_UNDO) {
 
770
                /* Rollback the uncommitted transactions which have no user
 
771
                session */
 
772
@@ -2915,6 +2923,7 @@
 
773
                os_thread_create(trx_rollback_or_clean_all_without_sess,
 
774
                                 (void *)&i, NULL);
 
775
        }
 
776
+       }
 
777
 }
 
778
 
 
779
 /**********************************************************
747
780
diff -ru mysql-5.1.50_orig/storage/innobase/mem/mem0dbg.c mysql-5.1.50/storage/innobase/mem/mem0dbg.c
748
781
--- mysql-5.1.50_orig/storage/innobase/mem/mem0dbg.c    2010-08-04 02:24:20.000000000 +0900
749
782
+++ mysql-5.1.50/storage/innobase/mem/mem0dbg.c 2010-09-17 05:10:09.000000000 +0900
977
1010
 ulint  srv_pool_size           = ULINT_MAX;    /* size in pages; MySQL inits
978
1011
                                                this to size in kilobytes but
979
1012
                                                we normalize this to pages in
980
 
@@ -358,6 +362,8 @@
 
1013
@@ -358,6 +362,9 @@
981
1014
 ibool  srv_use_awe                     = FALSE;
982
1015
 ibool  srv_use_adaptive_hash_indexes   = TRUE;
983
1016
 
984
1017
+ibool  srv_read_only   = FALSE;
985
1018
+ibool  srv_fake_write  = FALSE;
 
1019
+ibool  srv_apply_log_only = FALSE;
986
1020
 /*-------------------------------------------*/
987
1021
 ulong  srv_n_spin_wait_rounds  = 20;
988
1022
 ulong  srv_n_free_tickets_to_enter = 500;
989
 
@@ -980,6 +986,7 @@
 
1023
@@ -980,6 +987,7 @@
990
1024
 srv_general_init(void)
991
1025
 /*==================*/
992
1026
 {
1060
1094
                fprintf(stderr,
1061
1095
                        "InnoDB: Error: combined size of log files"
1062
1096
                        " must be < 4 GB\n");
1063
 
@@ -1660,7 +1667,18 @@
 
1097
@@ -1541,6 +1548,11 @@
 
1098
                are initialized in trx_sys_init_at_db_start(). */
 
1099
 
 
1100
                recv_recovery_from_checkpoint_finish();
 
1101
+
 
1102
+               if (srv_apply_log_only) {
 
1103
+                       srv_was_started = TRUE;
 
1104
+                       goto skip_processes;
 
1105
+               }
 
1106
        }
 
1107
 
 
1108
        if (!create_new_db && sum_of_new_sizes > 0) {
 
1109
@@ -1660,7 +1672,18 @@
1064
1110
 
1065
1111
        if (srv_auto_extend_last_data_file
1066
1112
            && sum_of_data_file_sizes < tablespace_size_in_header) {
1079
1125
                fprintf(stderr,
1080
1126
                        "InnoDB: Error: tablespace size stored in header"
1081
1127
                        " is %lu pages, but\n"
1082
 
@@ -1685,6 +1703,7 @@
 
1128
@@ -1685,6 +1708,7 @@
1083
1129
 
1084
1130
                        return(DB_ERROR);
1085
1131
                }
1087
1133
        }
1088
1134
 
1089
1135
        /* Check that os_fast_mutexes work as expected */
 
1136
@@ -1781,6 +1805,7 @@
 
1137
                ibuf_update_max_tablespace_id();
 
1138
        }
 
1139
 
 
1140
+skip_processes:
 
1141
        srv_file_per_table = srv_file_per_table_original_value;
 
1142
 
 
1143
        return((int) DB_SUCCESS);
1090
1144
diff -ru mysql-5.1.50_orig/storage/innobase/trx/trx0purge.c mysql-5.1.50/storage/innobase/trx/trx0purge.c
1091
1145
--- mysql-5.1.50_orig/storage/innobase/trx/trx0purge.c  2010-08-04 02:24:20.000000000 +0900
1092
1146
+++ mysql-5.1.50/storage/innobase/trx/trx0purge.c       2010-08-25 19:00:40.237017006 +0900