-
Notifications
You must be signed in to change notification settings - Fork 994
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
PHOENIX-5712 Got SYSCAT ILLEGAL_DATA exception after created tenant i… #972
Conversation
6a5a89e
to
5ff9c76
Compare
💔 -1 overall
This message was automatically generated. |
phoenix-core/src/main/java/org/apache/phoenix/compile/QueryCompiler.java
Outdated
Show resolved
Hide resolved
3c45566
to
6b5bb0e
Compare
Added filter at the Coproc preScannerOpen method as we discussed offline. Please take a look again, thanks! |
💔 -1 overall
This message was automatically generated. |
// pre-splittable client should always using SMALLINT | ||
if (type == NULL_DATA_TYPE_VALUE && viewIndexIdCell.getValueLength() > | ||
VIEW_INDEX_ID_SMALLINT_TYPE_VALUE_LEN) { | ||
Cell keyValue = ViewIndexIdRetrieveUtil. |
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.
What if there is a legitimate long number (not just extra bits, but actually large) here. We will shorten it to a SMALLINT and it becomes unusable right? Although based on offline discussions, seems like that case already means this view index ID is unqueryable. Should we trace log this or track it via a metric or something?
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.
Can you provide an example of a legitimate long number? Do you mean when a value here is greater than the SHORT.MAX_VALUE? Yeah, if that's the case the value that we send back to the client will lose some data precision but still queryable.
phoenix-core/src/main/java/org/apache/phoenix/filter/SyscatViewIndexIdFilter.java
Outdated
Show resolved
Hide resolved
phoenix-core/src/main/java/org/apache/phoenix/filter/SyscatViewIndexIdFilter.java
Outdated
Show resolved
Hide resolved
Had a quick glance and added some review comments. As discussed offline, please add more comments based on various |
phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIndexIdRetrieveIT.java
Outdated
Show resolved
Hide resolved
phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIndexIdRetrieveIT.java
Outdated
Show resolved
Hide resolved
phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIndexIdRetrieveIT.java
Outdated
Show resolved
Hide resolved
phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIndexIdRetrieveIT.java
Show resolved
Hide resolved
phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIndexIdRetrieveIT.java
Outdated
Show resolved
Hide resolved
phoenix-core/src/main/java/org/apache/phoenix/compile/QueryCompiler.java
Outdated
Show resolved
Hide resolved
/** | ||
* Coprocessor that checks whether the VIEW_INDEX_ID needs to retrieve. | ||
*/ | ||
public class SyscatRegionObserver extends BaseRegionObserver { |
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.
Can we rename this coproc so it indicates that it is for view_index_id queries on system.catalog instead of this generic name?
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.
if we want to do something special for the syscat in the future, we don't need to create a new coproc. In fact, we can add on new logic to this existing coproc.
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 makes sense. Can you rename it to SystemCatalogRegionObserver
in that case?
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.
sure. renamed to SystemCatalogRegionObserver
public RegionScanner preScannerOpen(ObserverContext<RegionCoprocessorEnvironment> e, Scan scan, | ||
RegionScanner s) throws IOException { | ||
int clientVersion = ScanUtil.getClientVersion(scan); | ||
if (clientVersion != UNKNOWN_CLIENT_VERSION) { |
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.
nit: Not sure I understand why we don't care about 4.4.0 clients (not that it matters really). What is it for?
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.
since corpoc is not only for the phoenix, but it also works for the HBase. We don't want to change the behavior other than the Phoenix environment.
The ScanUtil.getClientVersion returns UNKNOWN_CLIENT_VERSION if the phoenix client version is not setup.
phoenix-core/src/main/java/org/apache/phoenix/filter/SyscatViewIndexIdFilter.java
Outdated
Show resolved
Hide resolved
phoenix-core/src/main/java/org/apache/phoenix/filter/SyscatViewIndexIdFilter.java
Outdated
Show resolved
Hide resolved
💔 -1 overall
This message was automatically generated. |
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.
Couple of nits otherwise +1
a coproc that checks the client request version and send it back to the client. | ||
For more information, please see PHOENIX-3547, PHOENIX-5712 | ||
*/ | ||
public class ViewIndexIdRetrieveIT extends BaseOwnClusterIT { |
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.
The comment in BaseOwnClusterIT
says "Any new integration tests that need their own mini cluster should be extending {@link BaseUniqueNamesOwnClusterIT} class directly" so maybe we want to do that and then use uniqueNames for all table/view/index names etc.
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.
changed to BaseUniqueNamesOwnClusterIT
.
All table/view/index are all using generateUniqueName method to get a unique name.
phoenix-core/src/main/java/org/apache/phoenix/coprocessor/SyscatRegionObserver.java
Outdated
Show resolved
Hide resolved
This is combination of diff client created view index looks like: | ||
|
||
client VIEW_INDEX_ID(Cell number of bytes) VIEW_INDEX_ID_DATA_TYPE | ||
pre-4.14 2 bytes NULL |
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.
this should be pre-4.15 right?
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.
right. fixed typo
phoenix-core/src/main/java/org/apache/phoenix/filter/SystemCatalogViewIndexIdFilter.java
Outdated
Show resolved
Hide resolved
💔 -1 overall
This message was automatically generated. |
…ndex on view