~percona-dev/percona-server/release-5.1.57-12-rnt-backup

« back to all changes in this revision

Viewing changes to innodb_pass_corrupt_table.patch

  • Committer: kinoyasu
  • Date: 2010-05-19 11:04:53 UTC
  • mto: This revision was merged to the branch mainline in revision 7.
  • Revision ID: kinoyasu@gauntlet3-20100519110453-txm0stqmhc2s3u11
add new option innodb_doublewrite_path

Show diffs side-by-side

added added

removed removed

Lines of Context:
369
369
 {
370
370
        enum buf_io_fix io_type;
371
371
        const ibool     uncompressed = (buf_page_get_state(bpage)
372
 
@@ -3428,6 +3447,7 @@
 
372
@@ -3429,6 +3448,7 @@
373
373
                                (ulong) bpage->offset);
374
374
                }
375
375
 
377
377
                /* From version 3.23.38 up we store the page checksum
378
378
                to the 4 first bytes of the page end lsn field */
379
379
 
380
 
@@ -3469,6 +3489,19 @@
 
380
@@ -3470,6 +3490,19 @@
381
381
                              REFMAN "forcing-recovery.html\n"
382
382
                              "InnoDB: about forcing recovery.\n", stderr);
383
383
 
384
 
+                       if (srv_pass_corrupt_table && bpage->space > 0
 
384
+                       if (srv_pass_corrupt_table && !trx_sys_sys_space(bpage->space)
385
385
+                           && bpage->space < SRV_LOG_SPACE_FIRST_ID) {
386
386
+                               fprintf(stderr,
387
387
+                                       "InnoDB: space %lu will be treated as corrupt.\n",
397
397
                        if (srv_force_recovery < SRV_FORCE_IGNORE_CORRUPT) {
398
398
                                fputs("InnoDB: Ending processing because of"
399
399
                                      " a corrupt database page.\n",
400
 
@@ -3476,6 +3509,7 @@
 
400
@@ -3477,6 +3510,7 @@
401
401
                                exit(1);
402
402
                        }
403
403
                }
405
405
 
406
406
                if (recv_recovery_is_on()) {
407
407
                        /* Pages must be uncompressed for crash recovery. */
408
 
@@ -3485,8 +3519,11 @@
 
408
@@ -3486,8 +3520,11 @@
409
409
 
410
410
                if (uncompressed && !recv_no_ibuf_operations) {
411
411
                        ibuf_merge_or_delete_for_page(
420
420
diff -ruN a/storage/innodb_plugin/buf/buf0rea.c b/storage/innodb_plugin/buf/buf0rea.c
421
421
--- a/storage/innodb_plugin/buf/buf0rea.c       2010-04-30 15:48:30.000000000 +0900
422
422
+++ b/storage/innodb_plugin/buf/buf0rea.c       2010-04-30 15:49:22.000000000 +0900
423
 
@@ -187,12 +187,19 @@
 
423
@@ -189,12 +189,19 @@
424
424
                              sync, space, 0, offset, 0, UNIV_PAGE_SIZE,
425
425
                              ((buf_block_t*) bpage)->frame, bpage, trx);
426
426
        }
499
499
+       dict_table_t*   table;
500
500
+       ibool           found = FALSE;
501
501
+
502
 
+       ut_a(space_id != 0 && space_id < SRV_LOG_SPACE_FIRST_ID);
 
502
+       ut_a(!trx_sys_sys_space(space_id) && space_id < SRV_LOG_SPACE_FIRST_ID);
503
503
+
504
504
+       if (need_mutex)
505
505
+               mutex_enter(&(dict_sys->mutex));
759
759
diff -ruN a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/handler/ha_innodb.cc
760
760
--- a/storage/innodb_plugin/handler/ha_innodb.cc        2010-04-30 15:46:35.000000000 +0900
761
761
+++ b/storage/innodb_plugin/handler/ha_innodb.cc        2010-04-30 16:23:01.000000000 +0900
762
 
@@ -3640,6 +3640,12 @@
 
762
@@ -3643,6 +3643,12 @@
763
763
                DBUG_RETURN(1);
764
764
        }
765
765
 
772
772
        /* Create buffers for packing the fields of a record. Why
773
773
        table->reclength did not work here? Obviously, because char
774
774
        fields when packed actually became 1 byte longer, when we also
775
 
@@ -3667,6 +3673,19 @@
 
775
@@ -3670,6 +3676,19 @@
776
776
        /* Get pointer to a table object in InnoDB dictionary cache */
777
777
        ib_table = dict_table_get(norm_name, TRUE);
778
778
        
792
792
        if (NULL == ib_table) {
793
793
                if (is_part && retries < 10) {
794
794
                        ++retries;
795
 
@@ -4829,6 +4848,10 @@
 
795
@@ -4832,6 +4851,10 @@
796
796
 
797
797
        ha_statistic_increment(&SSV::ha_write_count);
798
798
 
803
803
        if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT)
804
804
                table->timestamp_field->set_time();
805
805
 
806
 
@@ -5046,6 +5069,10 @@
 
806
@@ -5049,6 +5072,10 @@
807
807
 func_exit:
808
808
        innobase_active_small();
809
809
 
814
814
        DBUG_RETURN(error_result);
815
815
 }
816
816
 
817
 
@@ -5222,6 +5249,10 @@
 
817
@@ -5225,6 +5252,10 @@
818
818
 
819
819
        ha_statistic_increment(&SSV::ha_update_count);
820
820
 
825
825
        if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE)
826
826
                table->timestamp_field->set_time();
827
827
 
828
 
@@ -5311,6 +5342,10 @@
 
828
@@ -5314,6 +5345,10 @@
829
829
 
830
830
        innobase_active_small();
831
831
 
836
836
        DBUG_RETURN(error);
837
837
 }
838
838
 
839
 
@@ -5332,6 +5367,10 @@
 
839
@@ -5335,6 +5370,10 @@
840
840
 
841
841
        ha_statistic_increment(&SSV::ha_delete_count);
842
842
 
847
847
        if (!prebuilt->upd_node) {
848
848
                row_get_prebuilt_update_vector(prebuilt);
849
849
        }
850
 
@@ -5358,6 +5397,10 @@
 
850
@@ -5361,6 +5400,10 @@
851
851
 
852
852
        innobase_active_small();
853
853
 
858
858
        DBUG_RETURN(error);
859
859
 }
