You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by GitBox <gi...@apache.org> on 2021/08/24 20:32:43 UTC

[GitHub] [cassandra] ifesdjeen commented on a change in pull request #1160: CASSANDRA-16721 Move RepairedDataInfo to the execution controller rather than the ReadCommand to avoid unintended sharing

ifesdjeen commented on a change in pull request #1160:
URL: https://github.com/apache/cassandra/pull/1160#discussion_r694693100



##########
File path: src/java/org/apache/cassandra/db/ReadExecutionController.java
##########
@@ -171,6 +200,51 @@ public void close()
             addSample();
     }
 
+    public boolean isTrackingRepairedStatus()
+    {
+        return repairedDataInfo != RepairedDataInfo.NO_OP_REPAIRED_DATA_INFO;
+    }
+
+    /**
+     * Returns a digest of the repaired data read in the execution of this command.
+     *
+     * If either repaired status tracking is not active or the command has not yet been
+     * executed, then this digest will be an empty buffer.
+     * Otherwise, it will contain a digest* of the repaired data read, or empty buffer

Review comment:
       is `*` after "digest" intended?

##########
File path: src/java/org/apache/cassandra/db/ReadExecutionController.java
##########
@@ -171,6 +200,51 @@ public void close()
             addSample();
     }
 
+    public boolean isTrackingRepairedStatus()
+    {
+        return repairedDataInfo != RepairedDataInfo.NO_OP_REPAIRED_DATA_INFO;
+    }
+
+    /**
+     * Returns a digest of the repaired data read in the execution of this command.
+     *
+     * If either repaired status tracking is not active or the command has not yet been
+     * executed, then this digest will be an empty buffer.
+     * Otherwise, it will contain a digest* of the repaired data read, or empty buffer
+     * if no repaired data was read.
+     * @return digest of the repaired data read in the execution of the command
+     */
+    public ByteBuffer getRepairedDataDigest()
+    {
+        return repairedDataInfo.getDigest();
+    }
+
+    /**
+     * Returns a boolean indicating whether any relevant sstables were skipped during the read
+     * that produced the repaired data digest.
+     *
+     * If true, then no pending repair sessions or partition deletes have influenced the extent
+     * of the repaired sstables that went into generating the digest.
+     * This indicates whether or not the digest can reliably be used to infer consistency
+     * issues between the repaired sets across replicas.
+     *
+     * If either repaired status tracking is not active or the command has not yet been
+     * executed, then this will always return true.
+     *
+     * @return boolean to indicate confidence in the dwhether or not the digest of the repaired data can be

Review comment:
       `dwether`  -> `wether`

##########
File path: src/java/org/apache/cassandra/service/reads/AbstractReadExecutor.java
##########
@@ -155,7 +156,11 @@ private void makeRequests(ReadCommand readCommand, Iterable<Replica> replicas)
         if (hasLocalEndpoint)
         {
             logger.trace("reading {} locally", readCommand.isDigestQuery() ? "digest" : "data");
-            Stage.READ.maybeExecuteImmediately(new LocalReadRunnable(command, handler));
+
+            if (TEST_FORCE_ASYNC_LOCAL_READS)
+                new Thread(new LocalReadRunnable(readCommand, handler)).start();

Review comment:
       wondering if it could be best to just create a separate method for executing read runnable, and using ByteBuddy during test




-- 
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: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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