cassandra-pr mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clohfink <...@git.apache.org>
Subject [GitHub] cassandra pull request #258: DecayingEstimatedHistogramReservoir.EstimatedHi...
Date Thu, 06 Sep 2018 14:21:16 GMT
Github user clohfink commented on a diff in the pull request:

    https://github.com/apache/cassandra/pull/258#discussion_r215644267
  
    --- Diff: src/java/org/apache/cassandra/db/ColumnFamilyStore.java ---
    @@ -453,8 +454,12 @@ public void updateSpeculationThreshold()
         {
             try
             {
    -            sampleReadLatencyNanos = metadata().params.speculativeRetry.calculateThreshold(metric.coordinatorReadLatency);
    -            transientWriteLatencyNanos = metadata().params.speculativeWriteThreshold.calculateThreshold(metric.coordinatorWriteLatency);
    +            Snapshot readLatencySnapshot = metric.coordinatorReadLatency.getSnapshot();
    +            if (readLatencySnapshot.size() > 0)
    +                sampleReadLatencyNanos = metadata().params.speculativeRetry.calculateThreshold(readLatencySnapshot);
    +            Snapshot writeLatencySnapshot = metric.coordinatorWriteLatency.getSnapshot();
    +            if (writeLatencySnapshot.size() > 0)
    +                transientWriteLatencyNanos = metadata().params.speculativeWriteThreshold.calculateThreshold(writeLatencySnapshot);
    --- End diff --
    
    Since the size > 0 is really a precondition for calculateThreshold to run successfully,
it seems like the check should be there instead in the policies that require it vs an implicit
undocumented precondition to be checked before in only the existing calls (incase a new entry
point ever created).


---

---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


Mime
View raw message