dcapwell commented on a change in pull request #1180:
URL: https://github.com/apache/cassandra/pull/1180#discussion_r706406595
##########
File path: src/java/org/apache/cassandra/service/reads/ReadCallback.java
##########
@@ -160,24 +202,16 @@ public void awaitResults() throws ReadFailureException,
ReadTimeoutException
*/
int received = resolver.responses.size();
boolean failed = failures > 0 && (blockFor > received ||
!resolver.isDataPresent());
- WarningCounter warnings = warningCounter;
+ WarningContext warnings = warningContext;
+ // save the snapshot so abort state is not changed between now and
when mayAbort gets called
+ TrackWarningsSnapshot snapshot = null;
if (warnings != null)
{
- if (warnings.tombstoneAborts.get() > 0)
- {
- String msg =
tombstoneAbortMessage(warnings.tombstoneAborts.get(),
warnings.maxTombstoneAbortsCount.get(), command.toCQLString());
- ClientWarn.instance.warn(msg + " with " +
command.loggableTokens());
- logger.warn(msg);
- cfs().metric.clientTombstoneAborts.mark();
- }
-
- if (warnings.tombstoneWarnings.get() > 0)
- {
- String msg =
tombstoneWarnMessage(warnings.tombstoneWarnings.get(),
warnings.maxTombstoneWarningCount.get(), command.toCQLString());
- ClientWarn.instance.warn(msg + " with " +
command.loggableTokens());
- logger.warn(msg);
- cfs().metric.clientTombstoneWarnings.mark();
- }
+ snapshot = warnings.snapshot();
+ // this is possible due to race condition
+ // network thread creates the WarningContext to update metrics,
but we are activlly reading and see it is empty
Review comment:
updated documents. Speculative reads could cause this, but so could
timeouts (signal=false)
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]