Skip to content

Commit 53623d9

Browse files
author
Jan Lindström
committed
MDEV-8522: InnoDB: Assertion failure in file fil0fil.cc line 475
Analysis: In fil_crypt_space_needs_rotation we first make sure that tablespace is found and then separately that it is normal tablespace. Thus, tablespace could be dropped between these two functions calls. Fix: If space is not found from fil_system return tablespace type ULINT_UNDEFINED and naturally do not continue rotating space.
1 parent 62b5a56 commit 53623d9

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

storage/innobase/fil/fil0fil.cc

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -457,26 +457,29 @@ fil_space_get_latch(
457457

458458
/*******************************************************************//**
459459
Returns the type of a file space.
460-
@return FIL_TABLESPACE or FIL_LOG */
460+
@return ULINT_UNDEFINED, or FIL_TABLESPACE or FIL_LOG */
461461
UNIV_INTERN
462462
ulint
463463
fil_space_get_type(
464464
/*===============*/
465465
ulint id) /*!< in: space id */
466466
{
467467
fil_space_t* space;
468+
ulint type = ULINT_UNDEFINED;
468469

469470
ut_ad(fil_system);
470471

471472
mutex_enter(&fil_system->mutex);
472473

473474
space = fil_space_get_by_id(id);
474475

475-
ut_a(space);
476-
477476
mutex_exit(&fil_system->mutex);
478477

479-
return(space->purpose);
478+
if (space) {
479+
type = space->purpose;
480+
}
481+
482+
return(type);
480483
}
481484
#endif /* !UNIV_HOTBACKUP */
482485

storage/xtradb/fil/fil0fil.cc

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -460,26 +460,29 @@ fil_space_get_latch(
460460

461461
/*******************************************************************//**
462462
Returns the type of a file space.
463-
@return FIL_TABLESPACE or FIL_LOG */
463+
@return ULINT_UNDEFINED, or FIL_TABLESPACE or FIL_LOG */
464464
UNIV_INTERN
465465
ulint
466466
fil_space_get_type(
467467
/*===============*/
468468
ulint id) /*!< in: space id */
469469
{
470470
fil_space_t* space;
471+
ulint type = ULINT_UNDEFINED;
471472

472473
ut_ad(fil_system);
473474

474475
mutex_enter(&fil_system->mutex);
475476

476477
space = fil_space_get_by_id(id);
477478

478-
ut_a(space);
479-
480479
mutex_exit(&fil_system->mutex);
481480

482-
return(space->purpose);
481+
if (space) {
482+
type = space->purpose;
483+
}
484+
485+
return(type);
483486
}
484487
#endif /* !UNIV_HOTBACKUP */
485488

0 commit comments

Comments
 (0)