Skip to content

Avoid running query to self through messaging service#278

Closed
ifesdjeen wants to merge 4 commits intoapache:trunkfrom
ifesdjeen:avoid-querying-self-through-ms
Closed

Avoid running query to self through messaging service#278
ifesdjeen wants to merge 4 commits intoapache:trunkfrom
ifesdjeen:avoid-querying-self-through-ms

Conversation

@ifesdjeen
Copy link
Copy Markdown
Contributor

No description provided.


if (to.equals(FBUtilities.getBroadcastAddressAndPort()))
logger.trace("Message-to-self {} going over MessagingService", message);
logger.warn("Message-to-self {} going over MessagingService", message);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Use NoSpamLogger and maybe for the key incorporate the stack trace so we rate limit every call site separately?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

My last thought is that as a user I can't do much with this information. It's mostly harmless, but I also can't fix it other than by filing a bug report.

I think this is the biggest issue with this change. It will cause people worry when nothing is wrong. I think this should be debug not warn because no action is required on part of a user (as opposed to a developer).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Right, we can do debug here. I wanted to first throw in this case, but then thought that it's more useful to find all the cases where we still do that and eliminate those, since failing in that case brings more or less nothing.

MessagingService.instance().sendRRWithFailure(message, to.endpoint(), readCallback);
if (to.isSelf())
{
try (ReadExecutionController executionController = command.executionController();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just asking the question, should this occur in this thread or the read stage?

Is there a possibility of this operation succeeding if the local portion times out? If there is maybe it shouldn't be done synchronously in the request stage?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, you're absolutely right: it is wrong to block this thread for I/O. We in fact have a pattern in order to deal with these things on local execution path: https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/service/reads/AbstractReadExecutor.java#L157 https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/service/reads/ShortReadPartitionsProtection.java#L186

Thanks for pointing that out!


if (to.equals(FBUtilities.getBroadcastAddressAndPort()))
logger.trace("Message-to-self {} going over MessagingService", message);
logger.debug("Message-to-self {} going over MessagingService", message);
Copy link
Copy Markdown
Contributor

@aweisberg aweisberg Oct 9, 2018

Choose a reason for hiding this comment

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

This really needs to be NoSpamLogger? How many times a second might we do this in some cases? What if new code comes that causes this to occur many times a second?

Debug logging is on all the time. That's really not a risk we should be taking.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

To be honest, I think relying on the logging might have been a bad idea. I've left this statement with trace and have rewritten the tests instead.

@ifesdjeen
Copy link
Copy Markdown
Contributor Author

Thank you for the review!

@ifesdjeen ifesdjeen closed this Oct 12, 2018
blambov pushed a commit to blambov/cassandra that referenced this pull request Feb 15, 2022
* STAR-158: Add support for multiple SAI on-disk formats (apache#238)

* STAR-901 Trie and Lucene style terms point id lookup

* STAR-906: Row-awareness for SAI (apache#278)

Co-authored-by: Zhao Yang <zhaoyangsingapore@gmail.com>
Co-authored-by: Piotr Kołaczkowski <pkolaczk@datastax.com>
Co-authored-by: Jason Rutherglen <jasonrutherglen@Jasons-MacBook-Pro.local>
blambov pushed a commit to blambov/cassandra that referenced this pull request Mar 21, 2022
* STAR-158: Add support for multiple SAI on-disk formats (apache#238)

* STAR-901 Trie and Lucene style terms point id lookup

* STAR-906: Row-awareness for SAI (apache#278)

Co-authored-by: Zhao Yang <zhaoyangsingapore@gmail.com>
Co-authored-by: Piotr Kołaczkowski <pkolaczk@datastax.com>
Co-authored-by: Jason Rutherglen <jasonrutherglen@Jasons-MacBook-Pro.local>
(cherry picked from commit 8d9935f)
blambov pushed a commit to blambov/cassandra that referenced this pull request Jun 13, 2022
* STAR-158: Add support for multiple SAI on-disk formats (apache#238)

* STAR-901 Trie and Lucene style terms point id lookup

* STAR-906: Row-awareness for SAI (apache#278)

Co-authored-by: Zhao Yang <zhaoyangsingapore@gmail.com>
Co-authored-by: Piotr Kołaczkowski <pkolaczk@datastax.com>
Co-authored-by: Jason Rutherglen <jasonrutherglen@Jasons-MacBook-Pro.local>
(cherry picked from commit 8d9935f)
(cherry picked from commit 854b299)
blambov pushed a commit to blambov/cassandra that referenced this pull request Nov 24, 2022
* STAR-158: Add support for multiple SAI on-disk formats (apache#238)

* STAR-901 Trie and Lucene style terms point id lookup

* STAR-906: Row-awareness for SAI (apache#278)

Co-authored-by: Zhao Yang <zhaoyangsingapore@gmail.com>
Co-authored-by: Piotr Kołaczkowski <pkolaczk@datastax.com>
Co-authored-by: Jason Rutherglen <jasonrutherglen@Jasons-MacBook-Pro.local>
(cherry picked from commit 8d9935f)
(cherry picked from commit 854b299)
(cherry picked from commit d895ae6)
adelapena pushed a commit to adelapena/cassandra that referenced this pull request Sep 26, 2023
* STAR-158: Add support for multiple SAI on-disk formats (apache#238)

* STAR-901 Trie and Lucene style terms point id lookup

* STAR-906: Row-awareness for SAI (apache#278)

Co-authored-by: Zhao Yang <zhaoyangsingapore@gmail.com>
Co-authored-by: Piotr Kołaczkowski <pkolaczk@datastax.com>
Co-authored-by: Jason Rutherglen <jasonrutherglen@Jasons-MacBook-Pro.local>
(cherry picked from commit 8d9935f)
(cherry picked from commit 854b299)
(cherry picked from commit d895ae6)
(cherry picked from commit 3395487)
(cherry picked from commit c407c2e)
ekaterinadimitrova2 pushed a commit to ekaterinadimitrova2/cassandra that referenced this pull request Jun 3, 2024
* STAR-158: Add support for multiple SAI on-disk formats (apache#238)

* STAR-901 Trie and Lucene style terms point id lookup

* STAR-906: Row-awareness for SAI (apache#278)

Co-authored-by: Zhao Yang <zhaoyangsingapore@gmail.com>
Co-authored-by: Piotr Kołaczkowski <pkolaczk@datastax.com>
Co-authored-by: Jason Rutherglen <jasonrutherglen@Jasons-MacBook-Pro.local>
(cherry picked from commit 8d9935f)
(cherry picked from commit 854b299)
(cherry picked from commit d895ae6)
(cherry picked from commit 3395487)
(cherry picked from commit c407c2e)

KeyFetcher refactor

Cleanup SAI

Fixes for some trivial test failures

There are still some failures in those classes:
org/apache/cassandra/index/sai/disk/v1/SegmentMergerTest.java
org/apache/cassandra/index/sai/functional/FailureTest.java
org/apache/cassandra/index/sai/view/IndexViewManagerTest.java
org/apache/cassandra/index/sai/virtual/IndexesSystemViewTest.java
org/apache/cassandra/index/sai/cql/NativeIndexDDLTest.java

STAR-121 Align flush method signature used with ByteBuddy to SegmentBuilder
michaelsembwever pushed a commit to thelastpickle/cassandra that referenced this pull request Jan 7, 2026
* STAR-158: Add support for multiple SAI on-disk formats (apache#238)

* STAR-901 Trie and Lucene style terms point id lookup

* STAR-906: Row-awareness for SAI (apache#278)

Co-authored-by: Zhao Yang <zhaoyangsingapore@gmail.com>
Co-authored-by: Piotr Kołaczkowski <pkolaczk@datastax.com>
Co-authored-by: Jason Rutherglen <jasonrutherglen@Jasons-MacBook-Pro.local>
(cherry picked from commit 8d9935f)
(cherry picked from commit 854b299)
(cherry picked from commit d895ae6)
(cherry picked from commit 3395487)
(cherry picked from commit c407c2e)

KeyFetcher refactor

Cleanup SAI

Fixes for some trivial test failures

There are still some failures in those classes:
org/apache/cassandra/index/sai/disk/v1/SegmentMergerTest.java
org/apache/cassandra/index/sai/functional/FailureTest.java
org/apache/cassandra/index/sai/view/IndexViewManagerTest.java
org/apache/cassandra/index/sai/virtual/IndexesSystemViewTest.java
org/apache/cassandra/index/sai/cql/NativeIndexDDLTest.java

STAR-121 Align flush method signature used with ByteBuddy to SegmentBuilder
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