forked from apache/cassandra
-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CNDB-12905: Allow usage of ReadQuery#execute rather than only executeInternal in CQL utests #1564
Open
adelapena
wants to merge
9
commits into
main
Choose a base branch
from
CNDB-12905-main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
81648d3
CNDB-12905: Allow usage of ReadQuery#execute rather than only execute…
adelapena 08c89af
CNDB-12905: Update SAI tests
adelapena f3cfb15
CNDB-12905: Exclude SAI tests for inet from distributed execution
adelapena 0986bad
CNDB-12905: Rename CQLTester#executeDistributed to executeExternal
adelapena 6568d30
CNDB-12905: Start network of CQLTester#enableExternalExecution
adelapena 14a32e3
CNDB-12905: Address review feedback
adelapena 604f35d
CNDB-12905: Fix @BeforeClass initialization order
adelapena e439934
CNDB-12905: Disable coordinator execution in NodeStartupTest
adelapena 447270e
CNDB-12905: Add reference to CNDB-13125
adelapena File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have removed the try-catch block because the only caller of this method is
SystemDistributedKeyspace#viewStatus
, who simply swallows the exception making this wrapping ofRequestValidationException
no-op.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this be an actual bug?
Also, it seems Sonar complains about test coverage in this area.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know, how do you think this could fail?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems
parseAndPrepare
also throws that exception, and it is called by this method.It seems that
parseStatement
(called byparseAndPrepare
) is throwingSyntaxException
that extends theRequestValidationException
.Interesting history - this
execute
method was added with the re-write of the storage engine. The method did not have any callers and theexecute
method implementations were throwing that exception. They stopped throwing it in CASSANDRA-13426 so I guess that was left over.I haven't written particular tests to verify what is going on, just looking around the code. Shall we leave the cleaning for follow-up ticket?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the generic try-catch block in that variant of execute looks like a reminder of the original implementation. The method is only used by
SystemDistributedKeyspace#viewStatus
, which shallows the exception because it's only interested in collecting view statuses for a nodetool command. So it's a no-op. Now we want to re-use the method forQueryTester
, but the useless exception replacement gets in the way and hides the original exception, which we want for our test checks.Do you agree on simply removing the try-catch block, since it doesn't seem to use any purpose? Or I can add a variant of the
QueryProcessor#execute
method without the exception replacement, or even embed it inCQLTester#executeFormattedQuery
, given how simple it is.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, let's remove it, convinced. Just trying not to break something and being extra cautious.