• Guilhem Bichot's avatar
    Fix for BUG#41037 "Maria: recovery failure (pushbuild2)" (checkpoint bug). · 91bc9cc9
    Guilhem Bichot authored
    mysql-test/suite/maria/r/maria-recovery3.result:
      result.
    mysql-test/suite/maria/t/maria-recovery3-master.opt:
      usual recovery test options
    mysql-test/suite/maria/t/maria-recovery3.test:
      Test for BUG#41037. Without the bugfix, the test would hang because Recovery would fail with "undo_key_insert got error 126": Recovery would believe INSERT of 2 is uncommitted, try to execute its UNDO_KEY_INSERT, fail to find the key to delete because DELETE deleted it. That failure of _ma_ck_real_delete() would mark table as corrupted (see
      in d_search()) which is error 126 (HA_ERR_CRASHED).
    storage/maria/ma_blockrec.c:
      set trn->rec_lsn to LSN of commit record, when writing it.
    storage/maria/ma_blockrec.h:
      new function
    storage/maria/ma_commit.c:
      when committing or rolling back, rec_lsn should be LSN_IMPOSSIBLE: assertion is moved here
      from trnman_end_trn(), because now ma_commit() can set rec_lsn and so when we reach trnman_end_trn()
      it's not LSN_IMPOSSIBLE anymore.
      Adding debug possibility to pause between COMMIT record write and trnman_commit_trn(), to be
      able to fire checkpoint in between.
    storage/maria/ma_loghandler.c:
      in-write hook for COMMIT records
    storage/maria/ma_recovery.c:
      More debugging info in maria_recovery.trace, to see how the starting point of REDO phase is determined
    storage/maria/trnman.c:
      assertion cannot be here anymore see ma_commit.c
    91bc9cc9
ma_blockrec.h 13 KB