Skip to content

Conversation

ifesdjeen
Copy link
Collaborator

Opening up a separate PR since original tracing PR contains several other commits.

 - Introduce pattern tracing, that can intercept failed or new coordinations matching various filters
 - Support additional tracing event collection modes (SAMPLE and RING)

patch by Benedict; reviewed by Alex Petrov for CASSANDRA-20911
import org.apache.cassandra.distributed.api.IMessageFilters;
import org.apache.cassandra.distributed.api.Row;
import org.apache.cassandra.distributed.api.SimpleQueryResult;
import org.apache.cassandra.distributed.shared.Metrics;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: looks like an unnecessary import

return added;
}

if (++bucketSeen < 0)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to increment once again here given we have just incremented on L648?

if (intersects != null && (participants == null || !intersects.intersects(participants)))
return false;

return chance >= 1.0f || ThreadLocalRandom.current().nextFloat() > chance;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be ThreadLocalRandom.current().nextFloat() <= chance. For example, if we say chance is 0.95 (i.e. there is 95% chance of hitting this), we should return matches for 1.0 (and above), but also anything between 0 and 0.95

{
if (keys != 0) out.append(',');
if (ranges == ALL_KINDS) out.append("R*");
else TinyEnumSet.append(keys, Txn.Kind::forOrdinal, k -> "R" + k.shortName(), out);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be TinyEnumSet.append(ranges?


cur = new TxnEvents();
if (newBucketSubSize < 0)
cur.bucketSubSize = newBucketSize;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we always set bucket sub size to new bucket size if newBucketjsubSize < 0, and not only when cur == null?

In other words, move this if outside of cur == null if statement?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants