Uploaded image for project: 'Apache Cassandra'
  1. Apache Cassandra
  2. CASSANDRA-19651

idealCLWriteLatency metric reports the worst response time instead of the time when ideal CL is satisfied

    XMLWordPrintableJSON

Details

    • Correctness
    • Normal
    • Low Hanging Fruit
    • User Report
    • All
    • None
    • 4.0
    • Hide

      an existing unit test is updated and 2 more are added to cover the issue
      docs updates are not planned

      Show
      an existing unit test is updated and 2 more are added to cover the issue docs updates are not planned

    Description

      org.apache.cassandra.service.AbstractWriteResponseHandler:

      private final void decrementResponseOrExpired()
      {
          int decrementedValue = responsesAndExpirations.decrementAndGet();
          if (decrementedValue == 0)
          {
              // The condition being signaled is a valid proxy for the CL being achieved
              // Only mark it as failed if the requested CL was achieved.
              if (!condition.isSignalled() && requestedCLAchieved)
              {
                  replicaPlan.keyspace().metric.writeFailedIdealCL.inc();
              }
              else
              {
                  replicaPlan.keyspace().metric.idealCLWriteLatency.addNano(nanoTime() - queryStartNanoTime);
              }
          }
      } 

      Actual result: responsesAndExpirations is a total number of replicas across all DCs which does not depend on the ideal CL, so the metric value for replicaPlan.keyspace().metric.idealCLWriteLatency is updated when we get the latest response/timeout for all replicas.
      Expected result: replicaPlan.keyspace().metric.idealCLWriteLatency is updated when we get enough responses from replicas according to the ideal CL.

      Attachments

        Issue Links

          Activity

            People

              dnk Dmitry Konstantinov
              dnk Dmitry Konstantinov
              Dmitry Konstantinov
              Ariel Weisberg
              Votes:
              0 Vote for this issue
              Watchers:
              5 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 - 1h
                  1h