Uploaded image for project: 'Percona Server'
  1. Percona Server
  2. PS-4472

convert trx_search_latch_release_if_reserved to a debug assertion/log message

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Done
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 8.0.13-3, 5.7.24-26
    • Component/s: None
    • Labels:

      Description

      Originally reported at https://bugs.mysql.com/bug.php?id=88757:????


      [5 Dec 2017 10:43] Shane Bester*Description:*
      We're seeing this occurring in the wild on 5.7.20:

      InnoDB: Assertion failure in thread x in file trx0trx.ic line 213
      InnoDB: Failing assertion: !trx->has_search_latch

      Look at the code for that:

      /**
      Releases the search latch if trx has reserved it.
      @param[in,out] trx Transaction that may own the AHI latch */
      UNIV_INLINE
      void
      trx_search_latch_release_if_reserved(trx_t* trx)
      {
      ut_a(!trx->has_search_latch);
      }How to repeat:
      Read the code.

      The comments are all wrong whenever this is called.
      This function releases nothing!

      Secondly, the assertion is not needed as far as I can tell,
      and it only caused unnecessary downtime on customer's production.Suggested fix:
      Make it a debug assertion instead, like:
      ut_ad(!trx->has_search_latch);

      Add a message to the error log with detailed info (like print out the trx)
      so the underlying bug can one day still be solved.


      This also affects Percona Server. See PS-3620 for example.

      Please implement required functionality: convert assertion to debug assertion and print additional information into error log file when assertion could happen in release builds. Such as transaction ID, query and everything else which can help to identify source of the error.

        Smart Checklist

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  sveta.smirnova Sveta Smirnova
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: