Derby
  1. Derby
  2. DERBY-4881

Deadlock accessing SYS.SYSSTATISTICS

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 10.3.3.0, 10.4.2.0, 10.5.3.0, 10.6.2.1, 10.7.1.1
    • Fix Version/s: 10.5.3.2, 10.6.2.4, 10.7.1.1
    • Component/s: SQL
    • Labels:
      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)

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

        Issue Links

          Activity

          No work has yet been logged on this issue.

            People

            • Assignee:
              Kristian Waagan
              Reporter:
              Kristian Waagan
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development