• Annamalai Gurusami's avatar
    Bug #13249921 ASSERT !BPAGE->FILE_PAGE_WAS_FREED, USUALLY IN · 91c8a65a
    Annamalai Gurusami authored
    TRANSACTION ROLLBACK
    
    Description:  During the rollback operation, a blob page 
    is removed earlier than desired.  Consider following scenario:
    
    1. create table t1(a int primary key,b blob) engine=innodb;
    2. insert into t1 values (1,repeat('b',9000));
    3. begin;
    4. update t1 set b=concat(b,'b');
    5. update t1 set a=a+1;
    6. insert into t1 values (1,repeat('b',9000));
    7. rollback;
    
    The update operation in line 5 produces 2 undo log record. The first
    undo record (TRX_UNDO_DEL_MARK_REC) goes to trx->update_undo and the
    second undo record (TRX_UNDO_INSERT_REC) goes to trx->insert_undo.
    During rollback, they are executed out of order.
    
    When the undo record TRX_UNDO_DEL_MARK_REC is applied/executed,
    the blob ownership is also reset.  Because of this the blob page
    is released earlier than desired.  This blob page must have been
    freed only as part of applying/executing the undo record
    TRX_UNDO_INSERT_REC.
    
    This problem can be avoided by executing the undo records in
    order.  This patch will make innodb to execute the undo records
    in order.
    
    rb://1125 approved by Marko.
    91c8a65a
row0undo.c 9.74 KB