~percona-dev/percona-xtrabackup/55_on_freebsd

« back to all changes in this revision

Viewing changes to fix_innodb_for_backup_5.1_plugin_1.0.7.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:
1
1
diff -ru mysql-5.1.46_orig/storage/innodb_plugin/btr/btr0btr.c mysql-5.1.46/storage/innodb_plugin/btr/btr0btr.c
2
2
--- mysql-5.1.46_orig/storage/innodb_plugin/btr/btr0btr.c       2010-04-06 23:07:11.000000000 +0900
3
 
+++ mysql-5.1.46/storage/innodb_plugin/btr/btr0btr.c    2010-05-12 16:26:07.000000000 +0900
 
3
+++ mysql-5.1.46/storage/innodb_plugin/btr/btr0btr.c    2010-06-07 18:27:33.920911696 +0900
4
4
@@ -120,7 +120,7 @@
5
5
 /**************************************************************//**
6
6
 Gets the root node of a tree and x-latches it.
21
21
 /*===================*/
22
22
diff -ru mysql-5.1.46_orig/storage/innodb_plugin/buf/buf0buf.c mysql-5.1.46/storage/innodb_plugin/buf/buf0buf.c
23
23
--- mysql-5.1.46_orig/storage/innodb_plugin/buf/buf0buf.c       2010-04-06 23:07:12.000000000 +0900
24
 
+++ mysql-5.1.46/storage/innodb_plugin/buf/buf0buf.c    2010-05-12 16:26:07.000000000 +0900
 
24
+++ mysql-5.1.46/storage/innodb_plugin/buf/buf0buf.c    2010-06-07 18:27:33.923944429 +0900
25
25
@@ -358,7 +358,7 @@
26
26
                return(TRUE);
27
27
        }
42
42
                                bpage->offset, buf_page_get_zip_size(bpage),
43
43
diff -ru mysql-5.1.46_orig/storage/innodb_plugin/buf/buf0rea.c mysql-5.1.46/storage/innodb_plugin/buf/buf0rea.c
44
44
--- mysql-5.1.46_orig/storage/innodb_plugin/buf/buf0rea.c       2010-04-06 23:07:12.000000000 +0900
45
 
+++ mysql-5.1.46/storage/innodb_plugin/buf/buf0rea.c    2010-05-12 16:26:07.000000000 +0900
 
45
+++ mysql-5.1.46/storage/innodb_plugin/buf/buf0rea.c    2010-06-07 18:29:41.373922507 +0900
46
46
@@ -120,6 +120,45 @@
47
47
        bpage = buf_page_init_for_read(err, mode, space, zip_size, unzip,
48
48
                                       tablespace_version, offset);
142
142
 
143
143
diff -ru mysql-5.1.46_orig/storage/innodb_plugin/fil/fil0fil.c mysql-5.1.46/storage/innodb_plugin/fil/fil0fil.c
144
144
--- mysql-5.1.46_orig/storage/innodb_plugin/fil/fil0fil.c       2010-04-06 23:07:12.000000000 +0900
145
 
+++ mysql-5.1.46/storage/innodb_plugin/fil/fil0fil.c    2010-05-12 16:26:07.000000000 +0900
 
145
+++ mysql-5.1.46/storage/innodb_plugin/fil/fil0fil.c    2010-08-24 19:04:11.158519001 +0900
146
146
@@ -283,7 +283,7 @@
147
147
 
148
148
 /** The tablespace memory cache. This variable is NULL before the module is
439
439
        for (;;) {
440
440
diff -ru mysql-5.1.46_orig/storage/innodb_plugin/ibuf/ibuf0ibuf.c mysql-5.1.46/storage/innodb_plugin/ibuf/ibuf0ibuf.c
441
441
--- mysql-5.1.46_orig/storage/innodb_plugin/ibuf/ibuf0ibuf.c    2010-04-06 23:07:12.000000000 +0900
442
 
+++ mysql-5.1.46/storage/innodb_plugin/ibuf/ibuf0ibuf.c 2010-05-12 16:26:07.000000000 +0900
 
442
+++ mysql-5.1.46/storage/innodb_plugin/ibuf/ibuf0ibuf.c 2010-06-07 18:27:33.943898424 +0900
443
443
@@ -1055,6 +1055,9 @@
444
444
 
445
445
        ut_ad(!recv_no_ibuf_operations);
462
462
 
463
463
diff -ru mysql-5.1.46_orig/storage/innodb_plugin/include/srv0srv.h mysql-5.1.46/storage/innodb_plugin/include/srv0srv.h
464
464
--- mysql-5.1.46_orig/storage/innodb_plugin/include/srv0srv.h   2010-04-06 23:07:13.000000000 +0900
465
 
+++ mysql-5.1.46/storage/innodb_plugin/include/srv0srv.h        2010-05-12 16:26:07.000000000 +0900
466
 
@@ -196,6 +196,9 @@
 
465
+++ mysql-5.1.46/storage/innodb_plugin/include/srv0srv.h        2010-10-20 17:26:39.471127453 +0900
 
466
@@ -196,6 +196,10 @@
467
467
 extern ulong   srv_max_purge_lag;
468
468
 
469
469
 extern ulong   srv_replication_delay;
470
470
+
471
471
+extern ibool   srv_read_only;
472
472
+extern ibool   srv_fake_write;
 
473
+extern ibool   srv_apply_log_only;
473
474
 /*-------------------------------------------*/
474
475
 
475
476
 extern ulint   srv_n_rows_inserted;
476
477
diff -ru mysql-5.1.46_orig/storage/innodb_plugin/include/srv0start.h mysql-5.1.46/storage/innodb_plugin/include/srv0start.h
477
478
--- mysql-5.1.46_orig/storage/innodb_plugin/include/srv0start.h 2010-04-06 23:07:13.000000000 +0900
478
 
+++ mysql-5.1.46/storage/innodb_plugin/include/srv0start.h      2010-05-12 16:26:07.000000000 +0900
 
479
+++ mysql-5.1.46/storage/innodb_plugin/include/srv0start.h      2010-06-07 18:27:33.949899579 +0900
479
480
@@ -91,6 +91,8 @@
480
481
 /** Log sequence number immediately after startup */
481
482
 extern ib_uint64_t     srv_start_lsn;
487
488
 #endif
488
489
diff -ru mysql-5.1.46_orig/storage/innodb_plugin/include/ut0byte.ic mysql-5.1.46/storage/innodb_plugin/include/ut0byte.ic
489
490
--- mysql-5.1.46_orig/storage/innodb_plugin/include/ut0byte.ic  2010-04-06 23:07:13.000000000 +0900
490
 
+++ mysql-5.1.46/storage/innodb_plugin/include/ut0byte.ic       2010-05-12 16:26:07.000000000 +0900
 
491
+++ mysql-5.1.46/storage/innodb_plugin/include/ut0byte.ic       2010-06-07 18:27:33.950903922 +0900
491
492
@@ -168,6 +168,14 @@
492
493
        dulint  a,      /*!< in: dulint */
493
494
        ulint   b)      /*!< in: ulint */
531
532
 
532
533
diff -ru mysql-5.1.46_orig/storage/innodb_plugin/log/log0log.c mysql-5.1.46/storage/innodb_plugin/log/log0log.c
533
534
--- mysql-5.1.46_orig/storage/innodb_plugin/log/log0log.c       2010-04-06 23:07:13.000000000 +0900
534
 
+++ mysql-5.1.46/storage/innodb_plugin/log/log0log.c    2010-05-12 16:26:07.000000000 +0900
 
535
+++ mysql-5.1.46/storage/innodb_plugin/log/log0log.c    2010-10-20 17:27:23.837158511 +0900
535
536
@@ -564,7 +564,9 @@
536
537
 
537
538
        offset = (gr_lsn_size_offset + difference) % group_size;
551
552
                /* Recovery is running and no operations on the log files are
552
553
                allowed yet (the variable name .._no_ibuf_.. is misleading) */
553
554
 
 
555
@@ -3089,6 +3091,7 @@
 
556
        for the 'very fast' shutdown, because the InnoDB layer may have
 
557
        committed or prepared transactions and we don't want to lose them. */
 
558
 
 
559
+       if (!srv_apply_log_only) {
 
560
        if (trx_n_mysql_transactions > 0
 
561
            || UT_LIST_GET_LEN(trx_sys->trx_list) > 0) {
 
562
 
 
563
@@ -3096,6 +3099,7 @@
 
564
 
 
565
                goto loop;
 
566
        }
 
567
+       }
 
568
 
 
569
        if (srv_fast_shutdown == 2) {
 
570
                /* In this fastest shutdown we do not flush the buffer pool:
554
571
diff -ru mysql-5.1.46_orig/storage/innodb_plugin/log/log0recv.c mysql-5.1.46/storage/innodb_plugin/log/log0recv.c
555
572
--- mysql-5.1.46_orig/storage/innodb_plugin/log/log0recv.c      2010-04-06 23:07:13.000000000 +0900
556
 
+++ mysql-5.1.46/storage/innodb_plugin/log/log0recv.c   2010-05-12 16:26:07.000000000 +0900
 
573
+++ mysql-5.1.46/storage/innodb_plugin/log/log0recv.c   2010-10-20 17:28:01.225196579 +0900
557
574
@@ -42,27 +42,27 @@
558
575
 #include "trx0undo.h"
559
576
 #include "trx0rec.h"
695
712
        }
696
713
 
697
714
        contiguous_lsn = ut_uint64_align_down(recv_sys->scanned_lsn,
 
715
@@ -3284,6 +3291,7 @@
 
716
        that the data dictionary tables will be free of any locks.
 
717
        The data dictionary latch should guarantee that there is at
 
718
        most one data dictionary transaction active at a time. */
 
719
+       if (!srv_apply_log_only)
 
720
        trx_rollback_or_clean_recovered(FALSE);
 
721
 }
 
722
 
698
723
diff -ru mysql-5.1.46_orig/storage/innodb_plugin/os/os0file.c mysql-5.1.46/storage/innodb_plugin/os/os0file.c
699
724
--- mysql-5.1.46_orig/storage/innodb_plugin/os/os0file.c        2010-04-06 23:07:14.000000000 +0900
700
 
+++ mysql-5.1.46/storage/innodb_plugin/os/os0file.c     2010-05-12 16:26:07.000000000 +0900
 
725
+++ mysql-5.1.46/storage/innodb_plugin/os/os0file.c     2010-06-07 18:27:33.972898477 +0900
701
726
@@ -514,7 +514,7 @@
702
727
 }
703
728
 
753
778
        if ((ulint)ret == n) {
754
779
diff -ru mysql-5.1.46_orig/storage/innodb_plugin/os/os0thread.c mysql-5.1.46/storage/innodb_plugin/os/os0thread.c
755
780
--- mysql-5.1.46_orig/storage/innodb_plugin/os/os0thread.c      2010-04-06 23:07:14.000000000 +0900
756
 
+++ mysql-5.1.46/storage/innodb_plugin/os/os0thread.c   2010-05-12 16:26:07.000000000 +0900
 
781
+++ mysql-5.1.46/storage/innodb_plugin/os/os0thread.c   2010-06-07 18:27:33.974943797 +0900
757
782
@@ -287,12 +287,17 @@
758
783
 #elif defined(__NETWARE__)
759
784
        delay(tm / 1000);
774
799
 
775
800
diff -ru mysql-5.1.46_orig/storage/innodb_plugin/row/row0merge.c mysql-5.1.46/storage/innodb_plugin/row/row0merge.c
776
801
--- mysql-5.1.46_orig/storage/innodb_plugin/row/row0merge.c     2010-04-06 23:07:14.000000000 +0900
777
 
+++ mysql-5.1.46/storage/innodb_plugin/row/row0merge.c  2010-05-12 16:26:07.000000000 +0900
 
802
+++ mysql-5.1.46/storage/innodb_plugin/row/row0merge.c  2010-06-07 18:27:33.975896904 +0900
778
803
@@ -453,7 +453,9 @@
779
804
        rec = rec_convert_dtuple_to_rec(*buf, index, tuple, n_ext);
780
805
        offsets = rec_get_offsets(rec, index, NULL, ULINT_UNDEFINED, &heap);
812
837
        secondary index entries for merge sort */
813
838
diff -ru mysql-5.1.46_orig/storage/innodb_plugin/srv/srv0srv.c mysql-5.1.46/storage/innodb_plugin/srv/srv0srv.c
814
839
--- mysql-5.1.46_orig/storage/innodb_plugin/srv/srv0srv.c       2010-04-06 23:07:14.000000000 +0900
815
 
+++ mysql-5.1.46/storage/innodb_plugin/srv/srv0srv.c    2010-05-12 16:26:07.000000000 +0900
816
 
@@ -367,6 +367,8 @@
 
840
+++ mysql-5.1.46/storage/innodb_plugin/srv/srv0srv.c    2010-10-20 17:33:40.350528861 +0900
 
841
@@ -367,6 +367,9 @@
817
842
 
818
843
 UNIV_INTERN ulong      srv_replication_delay           = 0;
819
844
 
820
845
+UNIV_INTERN ibool      srv_read_only   = FALSE;
821
846
+UNIV_INTERN ibool      srv_fake_write  = FALSE;
 
847
+UNIV_INTERN ibool      srv_apply_log_only = FALSE;
822
848
 /*-------------------------------------------*/
823
849
 UNIV_INTERN ulong      srv_n_spin_wait_rounds  = 30;
824
850
 UNIV_INTERN ulong      srv_n_free_tickets_to_enter = 500;
825
 
@@ -995,7 +997,7 @@
 
851
@@ -995,7 +998,7 @@
826
852
        }
827
853
 
828
854
        /* Initialize some INFORMATION SCHEMA internal structures */
831
857
 }
832
858
 
833
859
 /*********************************************************************//**
834
 
@@ -1006,6 +1008,7 @@
 
860
@@ -1006,6 +1009,7 @@
835
861
 /*==========*/
836
862
 {
837
863
        os_fast_mutex_free(&srv_conc_mutex);
839
865
        mem_free(srv_conc_slots);
840
866
        srv_conc_slots = NULL;
841
867
 
842
 
@@ -1019,6 +1022,7 @@
 
868
@@ -1019,6 +1023,7 @@
843
869
        srv_mysql_table = NULL;
844
870
 
845
871
        trx_i_s_cache_free(trx_i_s_cache);
849
875
 /*********************************************************************//**
850
876
diff -ru mysql-5.1.46_orig/storage/innodb_plugin/srv/srv0start.c mysql-5.1.46/storage/innodb_plugin/srv/srv0start.c
851
877
--- mysql-5.1.46_orig/storage/innodb_plugin/srv/srv0start.c     2010-04-06 23:07:14.000000000 +0900
852
 
+++ mysql-5.1.46/storage/innodb_plugin/srv/srv0start.c  2010-05-12 16:26:07.000000000 +0900
 
878
+++ mysql-5.1.46/storage/innodb_plugin/srv/srv0start.c  2010-10-20 17:36:06.661114418 +0900
853
879
@@ -94,6 +94,8 @@
854
880
 /** Log sequence number at shutdown */
855
881
 UNIV_INTERN ib_uint64_t        srv_shutdown_lsn;
886
912
                fprintf(stderr,
887
913
                        "InnoDB: Error: combined size of log files"
888
914
                        " must be < 4 GB\n");
889
 
@@ -1724,7 +1726,18 @@
 
915
@@ -1578,6 +1580,10 @@
 
916
                are initialized in trx_sys_init_at_db_start(). */
 
917
 
 
918
                recv_recovery_from_checkpoint_finish();
 
919
+
 
920
+               if (srv_apply_log_only)
 
921
+                       goto skip_processes;
 
922
+
 
923
                if (srv_force_recovery < SRV_FORCE_NO_IBUF_MERGE) {
 
924
                        /* The following call is necessary for the insert
 
925
                        buffer to work with multiple tablespaces. We must
 
926
@@ -1724,7 +1730,18 @@
890
927
 
891
928
        if (srv_auto_extend_last_data_file
892
929
            && sum_of_data_file_sizes < tablespace_size_in_header) {
905
942
                fprintf(stderr,
906
943
                        "InnoDB: Error: tablespace size stored in header"
907
944
                        " is %lu pages, but\n"
908
 
@@ -1749,6 +1762,7 @@
 
945
@@ -1749,6 +1766,7 @@
909
946
 
910
947
                        return(DB_ERROR);
911
948
                }
913
950
        }
914
951
 
915
952
        /* Check that os_fast_mutexes work as expected */
 
953
@@ -1844,6 +1862,7 @@
 
954
                ibuf_update_max_tablespace_id();
 
955
        }
 
956
 
 
957
+skip_processes:
 
958
        srv_file_per_table = srv_file_per_table_original_value;
 
959
 
 
960
        srv_was_started = TRUE;
916
961
diff -ru mysql-5.1.46_orig/storage/innodb_plugin/trx/trx0purge.c mysql-5.1.46/storage/innodb_plugin/trx/trx0purge.c
917
962
--- mysql-5.1.46_orig/storage/innodb_plugin/trx/trx0purge.c     2010-04-06 23:07:14.000000000 +0900
918
 
+++ mysql-5.1.46/storage/innodb_plugin/trx/trx0purge.c  2010-05-12 16:26:07.000000000 +0900
 
963
+++ mysql-5.1.46/storage/innodb_plugin/trx/trx0purge.c  2010-06-07 18:27:33.980911072 +0900
919
964
@@ -1091,6 +1091,9 @@
920
965
        /*      que_thr_t*      thr2; */
921
966
        ulint           old_pages_handled;
926
971
        mutex_enter(&(purge_sys->mutex));
927
972
 
928
973
        if (purge_sys->trx->n_active_thrs > 0) {
 
974
diff -ru mysql-5.1.46_orig/storage/innodb_plugin/trx/trx0rseg.c mysql-5.1.46/storage/innodb_plugin/trx/trx0rseg.c
 
975
--- mysql-5.1.46_orig/storage/innodb_plugin/trx/trx0rseg.c      2010-04-06 23:07:14.000000000 +0900
 
976
+++ mysql-5.1.46/storage/innodb_plugin/trx/trx0rseg.c   2010-10-20 17:37:40.357160757 +0900
 
977
@@ -143,9 +143,11 @@
 
978
 
 
979
        mutex_free(&rseg->mutex);
 
980
 
 
981
+       if (!srv_apply_log_only) {
 
982
        /* There can't be any active transactions. */
 
983
        ut_a(UT_LIST_GET_LEN(rseg->update_undo_list) == 0);
 
984
        ut_a(UT_LIST_GET_LEN(rseg->insert_undo_list) == 0);
 
985
+       }
 
986
 
 
987
        undo = UT_LIST_GET_FIRST(rseg->update_undo_cached);
 
988
 
 
989
diff -ru mysql-5.1.46_orig/storage/innodb_plugin/trx/trx0sys.c mysql-5.1.46/storage/innodb_plugin/trx/trx0sys.c
 
990
--- mysql-5.1.46_orig/storage/innodb_plugin/trx/trx0sys.c       2010-04-06 23:07:14.000000000 +0900
 
991
+++ mysql-5.1.46/storage/innodb_plugin/trx/trx0sys.c    2010-10-20 17:38:19.744125410 +0900
 
992
@@ -1602,10 +1602,12 @@
 
993
                UT_LIST_REMOVE(view_list, trx_sys->view_list, prev_view);
 
994
        }
 
995
 
 
996
+       if (!srv_apply_log_only) {
 
997
        ut_a(UT_LIST_GET_LEN(trx_sys->trx_list) == 0);
 
998
        ut_a(UT_LIST_GET_LEN(trx_sys->rseg_list) == 0);
 
999
        ut_a(UT_LIST_GET_LEN(trx_sys->view_list) == 0);
 
1000
        ut_a(UT_LIST_GET_LEN(trx_sys->mysql_trx_list) == 0);
 
1001
+       }
 
1002
 
 
1003
        mem_free(trx_sys);
 
1004
 
929
1005
diff -ru mysql-5.1.46_orig/storage/innodb_plugin/trx/trx0trx.c mysql-5.1.46/storage/innodb_plugin/trx/trx0trx.c
930
1006
--- mysql-5.1.46_orig/storage/innodb_plugin/trx/trx0trx.c       2010-04-06 23:07:14.000000000 +0900
931
 
+++ mysql-5.1.46/storage/innodb_plugin/trx/trx0trx.c    2010-05-12 16:26:07.000000000 +0900
 
1007
+++ mysql-5.1.46/storage/innodb_plugin/trx/trx0trx.c    2010-06-07 18:27:33.981914301 +0900
932
1008
@@ -462,8 +462,8 @@
933
1009
                                                TRX_ID_PREP_PRINTF(trx->id));
934
1010