Skip to content

Conversation

@smiklosovic
Copy link
Contributor

patch by Stefan Miklosovic; reviewed by TBD for CASSANDRA-20858

Thanks for sending a pull request! Here are some tips if you're new here:

  • Ensure you have added or run the appropriate tests for your PR.
  • Be sure to keep the PR description updated to reflect all changes.
  • Write your PR title to summarize what this PR proposes.
  • If possible, provide a concise example to reproduce the issue for a faster review.
  • Read our contributor guidelines
  • If you're making a documentation change, see our guide to documentation contribution

Commit messages should follow the following format:

<One sentence description, usually Jira title or CHANGES.txt summary>

<Optional lengthier description (context on patch)>

patch by <Authors>; reviewed by <Reviewers> for CASSANDRA-#####

Co-authored-by: Name1 <email1>
Co-authored-by: Name2 <email2>

The Cassandra Jira

@smiklosovic smiklosovic force-pushed the CASSANDRA-20858 branch 2 times, most recently from 3614cea to bfc7631 Compare September 1, 2025 16:34
patch by Stefan Miklosovic; reviewed by TBD for CASSANDRA-20858
if (vtable == null)
{
foundVtable = getVirtualTable(SlowQueriesTable.class, tableName);
foundVtable = getVirtualTable(vtableClass, tableName);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is actually a bug in the current code

}
else
{
mergeInto.count += 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

if I am not mistaken then a recent repeated exception info will be evicted if a list is full, even it happened just before an exception which makes the list full..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, but that will happen when you get 1000 different exceptions and you go to insert 1001st which is different from everything else. Exceptions are "merged".

synchronized (buffer)
{
ExceptionRow mergeInto = null;
for (ExceptionRow row : buffer)
Copy link
Contributor

@netudima netudima Sep 1, 2025

Choose a reason for hiding this comment

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

such iteration can be costly for big buffer and/or when an exception happen frequently, so it may cause delays/CPU consumption in a processing path...

Copy link
Contributor Author

@smiklosovic smiklosovic Sep 2, 2025

Choose a reason for hiding this comment

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

I do not think this is a problem. Beware that this is de-duplicated. You would need to have 1000 different exception types thrown to iterate over it in some excessive fashion. If you have 1000 exceptions thrown you have way bigger problems than iterating over this "slowly".

Anyway, I have reworked it to use bounded map approach here

https://github.com/apache/cassandra/pull/4356/files

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For example, if we get FSError, that is one exception type. So all FSError exceptions will be deduplicated into one entry.

Copy link
Contributor

Choose a reason for hiding this comment

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

yes, agree, I would expect just few exception types here, volumes are caused by instances not by types

@smiklosovic
Copy link
Contributor Author

closing in favor of #4356

@smiklosovic smiklosovic closed this Sep 2, 2025
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.

3 participants