~hrvojem/percona-xtrabackup/bug839306-2.0

« back to all changes in this revision

Viewing changes to patches/innodb56.patch

  • Committer: Alexey Kopytov
  • Date: 2013-04-28 05:28:35 UTC
  • mfrom: (533.1.2 2.0)
  • Revision ID: akopytov@gmail.com-20130428052835-aadtc5yxcbadcmbj
Manual merge of lp:~akopytov/percona-xtrabackup/support-remote-tablespaces-2.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
295
295
 /********************************************************************//**
296
296
 Tries to open a single-table tablespace and optionally checks that the
297
297
 space id in it is correct. If this does not succeed, print an error message
298
 
@@ -3712,11 +3827,15 @@
 
298
@@ -3569,6 +3684,9 @@
 
299
        in the default location. If it is remote, it should not be here. */
 
300
        def.filepath = fil_make_ibd_name(tablename, false);
 
301
 
 
302
+       /* We skip SYS_DATAFILES validation and remote tablespaces discovery for
 
303
+       XtraBackup, as all tablespaces are local for XtraBackup recovery. */
 
304
+#if 0
 
305
        /* The path_in was read from SYS_DATAFILES. */
 
306
        if (path_in) {
 
307
                if (strcmp(def.filepath, path_in)) {
 
308
@@ -3616,6 +3734,7 @@
 
309
                        tablespaces_found++;
 
310
                }
 
311
        }
 
312
+#endif
 
313
 
 
314
        /* Always look for a file at the default location. */
 
315
        ut_a(def.filepath);
 
316
@@ -3712,11 +3831,15 @@
299
317
                /* The following call prints an error message */
300
318
                os_file_get_last_error(true);
301
319
 
312
330
 
313
331
                err = DB_CORRUPTION;
314
332
 
315
 
@@ -4135,7 +4254,7 @@
 
333
@@ -4018,6 +4141,9 @@
 
334
 # endif /* !UNIV_HOTBACKUP */
 
335
 #endif
 
336
 
 
337
+       /* Ignore .isl files on XtraBackup recovery. All tablespaces must be
 
338
+       local. */
 
339
+       if (!recv_recovery_on) {
 
340
        /* Check for a link file which locates a remote tablespace. */
 
341
        remote.success = fil_open_linked_file(
 
342
                tablename, &remote.filepath, &remote.file);
 
343
@@ -4030,6 +4156,7 @@
 
344
                        mem_free(remote.filepath);
 
345
                }
 
346
        }
 
347
+       }
 
348
 
 
349
 
 
350
        /* Try to open the tablespace in the datadir. */
 
351
@@ -4135,7 +4262,7 @@
316
352
        cannot be ok. */
317
353
        ulong minimum_size = FIL_IBD_FILE_INITIAL_SIZE * UNIV_PAGE_SIZE;
