Uploaded image for project: 'Dev - Nexus'
  1. Dev - Nexus
  2. NEXUS-737

Indexes not being properly created on deploy of tycho-distribution

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.0
    • Fix Version/s: 1.0.2, 1.1
    • Component/s: None
    • Labels:
      None

      Description

      It has been found that upon deploying the tycho-distribution, the index isn't properly updated.

      I have found the reason for this to be that the key used to retrieve parameters from the index is built out of group/artifact/version/classifier. Typically that is fine grained enough, but in certain instances (tycho-dist, nexus-webapp, etc.) that deploy multiple artifacts using the same gavc (i.e. a .zip and a .tar.gz version of a bundle), the index.update() method call isn't working properly. Basically if you have 3 bundles that get uploaded w/ an artifact (a .zip, .tar.gz and .tar.bz2), the last one uploaded is the only item added to the index (as the query parameters will always return the same index item).

      -----------------------------------
      There is a workaround, reindex the repository.

        Activity

        Hide
        mpowers mpowers added a comment - - edited

        I have thought about 3 different solutions to this problem, none of which are all that appealing.

        #1
        Simply add the packaging to the key to access the index. This would only apply to items w/ classifiers
        _Pros _

        • coded it, and it works great

        _Cons _

        • will cause all current consumers of the nexus indexes in the world to either upgrade their code to read the new index keys, or will not have access to any classifier artifacts in the index
        • will cause all current nexus indexes in the world to be useable by newer nexus, however, will not have access to any classifier artifacts

        #2
        Modify nexus to call indexer.index() when an artifact is added
        Pros

        • This will work for newly deployed artifacts

        Cons

        • This will not work for redeploying artifacts, as we cant simply add the index entry again
        • This only solves half the problem (update still stuck)

        #3
        Delete entire gav's index entries upon deploy to nexus, and recreate entire gav's index entries.
        Pros

        • This should work in all cases

        Cons

        • Very inefficient
        Show
        mpowers mpowers added a comment - - edited I have thought about 3 different solutions to this problem, none of which are all that appealing. #1 Simply add the packaging to the key to access the index. This would only apply to items w/ classifiers _Pros _ coded it, and it works great _Cons _ will cause all current consumers of the nexus indexes in the world to either upgrade their code to read the new index keys, or will not have access to any classifier artifacts in the index will cause all current nexus indexes in the world to be useable by newer nexus, however, will not have access to any classifier artifacts #2 Modify nexus to call indexer.index() when an artifact is added Pros This will work for newly deployed artifacts Cons This will not work for redeploying artifacts, as we cant simply add the index entry again This only solves half the problem (update still stuck) #3 Delete entire gav's index entries upon deploy to nexus, and recreate entire gav's index entries. Pros This should work in all cases Cons Very inefficient
        Hide
        mpowers mpowers added a comment -

        Classifiers deployed along with artifacts are now indexed properly.

        Suppose you have 3 extra bundles deployed with your artifact, i.e. artifact-1.0-bundle.zip, artifact-1.0-bundle.tar.gz, etc. they will now all be properly added to the index on deploy, won't require a reindex.

        Show
        mpowers mpowers added a comment - Classifiers deployed along with artifacts are now indexed properly. Suppose you have 3 extra bundles deployed with your artifact, i.e. artifact-1.0-bundle.zip, artifact-1.0-bundle.tar.gz, etc. they will now all be properly added to the index on deploy, won't require a reindex.
        Hide
        mpowers mpowers added a comment -

        we went with #1 solution by the way, main artifacts aren't touched, only classifiers attached to them

        Show
        mpowers mpowers added a comment - we went with #1 solution by the way, main artifacts aren't touched, only classifiers attached to them
        Hide
        koconnor Kristine O'Connor added a comment -

        Spoke with Max:

        deploying the nexus-webapp, has the same effect (w/ multiple classifiers). Then verify after doing the maven deploy that a search in nexus shows the proper results
        just beware, because by default nexus deploys to r.s.o. you will need to modify the forge-parent pom file in your maven repository

        Show
        koconnor Kristine O'Connor added a comment - Spoke with Max: deploying the nexus-webapp, has the same effect (w/ multiple classifiers). Then verify after doing the maven deploy that a search in nexus shows the proper results just beware, because by default nexus deploys to r.s.o. you will need to modify the forge-parent pom file in your maven repository
        Hide
        koconnor Kristine O'Connor added a comment -

        Not having any success with this - waiting for Brian to help me with my mvn setup.

        Show
        koconnor Kristine O'Connor added a comment - Not having any success with this - waiting for Brian to help me with my mvn setup.
        Hide
        koconnor Kristine O'Connor added a comment -

        To test through the UI (steps provided by Max (thank you)

        download the .jar, .pom, -bundle.tar.gz and the -bundle.zip from the place you have been grabbing the 1.0.2 releases
        then upload the jar (using the .pom file), then the 2 bundle items (tar.gz and .zip) (also both using the pom file) but for those 2, set the classifier as bundle, and the extension as the file extension (.zip & .tar.gz) and verify they are all returned in search results, w/o doing a reindex

        Show
        koconnor Kristine O'Connor added a comment - To test through the UI (steps provided by Max (thank you) download the .jar, .pom, -bundle.tar.gz and the -bundle.zip from the place you have been grabbing the 1.0.2 releases then upload the jar (using the .pom file), then the 2 bundle items (tar.gz and .zip) (also both using the pom file) but for those 2, set the classifier as bundle, and the extension as the file extension (.zip & .tar.gz) and verify they are all returned in search results, w/o doing a reindex
        Hide
        koconnor Kristine O'Connor added a comment -

        This is now working correctly - the artifacts appear in the search without having to do a reindex. also, the classifier appears correctly as do the packaging types. Closing defect.

        Show
        koconnor Kristine O'Connor added a comment - This is now working correctly - the artifacts appear in the search without having to do a reindex. also, the classifier appears correctly as do the packaging types. Closing defect.

          People

          • Assignee:
            koconnor Kristine O'Connor
            Reporter:
            bdemers Brian Demers
            Last Updated By:
            Rich Seddon
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Date of First Response:

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0h
              0h
              Logged:
              Time Spent - 2h
              2h