-
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-5103: Can't create/drop table using 4.14 client against 4.15 server (Addendum) #607
PHOENIX-5103: Can't create/drop table using 4.14 client against 4.15 server (Addendum) #607
Conversation
server (Addendum)
@vincentpoon @twdsilva @kadirozde @lhofhansl please review. |
Bytes.toString(tenantId), Bytes.toString(schemaName), | ||
Bytes.toString(tableName), this.accessCheckEnabled); | ||
} | ||
// else: the client version is old, so we cannot add a task to cleanup |
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 the client is older than 4.15 we should just throw an exception if they try to drop a base table that has child views.
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.
@twdsilva makes sense. I will handle that as part of PHOENIX-5544. Do the other changes to support creating/dropping a table look good?
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.
SGTM.
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.
+1
Bytes.toString(tenantId), Bytes.toString(schemaName), | ||
Bytes.toString(tableName), this.accessCheckEnabled); | ||
} | ||
// else: the client version is old, so we cannot add a task to cleanup |
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.
SGTM.
Thanks for the review @twdsilva |
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.
One bug (I think) and a couple nits
ViewUtil.dropChildViews(env, tenantIdBytes, schemaName, tableName); | ||
if (!Bytes.toString(schemaName).equals(QueryConstants.SYSTEM_SCHEMA_NAME)) { | ||
byte[] sysCatOrSysChildLink = SchemaUtil.getPhysicalTableName( | ||
clientVersion >= MIN_SPLITTABLE_SYSTEM_CATALOG ? |
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: this would be much easier to read if you extracted the clientVersion -> table byte logic into its own method
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 did this as part of PHOENIX-5544 (#620)
phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java
Show resolved
Hide resolved
@@ -361,6 +361,11 @@ public boolean isUpgradeRequired() { | |||
return getDelegate().isUpgradeRequired(); | |||
} | |||
|
|||
@Override | |||
public void clearUpgradeRequired() { | |||
getDelegate().isUpgradeRequired(); |
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.
Shouldn't this be getDelegate.clearUpgradeRequired(); ?
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.
Good catch! Copy-paste error. Luckily this method is never really used in our upgrade code path since we use the CQSI.clearUpgradeRequired
. I will add this to my changes for PHOENIX-5544 since it works with relatively the same path and 5103 is already committed.
No description provided.