• Guilhem Bichot's avatar
    Callers of translog_deassign_id_from_share() need intern_lock. · 3d345b74
    Guilhem Bichot authored
    Assert that keys don't point to bitmap pages.
    
    storage/maria/ma_blockrec.h:
      assertion
    storage/maria/ma_locking.c:
      With concurrent INSERTs, it is possible that two threads enter _ma_mark_file_changed()
      at the same time, so they should serialize their access to the "changed" state/share
      members; another reason is that this function may call _ma_update_state_lsns_sub()
      which may call translog_deassign_id_from_share() (I saw it during testing of
      online backup) which requires the intern_lock mutex.
      As INSERTs only change from "not changed" to "changed", we can first check without mutex:
      if it says "changed", some other thread has set or is setting the variables now,
      we don't need to do it; if it says "not changed", we serialize and re-check.
    3d345b74
ma_locking.c 16.8 KB