Uploaded image for project: 'Jira Service Management Data Center'
  1. Jira Service Management Data Center
  2. JSDSERVER-8504

High issue activity can cause pressure on database due to count(*) statement on AO_319474_MESSAGE

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Medium Medium
    • 4.19.0
    • 4.9.0
    • SLA
    • None

      Issue Summary

      When Jira is under high load from user actions (issue edit, comment, etc), rows are inserted into the AO_319474_MESSAGE table.

      If the rate of message consumption is less than the rate of messages being added, this table grows to a very large size.

      When queue's are accessed, JSM issues a count query against the AO_319474_MESSAGE table that can be expensive depending on the database.

      Steps to Reproduce

      1. Set dark feature sd.internal.base.db.backed.completion.events.enabled
      2. Place a high load into Jira, such that the MESSAGE table grows very large (for instance, 800K rows)
      3. Observe select * from pg_stat_activity and note the high load against the database from the statement below.

      Expected Results

      This bottleneck is not present.

      Actual Results

      The following query is highly active on the database:

      select count(*) from "public"."AO_319474_MESSAGE" "AO_319474_MESSAGE" where "AO_319474_MESSAGE"."QUEUE_ID" = ?
      and ("AO_319474_MESSAGE"."CLAIMANT" is null or "AO_319474_MESSAGE"."CLAIMANT" is not null
      and ("AO_319474_MESSAGE"."CLAIMANT_TIME" is null or "AO_319474_MESSAGE"."CLAIMANT_TIME" < ?)
      

      Resource contention can occur and affect the performance of Jira.

      Workaround

      Disable off-thread functionality by setting:

      sd.internal.bounded.off.thread.on.completion.events.disabled
      sd.internal.base.off.thread.on.completion.events.disabled 

            [JSDSERVER-8504] High issue activity can cause pressure on database due to count(*) statement on AO_319474_MESSAGE

            There are no comments yet on this issue.

              kkanojia Kunal Kanojia
              allewellyn@atlassian.com Alex [Atlassian,PSE]
              Affected customers:
              0 This affects my team
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: