Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-4881

Deadlock accessing SYS.SYSSTATISTICS

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 10.3.3.0, 10.4.2.0, 10.5.3.0, 10.6.2.1, 10.7.1.1
    • 10.5.3.2, 10.6.2.4, 10.7.1.1
    • SQL
    • None

    Description

      Transactions accessing index statistics can deadlock if one of them inserts new entries and the other selects from the system table. Inserts happens for instance when update of index statistics are perform manually, or when a table is compressed (given that the table has indexes and contains some rows). This issue may be more problematic when automatic update of index statistics is implemented.
      Issue discovered when writing a regression tests for DERBY-4849, see discussion there. The bug is timing dependent, but has been observed on a variety of JVMs and platform architectures.

      To sum up:
      o using NO_WAIT + retry was suggested, but turned out to be an infeasible solution
      o current approach is to allow using read uncommitted isolation level when accessing statistics in the system table (take no locks)

      Attachments

        1. derby-4881_10_5_diff.txt
          6 kB
          Katherine Marsden
        2. derby-4881-1a-deadlock_fix.diff
          7 kB
          Kristian Waagan
        3. derby-4881-1b-deadlock_fix.diff
          6 kB
          Kristian Waagan

        Issue Links

          Activity

            People

              kristwaa Kristian Waagan
              kristwaa Kristian Waagan
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: