Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-52204

[Backport MB-51063 to 7.1.2] [CBSE] PickRandom: filterByTiming: Dont refetch the load stats again after leastLoad value is calculated

    XMLWordPrintable

Details

    • Triaged
    • 1
    • Unknown

    Description

      In PickRandom function when we are filtering by scan timings in filterByTiming

       

      ...
      // compute replica with least load.
      sort.Float64s(loadList)
      leastLoad := loadList[0]//
       
      // Filter inst based on load
      //
      for i, instId := range replicas {
          if load, ok := currmeta.loads[common.IndexInstId(instId)]; ok {
              if n, ok := load.getLoad(common.PartitionId(partnId)); ok { 
      ...

      Load stats can change after the computation of the leastLoad and if they change beyond the equivalenceFactor we might endup in not picking any replica to serve the scan

      So we should be using the same loadValues that are used to calculate the leastLoad for filtering the replicas.

       

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            Build couchbase-server-7.1.2-3331 contains indexing commit 80b3ba4 with commit message:
            MB-52204: [BP to 7.1.2 of MB 51063] Dont refetch stats in filterByTiming after finding leastLoad

            build-team Couchbase Build Team added a comment - Build couchbase-server-7.1.2-3331 contains indexing commit 80b3ba4 with commit message: MB-52204 : [BP to 7.1.2 of MB 51063] Dont refetch stats in filterByTiming after finding leastLoad
            pavan.pb Pavan PB added a comment -

            Hi Sai Krishna Teja, is there something the QE needs to do to close this?

            pavan.pb Pavan PB added a comment - Hi Sai Krishna Teja , is there something the QE needs to do to close this?

            Hi Pavan

            Testing this specific use case might need simulation of very corner case scenario and loads on the system must change in very short span. May be we should just run the test where you check the instance selection criteria for scans in presence of multiple replicas is correct or not.

            Thanks
            Sai

            sai.teja Sai Krishna Teja added a comment - Hi Pavan Testing this specific use case might need simulation of very corner case scenario and loads on the system must change in very short span. May be we should just run the test where you check the instance selection criteria for scans in presence of multiple replicas is correct or not. Thanks Sai
            pavan.pb Pavan PB added a comment -

            Hi Sai Krishna Teja As discussed, I've labelled this as request-dev-verify.

            pavan.pb Pavan PB added a comment - Hi Sai Krishna Teja As discussed, I've labelled this as request-dev-verify.

            Tested functionality using the unit test in the review links

            ➜  client git:(neo) env GO111MODULE=off go test -v -vet=off -run TestFilterByTiming
            === RUN   TestFilterByTiming
            2022-07-07T02:46:15.690+05:30 [Info] resp: map[2:map[0:\{"eqivLoad": 200, "leastLoad": 10}]]
            --- PASS: TestFilterByTiming (0.00s)
            PASS
            ok      github.com/couchbase/indexing/secondary/queryport/client    0.820s
            

            sai.teja Sai Krishna Teja added a comment - Tested functionality using the unit test in the review links ➜  client git:(neo) env GO111MODULE=off go test -v -vet=off -run TestFilterByTiming === RUN   TestFilterByTiming 2022-07-07T02:46:15.690+05:30 [Info] resp: map[2:map[0:\{"eqivLoad": 200, "leastLoad": 10}]] --- PASS: TestFilterByTiming (0.00s) PASS ok      github.com/couchbase/indexing/secondary/queryport/client    0.820s

            Build couchbase-server-7.2.0-5000 contains indexing commit 80b3ba4 with commit message:
            MB-52204: [BP to 7.1.2 of MB 51063] Dont refetch stats in filterByTiming after finding leastLoad

            build-team Couchbase Build Team added a comment - Build couchbase-server-7.2.0-5000 contains indexing commit 80b3ba4 with commit message: MB-52204 : [BP to 7.1.2 of MB 51063] Dont refetch stats in filterByTiming after finding leastLoad

            People

              sai.teja Sai Krishna Teja
              amit.kulkarni Amit Kulkarni
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty