Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-17054

Remove unused and duplicate code in DistributedZkUpdateProcessor

    XMLWordPrintableJSON

Details

    • Task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 9.5
    • None
    • None

    Description

      There is dead code and duplicate code in DistributedZkUpdateProcessor. It makes understanding this already complex class more difficult.

      In particular, in getCollectionUrls, there are some unused parameters which make the method more complex than it should be. Because it looked a bit suspicious, broustant investigated and found it was indeed safe to delete:

      I looked at the git history.
      This code comes from a refactor in 2019 of DistributedUpdateProcessor to extract the code specific to cloud. At that time this method signature already contained the boolean.
      Looking earlier, I saw that the boolean was added in 2018 in a commit “Make massive improvements to the tests”. It added the boolean and modified the single call to pass true. Well, I believe it was a perf optimization to always limit to leaders. At that time the intent was clearly to ignore the dead code, and I think the dead code should have been removed from the method instead of adding this boolean.
      So after looking at the context, I’m +1 to remove this dead code.

      Attachments

        Issue Links

          Activity

            People

              broustant Bruno Roustant
              vprimault Vincent Primault
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

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