Uploaded image for project: 'Artifactory Binary Repository'
  1. Artifactory Binary Repository
  2. RTFACT-18006

Synchronous debian reindexing of an entire debian repository is very slow after upgrading Artifactory from version 4.16.1 to 6.5.X

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.7.0
    • Component/s: Debian, Metadata
    • Labels:
      None

      Description

      Please note that this issue is seen only when you upgrade from version 4.16.1 to 6.5.X. If you install a new instance with version 6.5.X you won’t run into this issue.

      The slowness seems to be caused by a lot of additional database queries that are being run during the synchronous debian reindexing after upgrading from 4.16.1 to 6.5.X. In version 4.16.1 during the synchronous debian reindexing we don’t see the additional database queries. But when you upgrade the 4.16.1 version to 6.5.X we notice a huge delay in the time taken to complete synchronous reindexing of a debian repository.

      When we enabled the jdbc loggers after upgrading to 6.5.X we noticed that there were a lot of queries similar to the below example seen in the logs during the time of the indexing. These database queries are not seen in version 4.16.1 and also if you install a brand new 6.5.X instance. Also each of this sort of query for a specific debian artifact is executed about 8 to 9 times, so when you have a large debian repo the number of queries would be 8 times the number of debian artifacts.

       

      2018-11-20 05:13:03,231 [art-exec-193252] [DEBUG] (o.j.s.JdbcHelper    :65) - Executing SQL: 'SELECT node_id FROM nodes WHERE repo = 'debian-local' AND node_path = 'pool/r/revolutions-dynimo-sampleapp' AND node_name = 'revolutions-dynimo-sampleapp_1.0-h263.cc7deb7_all.deb''.

      2018-11-20 05:13:03,232 [art-exec-193252] [DEBUG] (o.j.s.JdbcHelper    :177) - Query returned in 826012 nanos : 'SELECT node_id FROM nodes WHERE repo = 'debian-local' AND node_path = 'pool/r/revolutions-dynimo-sampleapp' AND node_name = 'revolutions-dynimo-sampleapp_1.0-h263.cc7deb7_all.deb''

       2018-11-20 05:13:03,509 [art-exec-193252] [DEBUG] (o.j.s.JdbcHelper    :65) - Executing SQL: 'SELECT node_id FROM nodes WHERE repo = 'debian-local' AND node_path = 'pool/v/vitalstatistix' AND node_name = 'vitalstatistix_0.0.1-h221.45ff03e_all.deb''.

       2018-11-20 05:13:03,510 [art-exec-193252] [DEBUG] (o.j.s.JdbcHelper    :177) - Query returned in 819975 nanos : 'SELECT node_id FROM nodes WHERE repo = 'debian-local' AND node_path = 'pool/v/vitalstatistix' AND node_name = 'vitalstatistix_0.0.1-h221.45ff03e_all.deb''

       

      In version 4.16.1 when these database queries are not seen the synchronous reindexing is completed in less than 2 minutes for a repo and distribution that has about 55,000 artifacts. But when you upgrade to 6.5.X you will see that the reindex of the same repository takes about 15 to 20 minutes to complete.

      As a test i ran the Sha256 migration on the upgraded 6.5.X instance where we see these database queries. After the sha256 migration is completed the debian reindexing is completed in less than 2 minutes again and we don’t see the additional database queries anymore during the metadata calculation process.

       

      The fix for the issue should disable the additional database queries that are being executed during synchronous reindex after upgrading to 6.5.X where Sha256 entries are absent. We can't ask the customer to run Sha256 migration after they upgrade as a workaround for this issue, due to the fact that it takes a lot of time to do the migration when you have millions of artifacts in Artifactory. 

      If 4.16.1 which did not have sha256 entries in database does not need to execute these queries for debian reindexing, then why does an upgrade from 4.16.1 to 6.5.X introduce these additional queries? It should still work the same way without the sha256 entries in version 6.5.X. 

        Attachments

          Activity

            People

            • Assignee:
              shayb Shay Bagants
              Reporter:
              nihalc@jfrog.com Nihal Reddy Chinna Choudhary
              Assigned QA:
              Maria Pogozelits
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: