• unknown's avatar
    Store maximum transaction id into control file at clean shutdown. · 1f566172
    unknown authored
    This can serve to maria_chk to check that trids found in rows and keys
    are not too big. Also used by Recovery when logs are lost.
    Options --require-control-file, --datadir, --log-dir (yes, the dashes are
    inconsistent but I imitated mysqld --datadir and --maria-log-dir) for
    maria_chk.
    Lock control file _before_ reading its content.
    
    
    storage/maria/ha_maria.cc:
      new prototype
    storage/maria/ma_check.c:
      A function to find the max trid in the system (consults transaction
      manager and control file), to check tables.
    storage/maria/ma_checkpoint.c:
      new prototype
    storage/maria/ma_control_file.c:
      Store max trid into control file, in a backward-compatible way
      (can still read old control files).
      Parameter to ma_control_file_open(), to not create the log if it's
      missing (maria_chk needs that).
      Lock control file _before_ reading its content.
      Fix for a segfault when reading an old control file (bzero() with a
      negative second argument)
    storage/maria/ma_control_file.h:
      changes to the control file module's API
    storage/maria/ma_init.c:
      When Maria shuts down cleanly, store max trid into control file.
    storage/maria/ma_loghandler.c:
      new prototype
    storage/maria/ma_recovery.c:
      During recovery, consult max trid stored in control file, in case it is
      bigger than what we found in log (case of logs manually removed by user).
    storage/maria/ma_test1.c:
      new prototype
    storage/maria/ma_test2.c:
      new prototype
    storage/maria/maria_chk.c:
      New option --require-control-file (abort if control file not found),
      --datadir (path for control file (and for logs if --log-dir not specified)),
      --log-dir (path for logs).
      Try to open control file when maria_chk starts.
    storage/maria/maria_read_log.c:
      new prototype
    storage/maria/trnman.c:
      A new function to know max trid in transaction manager
    storage/maria/trnman_public.h:
      New function
    storage/maria/unittest/ma_control_file-t.c:
      new prototypes. Testing storing and retrieving the max trid to/from
      control file
    storage/maria/unittest/ma_test_loghandler-t.c:
      new prototype
    storage/maria/unittest/ma_test_loghandler_first_lsn-t.c:
      new prototype
    storage/maria/unittest/ma_test_loghandler_max_lsn-t.c:
      new prototype
    storage/maria/unittest/ma_test_loghandler_multigroup-t.c:
      new prototype
    storage/maria/unittest/ma_test_loghandler_multithread-t.c:
      new prototype
    storage/maria/unittest/ma_test_loghandler_noflush-t.c:
      new prototype
    storage/maria/unittest/ma_test_loghandler_nologs-t.c:
      new prototype
    storage/maria/unittest/ma_test_loghandler_pagecache-t.c:
      new prototype
    storage/maria/unittest/ma_test_loghandler_purge-t.c:
      new prototype
    1f566172
ma_test2.c 35.4 KB