318
354
        if (size < minimum_size) {
321
357
                ib_logf(IB_LOG_LEVEL_ERROR,
322
358
                        "The size of single-table tablespace file %s "
323
359
                        "is only " UINT64PF ", should be at least %lu!",
324
 
@@ -4263,7 +4382,7 @@
 
360
@@ -4263,7 +4390,7 @@
325
361
 idea is to read as much good data as we can and jump over bad data.
326
362
 @return 0 if ok, -1 if error even after the retries, 1 if at the end
327
363
 of the directory */
330
366
 int
331
367
 fil_file_readdir_next_file(
332
368
 /*=======================*/
333
 
@@ -4303,7 +4422,7 @@
 
369
@@ -4303,7 +4430,7 @@
334
370
 @return        DB_SUCCESS or error number */
335
371
 UNIV_INTERN
336
372
 dberr_t
339
375
 /*===================================*/
340
376
 {
341
377
        int             ret;
342
 
@@ -4359,7 +4478,9 @@
 
378
@@ -4359,7 +4486,9 @@
343
379
                            "%s/%s", fil_path_to_mysql_datadir, dbinfo.name);
344
380
                srv_normalize_path_for_win(dbpath);
345
381
 
350
386
 
351
387
                if (dbdir != NULL) {
352
388
 
353
 
@@ -4385,8 +4506,11 @@
354
 
                                                   ".isl"))) {
 
389
@@ -4380,9 +4509,15 @@
 
390
                                    && (0 == strcmp(fileinfo.name
 
391
                                                   + strlen(fileinfo.name) - 4,
 
392
                                                   ".ibd")
 
393
-                                       || 0 == strcmp(fileinfo.name
 
394
+                                       /* Ignore .isl files on XtraBackup
 
395
+                                       recovery, all tablespaces must be
 
396
+                                       local. */
 
397
+                                       || (!recv_recovery_on &&
 
398
+                                           0 == strcmp(fileinfo.name
 
399
                                                   + strlen(fileinfo.name) - 4,
 
400
-                                                  ".isl"))) {
 
401
+                                                       ".isl")))
 
402
+                                   && (!pred ||
 
403
+                                       pred(dbinfo.name, fileinfo.name))) {
355
404
                                        /* The name ends in .ibd or .isl;
356
405
                                        try opening the file */
357
 
-                                       fil_load_single_table_tablespace(
358
 
+                                       if (!pred ||
359
 
+                                           pred(dbinfo.name, fileinfo.name)) {
360
 
+                                               fil_load_single_table_tablespace(
361
 
                                                dbinfo.name, fileinfo.name);
362
 
+                                       }
363
 
                                }
364
 
 next_file_item:
365
 
                                ret = fil_file_readdir_next_file(&err,
366
 
@@ -4538,6 +4662,7 @@
 
406
                                        fil_load_single_table_tablespace(
 
407
@@ -4538,6 +4673,7 @@
367
408
 {
368
409
        fil_space_t*    fnamespace;
369
410
        fil_space_t*    space;
371
412
 
372
413
        ut_ad(fil_system);
373
414
 
374
 
@@ -4615,6 +4740,10 @@
 
415
@@ -4615,6 +4751,10 @@
375
416
                if (fnamespace == NULL) {
376
417
                        if (print_error_if_does_not_exist) {
377
418
                                fil_report_missing_tablespace(name, id);
382
423
                        }
383
424
                } else {
384
425
                        ut_print_timestamp(stderr);
385
 
@@ -4638,6 +4767,10 @@
 
426
@@ -4638,6 +4778,10 @@
386
427
 
387
428
                mutex_exit(&fil_system->mutex);
388
429
 
393
434
                return(FALSE);
394
435
        }
395
436
 
396
 
@@ -4728,6 +4861,7 @@
 
437
@@ -4728,6 +4872,7 @@
397
438
        ulint           page_size;
398
439
        ulint           pages_added;
399
440
        ibool           success;
401
442
 
402
443
        ut_ad(!srv_read_only_mode);
403
444
 
404
 
@@ -4772,13 +4906,17 @@
 
445
@@ -4772,13 +4917,17 @@
405
446
                goto retry;
406
447
        }
407
448
 
420
461
        start_page_no = space->size;
421
462
        file_start_page_no = space->size - node->size;
422
463
 
423
 
@@ -5024,7 +5162,7 @@
 
464
@@ -5024,7 +5173,7 @@
424
465
 off the LRU list if it is in the LRU list. The caller must hold the fil_sys
425
466
 mutex. */
426
467
 static
429
470
 fil_node_prepare_for_io(
430
471
 /*====================*/
431
472
        fil_node_t*     node,   /*!< in: file node */
432
 
@@ -5044,9 +5182,12 @@
 
473
@@ -5044,9 +5193,12 @@
433
474
        }
434
475
 
435
476
        if (node->open == FALSE) {
443
484
        }
444
485
 
445
486
        if (node->n_pending == 0 && fil_space_belongs_in_lru(space)) {
446
 
@@ -5058,6 +5199,8 @@
 
487
@@ -5058,6 +5210,8 @@
447
488
        }
448
489
 
449
490
        node->n_pending++;
452
493
 }
453
494
 
454
495
 /********************************************************************//**
455
 
@@ -5259,6 +5402,16 @@
 
496
@@ -5259,6 +5413,16 @@
456
497
 
457
498
        ut_ad(mode != OS_AIO_IBUF || space->purpose == FIL_TABLESPACE);
458
499
 
469
510
        node = UT_LIST_GET_FIRST(space->chain);
470
511
 
471
512
        for (;;) {
472
 
@@ -5290,7 +5443,11 @@
 
513
@@ -5290,7 +5454,11 @@
473
514
        }
474
515
 
475
516
        /* Open file if closed */
482
523
 
483
524
        /* Check that at least the start offset is within the bounds of a
484
525
        single-table tablespace, including rollback tablespaces. */
485
 
@@ -6164,6 +6321,7 @@
 
526
@@ -6164,6 +6332,7 @@
486
527
        return(err);
487
528
 }
488
529
 
490
531
 /****************************************************************//**
491
532
 Generate redo logs for swapping two .ibd files */
492
533
 UNIV_INTERN
493
 
@@ -6187,4 +6345,4 @@
 
534
@@ -6187,4 +6356,4 @@
494
535
                         0, 0, new_name, old_name, &mtr);
495
536
        mtr_commit(&mtr);
496
537
 }