860
860
 
861
 
@@ -5597,6 +5640,10 @@
 
861
@@ -5600,6 +5643,10 @@
862
862
 
863
863
        ha_statistic_increment(&SSV::ha_read_key_count);
864
864
 
869
869
        index = prebuilt->index;
870
870
 
871
871
        if (UNIV_UNLIKELY(index == NULL)) {
872
 
@@ -5659,6 +5706,10 @@
 
872
@@ -5662,6 +5709,10 @@
873
873
                ret = DB_UNSUPPORTED;
874
874
        }
875
875
 
880
880
        switch (ret) {
881
881
        case DB_SUCCESS:
882
882
                error = 0;
883
 
@@ -5769,6 +5820,10 @@
 
883
@@ -5772,6 +5823,10 @@
884
884
 {
885
885
        DBUG_ENTER("change_active_index");
886
886
 
891
891
        ut_ad(user_thd == ha_thd());
892
892
        ut_a(prebuilt->trx == thd_to_trx(user_thd));
893
893
 
894
 
@@ -5859,6 +5914,10 @@
 
894
@@ -5862,6 +5917,10 @@
895
895
 
896
896
        DBUG_ENTER("general_fetch");
897
897
 
902
902
        ut_a(prebuilt->trx == thd_to_trx(user_thd));
903
903
 
904
904
        innodb_srv_conc_enter_innodb(prebuilt->trx);
905
 
@@ -5868,6 +5927,10 @@
 
905
@@ -5871,6 +5930,10 @@
906
906
 
907
907
        innodb_srv_conc_exit_innodb(prebuilt->trx);
908
908
 
913
913
        switch (ret) {
914
914
        case DB_SUCCESS:
915
915
                error = 0;
916
 
@@ -7100,6 +7163,10 @@
 
916
@@ -7103,6 +7166,10 @@
917
917
                DBUG_RETURN(my_errno=HA_ERR_WRONG_COMMAND);
918
918
        }
919
919
 
924
924
        /* Truncate the table in InnoDB */
925
925
 
926
926
        error = row_truncate_table_for_mysql(prebuilt->table, prebuilt->trx);
927
 
@@ -7108,6 +7175,10 @@
 
927
@@ -7111,6 +7178,10 @@
928
928
                goto fallback;
929
929
        }
930
930
 
935
935
        error = convert_error_code_to_mysql(error, prebuilt->table->flags,
936
936
                                            NULL);
937
937
 
938
 
@@ -7615,6 +7686,16 @@
 
938
@@ -7618,6 +7689,16 @@
939
939
        return(ranges + (double) rows / (double) total_rows * time_for_scan);
940
940
 }
941
941
 
952
952
 /*********************************************************************//**
953
953
 Returns statistics information of the table to the MySQL interpreter,
954
954
 in various fields of the handle object. */
955
 
@@ -7666,9 +7747,9 @@
 
955
@@ -7669,9 +7750,9 @@
956
956
        ib_table = prebuilt->table;
957
957
 
958
958
        if (flag & HA_STATUS_TIME) {
965
965
                        /* In sql_show we call with this flag: update
966
966
                        then statistics so that they are up-to-date */
967
967
 
968
 
@@ -7909,6 +7990,10 @@
 
968
@@ -7912,6 +7993,10 @@
969
969
        THD*            thd,            /*!< in: connection thread handle */
970
970
        HA_CHECK_OPT*   check_opt)      /*!< in: currently ignored */
971
971
 {
976
976
        /* Serialize ANALYZE TABLE inside InnoDB, see
977
977
        Bug#38996 Race condition in ANALYZE TABLE */
978
978
        pthread_mutex_lock(&analyze_mutex);
979
 
@@ -7918,6 +8003,10 @@
 
979
@@ -7921,6 +8006,10 @@
980
980
 
981
981
        pthread_mutex_unlock(&analyze_mutex);
982
982
 
987
987
        return(0);
988
988
 }
989
989
 
990
 
@@ -8099,6 +8188,10 @@
 
990
@@ -8102,6 +8191,10 @@
991
991
                my_error(ER_QUERY_INTERRUPTED, MYF(0));
992
992
        }
993
993
 
998
998
        DBUG_RETURN(is_ok ? HA_ADMIN_OK : HA_ADMIN_CORRUPT);
999
999
 }
1000
1000
 
1001
 
@@ -8826,6 +8919,10 @@
 
1001
@@ -8829,6 +8922,10 @@
1002
1002
 
1003
1003
        update_thd(thd);
1004
1004
 
1009
1009
        if (prebuilt->table->ibd_file_missing && !thd_tablespace_op(thd)) {
1010
1010
                ut_print_timestamp(stderr);
1011
1011
                fprintf(stderr,
1012
 
@@ -11208,6 +11305,14 @@
 
1012
@@ -11216,6 +11313,14 @@
1013
1013
   "Relax limitation of column size at table creation as builtin InnoDB.",
1014
1014
   NULL, NULL, 0, 0, 1, 0);
1015
1015
 
1024
1024
 static struct st_mysql_sys_var* innobase_system_variables[]= {
1025
1025
   MYSQL_SYSVAR(additional_mem_pool_size),
1026
1026
   MYSQL_SYSVAR(autoextend_increment),
1027
 
@@ -11287,6 +11392,7 @@
 
1027
@@ -11296,6 +11401,7 @@
1028
1028
   MYSQL_SYSVAR(io_capacity),
1029
1029
   MYSQL_SYSVAR(use_purge_thread),
1030
1030
   MYSQL_SYSVAR(relax_table_creation),
1054
1054
diff -ruN a/storage/innodb_plugin/handler/innodb_patch_info.h b/storage/innodb_plugin/handler/innodb_patch_info.h
1055
1055
--- a/storage/innodb_plugin/handler/innodb_patch_info.h 2010-04-30 15:48:30.000000000 +0900
1056
1056
+++ b/storage/innodb_plugin/handler/innodb_patch_info.h 2010-04-30 15:49:22.000000000 +0900
1057
 
@@ -43,5 +43,6 @@
1058
 
 {"innodb_extend_slow","Extended statistics in slow.log","It is InnoDB-part only. It needs to patch also to mysqld.","http://www.percona.com/docs/wiki/percona-xtradb"},
 
1057
@@ -44,5 +44,6 @@
1059
1058
 {"innodb_relax_table_creation","Relax limitation of column size at table creation as builtin InnoDB.","","http://www.percona.com/docs/wiki/percona-xtradb"},
1060
1059
 {"innodb_lru_dump_restore","Dump and restore command for content of buffer pool","","http://www.percona.com/docs/wiki/percona-xtradb"},
 
1060
 {"innodb_separate_doublewrite","Add option 'innodb_doublewrite_path' to separate doublewrite dedicated tablespace","","http://www.percona.com/docs/wiki/percona-xtradb"},
1061
1061
+{"innodb_pass_corrupt_table","Treat tables as corrupt instead of crash, when meet corrupt blocks","","http://www.percona.com/docs/wiki/percona-xtradb"},
1062
1062
 {NULL, NULL, NULL, NULL}
1063
1063
 };
1219
1219
diff -ruN a/storage/innodb_plugin/include/srv0srv.h b/storage/innodb_plugin/include/srv0srv.h
1220
1220
--- a/storage/innodb_plugin/include/srv0srv.h   2010-04-30 15:46:35.000000000 +0900
1221
1221
+++ b/storage/innodb_plugin/include/srv0srv.h   2010-04-30 15:49:22.000000000 +0900
1222
 
@@ -229,6 +229,7 @@
 
1222
@@ -231,6 +231,7 @@
1223
1223
 
1224
1224
 extern ulint   srv_expand_import;
1225
1225
 extern ulint   srv_relax_table_creation;
1280
1280
diff -ruN a/storage/innodb_plugin/srv/srv0srv.c b/storage/innodb_plugin/srv/srv0srv.c
1281
1281
--- a/storage/innodb_plugin/srv/srv0srv.c       2010-04-30 15:46:35.000000000 +0900
1282
1282
+++ b/storage/innodb_plugin/srv/srv0srv.c       2010-04-30 15:49:22.000000000 +0900
1283
 
@@ -398,6 +398,7 @@
 
1283
@@ -400,6 +400,7 @@
1284
1284
 
1285
1285
 UNIV_INTERN ulint      srv_expand_import = 0; /* 0:disable 1:enable */
1286
1286
 UNIV_INTERN ulint      srv_relax_table_creation = 0; /* 0:disable 1:enable */
1291
1291
diff -ruN a/storage/innodb_plugin/srv/srv0start.c b/storage/innodb_plugin/srv/srv0start.c
1292
1292
--- a/storage/innodb_plugin/srv/srv0start.c     2010-04-30 14:35:00.000000000 +0900
1293
1293
+++ b/storage/innodb_plugin/srv/srv0start.c     2010-04-30 15:49:22.000000000 +0900
1294
 
@@ -1803,6 +1803,13 @@
 
1294
@@ -1962,6 +1962,13 @@
1295
1295
 
1296
1296
        os_fast_mutex_free(&srv_os_test_mutex);
1297
1297