You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "max-melentyev (via GitHub)" <gi...@apache.org> on 2025/04/07 19:05:23 UTC
Re: [I] Observing Final Query Latency [cassandra-gocql-driver]
max-melentyev commented on issue #1869:
URL: https://github.com/apache/cassandra-gocql-driver/issues/1869#issuecomment-2784293597
I'm not sure how this can be added to the existing code without adding a new observer because every attempt is observed independently and they are not aware if there will be other retries in the case of failure, i.e. for failed attempt should it report its duration as total, or should it wait for a retry attempt and add abserve total latency there.
> That said, I'm curious what the total latency across all attempts is really measuring.
We want to observe the real latency that client code sees. Gocql provides a speculative retries feature, so single Query.Iter() call can result in multiple queries that are observed independently. Consider this case:
```
Attempt 1 |-------- 150 ms ---------------------|
Attempt 2 .. 10 ms ...|---- 10 ms ---| // speculative retry
Query |---- 20 ms ---------------|
```
Observers are receiving 2 items:
1) error: nil, duration: 10ms (attempt 2)
2) error: context canceled, duration: >20ms (attempt 1)
What client code actually observed: error: nil, duration: 20ms
Or this case:
```
Attempt 1 |--- 10 ms ---| Fail
Attempt 2 |---- 10 ms ---| // normal retry
Query |---- 20 ms -----------------|
```
Observers are receiving 2 items:
1) error: failure, duration: 10ms (attempt 1)
2) error: nil, duration: 10ms (attempt 2)
What client code actually observed: error: nil, duration: 20ms
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org