Calculating remaining time millis should guard against empty values

XMLWordPrintableJSON

    • Cluster Scalability
    • ClusterScalability May12-May25
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      Resharding uses the following formula to calculate the estimated remaining time millis for the recipient.

      remainingMsec = 1.0 * elapsedTime.count() * (totalWork / elapsedWork - 1)

      The elapsed time is determined via

      getElapsed<Milliseconds>(TimedPhase::kApplying, getClockSource()).value_or(Seconds{0}) 

      This will lead to an estimated remaining time value of 0 if we have an empty elapsed value. We can reason this will not be the case if we handle metrics well and never drop any values, but we should update the logic in case we missed some edge case and we do lose the value.

      I do not know if we currently hit the .value_or case and it leads to miscalculated values, but updating would be a defensive approach to ensure this never happens.

            Assignee:
            Abdul Qadeer
            Reporter:
            Ben Gawel
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: