Summary

      Ranking operations are taking a huge delay in Microsoft SQL 2012, when executed in huge instances (reproduced in an instance with more than 1.500.000 issues).
      Due to the delay, the ranking operation times out and fails very frequently. The message below is displayed in the UI:
      "JIRA Agile cannot execute the rank operation at this time. Other users may be ranking the issues that you are trying to rank. Please try again later"

      Environment

      • Tested with Microsoft SQL 2008 and 2012
      • JIRA Agile 6.6.80
      • 1.500.000 issues

      Steps to Reproduce

      1. In a JIRA Instance connected with MSSQL, generate at least 1.000.000 issues
      2. Create a test board and add some hundred of issues to its backlog
      3. Try to rank the issues
      4. This can be reproduced by either ranking a single issue, or ranking multiple issues at the same time

      Expected Results

      The issues should be ranked successfully

      Actual Results

      The following error will be thrown:

      Sometimes it appears that the operation worked, but after refreshing the page the issues are back to their original position in the backlog.

      Workaround

      When affected by this issue, there is one change that have to be implemented to actually workaround this problem:

      1 - Add sendStringParametersAsUnicode=false to the JDBC connection string
      1. Open the $JIRA_HOME/dbconfig.xml file
      2. Append the following option the connection string ;sendStringParametersAsUnicode=false to the jdbc-datasource/url tag value
        • Connection string will look like the following (url might have extra parameters at the end):
          jdbc:jtds:sqlserver://<SERVER_URL>:<SERVER_PORT>/<DB_NAME>;sendStringParametersAsUnicode=false
          
      3. Restart JIRA

            [JSWSERVER-12221] JIRA Agile performs slowly when using Microsoft SQL Server

            asfsdafsad

            i1049919 i1049919 added a comment - asfsdafsad

            April added a comment -

            Please take a look at my comment on JSWSERVER-15917.

            This is not resolved, due to wrong data type is being declared for Quartz tables in in fieldtype-mssql.xml under \WEB-INF\classes\entitydefs

            April added a comment - Please take a look at my comment on  JSWSERVER-15917 . This is not resolved, due to wrong data type is being declared for Quartz tables in in fieldtype-mssql.xml under \WEB-INF\classes\entitydefs

            Please reopen this bug,as this isssue is happening in 7.2.7

            Honeywell JIRA Admin added a comment - Please reopen this bug,as this isssue is happening in 7.2.7

            PS - do not do the workaround, you will no longer be able to paste non ascii characters into your comment fields.

            MiddleAgedMan added a comment - PS - do not do the workaround, you will no longer be able to paste non ascii characters into your comment fields.

            Hi,

            We have put significant amount of work to make ranking faster when working on JSW-13163.
            It makes the operation much faster also on Microsoft SQL Server.

            Therefore I'm closing the issue as fixed. In case of any performance problems, please leave a comment here or ask our support for help and investigation.

            Thanks,
            Jacek Jaroczynski
            JIRA Bugmaster
            [Atlassian]

            Jacek Jaroczynski (Inactive) added a comment - Hi, We have put significant amount of work to make ranking faster when working on JSW-13163 . It makes the operation much faster also on Microsoft SQL Server. Therefore I'm closing the issue as fixed. In case of any performance problems, please leave a comment here or ask our support for help and investigation. Thanks, Jacek Jaroczynski JIRA Bugmaster [Atlassian]

            When we will have a fix for this. How long we have to run

            DROP INDEX [index_ao_60db71_lexorank_rank] ON [dbo].[AO_60DB71_LEXORANK]
            GO
             
            alter table [AO_60DB71_LEXORANK] alter column [rank] nvarchar(255)
            GO
             
            CREATE NONCLUSTERED INDEX [index_ao_60db71_lexorank_rank] ON [dbo].[AO_60DB71_LEXORANK]
            (
                  [RANK] ASC
            )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
            GO 
            
            

            Soon after restarting JIRA.
            Support took 3 months to flag this as a bug and its about to be 5 months passed, since then.

            Rajesh Nayak added a comment - When we will have a fix for this. How long we have to run DROP INDEX [index_ao_60db71_lexorank_rank] ON [dbo].[AO_60DB71_LEXORANK] GO alter table [AO_60DB71_LEXORANK] alter column [rank] nvarchar(255) GO CREATE NONCLUSTERED INDEX [index_ao_60db71_lexorank_rank] ON [dbo].[AO_60DB71_LEXORANK] ( [RANK] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] GO Soon after restarting JIRA. Support took 3 months to flag this as a bug and its about to be 5 months passed, since then.

            vkharisma

            You missed the statement under the work around.
            if we set "sendStringParametersAsUnicode=false", then JIRA failing to work with non English languages. If I enter Russian text in comments, it saves as "???".

            Rajesh Nayak added a comment - vkharisma You missed the statement under the work around. if we set "sendStringParametersAsUnicode=false", then JIRA failing to work with non English languages. If I enter Russian text in comments, it saves as "???".

            At this time, we are using JIRA Agile 6.7.11, with MSSQL 2008 R2, 64 Bit Database server.
            And still we are having the issue. Any resolution or plan to fix this one yet.

            Rajesh Nayak added a comment - At this time, we are using JIRA Agile 6.7.11, with MSSQL 2008 R2, 64 Bit Database server. And still we are having the issue. Any resolution or plan to fix this one yet.

            Rajesh Nayak added a comment - - edited

            I would like to update a test report on this context.

            Observation:

            1. This issue is conversion of String to Unicode and Compare, and the performance overhead on JDBC level.
            2. jTDS JDBC driver do not handle that situation well. To handle that, if we set "sendStringParametersAsUnicode=false", then JIRA failing to work with non English languages. If I enter Russian text in comments, it saves as "???".
            3. As document says, JDBC 4 Spec, handles that well.

            So Test Situations:

            1. I converted Rank column of [AO_60DB71_LEXORANK], to nvarchar(255) from varchar(255) and tested with default jTDS driver and Microsoft JDBC driver 4.2. and found that the rank performance issue is gone, when i run that with JDBC 4.2 driver.

            What I did.

            1. Copied "sqljdbc42.jar" file to JIRA install "\JIRA\lib", where "jtds-1.3.1.jar" do exist.
            2. changed dbconfig.xml file as
               <url>jdbc:sqlserver://localhost:1433;databaseName=jira6test;user=xxxx;password=yyyy;</url>
              		<driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class> 
            3. Started JIRA.
            4. Run this SQL against the database jira6test
               
              DROP INDEX [index_ao_60db71_lexorank_rank] ON [dbo].[AO_60DB71_LEXORANK]
              GO
              
              alter table [AO_60DB71_LEXORANK] alter column [rank] nvarchar(255)
              GO
              
              CREATE NONCLUSTERED INDEX [index_ao_60db71_lexorank_rank] ON [dbo].[AO_60DB71_LEXORANK]
              (
              	[RANK] ASC
              )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
              GO 

            And the Tested, and found that the issue is gone.

            Converting to nvarchar(255), do not give any benefit with jTDS driver.

            Rajesh Nayak added a comment - - edited I would like to update a test report on this context. Observation: This issue is conversion of String to Unicode and Compare, and the performance overhead on JDBC level. jTDS JDBC driver do not handle that situation well. To handle that, if we set "sendStringParametersAsUnicode=false", then JIRA failing to work with non English languages. If I enter Russian text in comments, it saves as "???". As document says, JDBC 4 Spec, handles that well. So Test Situations: I converted Rank column of [AO_60DB71_LEXORANK] , to nvarchar(255) from varchar(255) and tested with default jTDS driver and Microsoft JDBC driver 4.2. and found that the rank performance issue is gone, when i run that with JDBC 4.2 driver. What I did. Copied "sqljdbc42.jar" file to JIRA install "\JIRA\lib", where "jtds-1.3.1.jar" do exist. changed dbconfig.xml file as <url>jdbc:sqlserver://localhost:1433;databaseName=jira6test;user=xxxx;password=yyyy;</url> <driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class> Started JIRA. Run this SQL against the database jira6test DROP INDEX [index_ao_60db71_lexorank_rank] ON [dbo].[AO_60DB71_LEXORANK] GO alter table [AO_60DB71_LEXORANK] alter column [rank] nvarchar(255) GO CREATE NONCLUSTERED INDEX [index_ao_60db71_lexorank_rank] ON [dbo].[AO_60DB71_LEXORANK] ( [RANK] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] GO And the Tested, and found that the issue is gone. Converting to nvarchar(255), do not give any benefit with jTDS driver.

            Yes, we do have this bug. And we are expecting a fix.

            Rajesh Nayak added a comment - Yes, we do have this bug. And we are expecting a fix.

              Unassigned Unassigned
              psouza Pedro Souza
              Affected customers:
              4 This affects my team
              Watchers:
              14 Start watching this issue

                Created:
                Updated:
                Resolved: