You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@phoenix.apache.org by GitBox <gi...@apache.org> on 2020/05/29 19:32:31 UTC
[GitHub] [phoenix] nsgupta1 opened a new pull request #792: PHOENIX-5920 Skip SYSTEM TABLE checks while creating phoenix connection if client has set the DoNotUpgrade config
nsgupta1 opened a new pull request #792:
URL: https://github.com/apache/phoenix/pull/792
I've made following changes to honor "DoNotUpgrade" config:
1. This PR makes a strong assumption that if client has set "DoNotUpgrade" config server already has SYSCAT tables even for firstConnection where isAutoUpgrade prop is enabled by default.
2. If "DoNotUpgrade" is set we are only doing client-server compatibility check and namespace checks.
3. We are skipping SYSCAT existence and timestamp related checks if "DoNotUpgrade" config is set.
I can remove the test cases that I've marked as ignore once we finalize its a valid removal.
@ChinmaySKulkarni @dbwong @gjacoby126 @jpisaac can you please review this PR ?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [phoenix] gjacoby126 commented on pull request #792: PHOENIX-5920 Skip SYSTEM TABLE checks while creating phoenix connection if client has set the DoNotUpgrade config
Posted by GitBox <gi...@apache.org>.
gjacoby126 commented on pull request #792:
URL: https://github.com/apache/phoenix/pull/792#issuecomment-744717719
JIRA is resolved, closing PR
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [phoenix] nsgupta1 commented on a change in pull request #792: PHOENIX-5920 Skip SYSTEM TABLE checks while creating phoenix connection if client has set the DoNotUpgrade config
Posted by GitBox <gi...@apache.org>.
nsgupta1 commented on a change in pull request #792:
URL: https://github.com/apache/phoenix/pull/792#discussion_r432799687
##########
File path: phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
##########
@@ -1546,17 +1538,14 @@ public GetVersionResponse call(MetaDataService instance)
MetaDataUtil.ClientServerCompatibility compatibility = MetaDataUtil.areClientAndServerCompatible(serverJarVersion);
if (!compatibility.getIsCompatible()) {
if (compatibility.getErrorCode() == SQLExceptionCode.OUTDATED_JARS.getErrorCode()) {
- HRegionLocation name = regionMap.get(result.getKey());
errorMessage.append("Newer Phoenix clients can't communicate with older "
+ "Phoenix servers. Client version: "
+ MetaDataProtocol.CURRENT_CLIENT_VERSION
+ "; Server version: "
+ getServerVersion(serverJarVersion)
+ " The following servers require an updated "
+ QueryConstants.DEFAULT_COPROCESS_JAR_NAME
- + " to be put in the classpath of HBase: ");
- errorMessage.append(name);
- errorMessage.append(';');
+ + " to be put in the classpath of HBase; ");
Review comment:
Changed the error message.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [phoenix] dbwong commented on a change in pull request #792: PHOENIX-5920 Skip SYSTEM TABLE checks while creating phoenix connection if client has set the DoNotUpgrade config
Posted by GitBox <gi...@apache.org>.
dbwong commented on a change in pull request #792:
URL: https://github.com/apache/phoenix/pull/792#discussion_r432695474
##########
File path: phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
##########
@@ -1307,131 +1307,136 @@ private TableDescriptor ensureTableCreated(byte[] physicalTableName, PTableType
}
}
- try {
- existingDesc = admin.getDescriptor(TableName.valueOf(physicalTableName));
- } catch (org.apache.hadoop.hbase.TableNotFoundException e) {
- tableExist = false;
- if (tableType == PTableType.VIEW) {
- String fullTableName = Bytes.toString(physicalTableName);
- throw new ReadOnlyTableException(
- "An HBase table for a VIEW must already exist",
- SchemaUtil.getSchemaNameFromFullName(fullTableName),
- SchemaUtil.getTableNameFromFullName(fullTableName));
+ // If DoNotUpgrade config is set only check namespace mapping and
Review comment:
If we have to modify in here maybe we can trigger this on a parameter for it being used for initializing system tables?
##########
File path: phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
##########
@@ -1307,131 +1307,136 @@ private TableDescriptor ensureTableCreated(byte[] physicalTableName, PTableType
}
}
- try {
- existingDesc = admin.getDescriptor(TableName.valueOf(physicalTableName));
- } catch (org.apache.hadoop.hbase.TableNotFoundException e) {
- tableExist = false;
- if (tableType == PTableType.VIEW) {
- String fullTableName = Bytes.toString(physicalTableName);
- throw new ReadOnlyTableException(
- "An HBase table for a VIEW must already exist",
- SchemaUtil.getSchemaNameFromFullName(fullTableName),
- SchemaUtil.getTableNameFromFullName(fullTableName));
+ // If DoNotUpgrade config is set only check namespace mapping and
Review comment:
Why are we trying to handle this in the ensureTableCreated path? I think this will be used on other calls rather than just init.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [phoenix] nsgupta1 commented on a change in pull request #792: PHOENIX-5920 Skip SYSTEM TABLE checks while creating phoenix connection if client has set the DoNotUpgrade config
Posted by GitBox <gi...@apache.org>.
nsgupta1 commented on a change in pull request #792:
URL: https://github.com/apache/phoenix/pull/792#discussion_r432718347
##########
File path: phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
##########
@@ -1307,131 +1307,136 @@ private TableDescriptor ensureTableCreated(byte[] physicalTableName, PTableType
}
}
- try {
- existingDesc = admin.getDescriptor(TableName.valueOf(physicalTableName));
- } catch (org.apache.hadoop.hbase.TableNotFoundException e) {
- tableExist = false;
- if (tableType == PTableType.VIEW) {
- String fullTableName = Bytes.toString(physicalTableName);
- throw new ReadOnlyTableException(
- "An HBase table for a VIEW must already exist",
- SchemaUtil.getSchemaNameFromFullName(fullTableName),
- SchemaUtil.getTableNameFromFullName(fullTableName));
+ // If DoNotUpgrade config is set only check namespace mapping and
Review comment:
Yes, you are right, this check should only be for system tables. I'll modify this
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [phoenix] nsgupta1 commented on a change in pull request #792: PHOENIX-5920 Skip SYSTEM TABLE checks while creating phoenix connection if client has set the DoNotUpgrade config
Posted by GitBox <gi...@apache.org>.
nsgupta1 commented on a change in pull request #792:
URL: https://github.com/apache/phoenix/pull/792#discussion_r432799902
##########
File path: phoenix-core/src/it/java/org/apache/phoenix/end2end/SystemCatalogCreationOnConnectionIT.java
##########
@@ -658,4 +670,30 @@ private Properties getClientProperties(boolean nsMappingEnabled, boolean systemT
assertFalse(isSystemNamespaceCreated());
return driver;
}
+
+ @Test
+ public void testDoNotUpgradePropSet() throws Exception {
+ String tableName = "HBASE_SYNTH_TEST";
+ startMiniClusterWithToggleNamespaceMapping(Boolean.FALSE.toString());
+ Properties propsDoNotUpgradePropSet = new Properties();
+ // Create a dummy connection to make sure we have all system tables in place
+ Connection con1 = DriverManager.getConnection(getJdbcUrl(),propsDoNotUpgradePropSet);
+ String ddl = "CREATE TABLE "+ tableName +" (PK1 VARCHAR not null, PK2 VARCHAR not null, "
+ + "COL1 varchar, COL2 varchar " + "CONSTRAINT pk PRIMARY KEY(PK1,PK2))";
+ con1.createStatement().execute(ddl);
+ con1.createStatement().execute("UPSERT INTO " + tableName + " values ('pk1','pk2','c1','c2')");
+ con1.commit();
+ // Stop HMaster to check if we can create connection without active HMaster
+ testUtil.getMiniHBaseCluster().getMaster().stopMaster();
Review comment:
I tried to start hmaster later but it didn't work. I'll check and put this one in next commit.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [phoenix] ChinmaySKulkarni commented on a change in pull request #792: PHOENIX-5920 Skip SYSTEM TABLE checks while creating phoenix connection if client has set the DoNotUpgrade config
Posted by GitBox <gi...@apache.org>.
ChinmaySKulkarni commented on a change in pull request #792:
URL: https://github.com/apache/phoenix/pull/792#discussion_r432771921
##########
File path: phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
##########
@@ -1306,6 +1306,12 @@ private TableDescriptor ensureTableCreated(byte[] physicalTableName, PTableType
.build().buildException();
}
}
+ // If DoNotUpgrade config is set only check namespace mapping and
+ // Client-server compatibility for system tables.
+ if(isDoNotUpgradePropSet && SchemaUtil.isSystemTable(physicalTableName)) {
Review comment:
This should check for `isMetaTable == true` (only check when creating SYSTEM.CATALOG) rather than just checking that it's a SYSTEM table, otherwise this gets called for each SYSTEM table which is not required. Even in the existing code, `checkClientServerCompatibility` is only called when trying to create `SYSTEM.CATALOG`.
##########
File path: phoenix-core/src/it/java/org/apache/phoenix/end2end/SystemCatalogCreationOnConnectionIT.java
##########
@@ -171,6 +173,7 @@ public void tearDownMiniCluster() {
// Conditions: isDoNotUpgradePropSet is true
// Expected: We do not create SYSTEM.CATALOG even if this is the first connection to the server
+ // UpgradeRequiredException is also not thrown even if it is first connection to server
Review comment:
Based on my comments below, this test can probably stay unchanged if we catch TNFE and rethrow as UpgradeRequiredException.
##########
File path: phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
##########
@@ -1324,7 +1330,7 @@ private TableDescriptor ensureTableCreated(byte[] physicalTableName, PTableType
splits, isNamespaceMapped);
if (!tableExist) {
- if (SchemaUtil.isSystemTable(physicalTableName) && !isUpgradeRequired() && (!isAutoUpgradeEnabled || isDoNotUpgradePropSet)) {
+ if (SchemaUtil.isSystemTable(physicalTableName) && !isUpgradeRequired() && !isAutoUpgradeEnabled) {
Review comment:
Once we modify the condition check before this, we should remove this change.
##########
File path: phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
##########
@@ -1306,6 +1306,12 @@ private TableDescriptor ensureTableCreated(byte[] physicalTableName, PTableType
.build().buildException();
}
}
+ // If DoNotUpgrade config is set only check namespace mapping and
+ // Client-server compatibility for system tables.
+ if(isDoNotUpgradePropSet && SchemaUtil.isSystemTable(physicalTableName)) {
+ checkClientServerCompatibility(SYSTEM_CATALOG_NAME_BYTES);
Review comment:
If the client has `doNotUpgrade == true` and SYSTEM.CATALOG doesn't exist, `checkClientServerCompatibility` will throw a `TableNotFoundException`. If we were to catch this exception and rethrow as `UpgradeRequiredException`, won't it follow a similar path as expected today?
##########
File path: phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
##########
@@ -3199,12 +3188,9 @@ public Void call() throws Exception {
}
return null;
} catch (UpgradeRequiredException e) {
- // This will occur in 3 cases:
- // 1. SYSTEM.CATALOG does not exist and we don't want to allow the user to create it i.e.
- // !isAutoUpgradeEnabled or isDoNotUpgradePropSet is set
- // 2. SYSTEM.CATALOG exists and its timestamp < MIN_SYSTEM_TABLE_TIMESTAMP
- // 3. SYSTEM.CATALOG exists, but client and server-side namespace mapping is enabled so
- // we need to migrate SYSTEM tables to the SYSTEM namespace
+ // This will occur when SYSTEM.CATALOG exists, but client and
Review comment:
So if the client has `doNotUpgrade == true`, SYSTEM.CATALOG exists, server and client both have ns-mapping enabled -> this will continue throwing `UpgradeRequiredException`?
What about the other 2 cases where we used to fall into this block and later `setUpgradeRequired`?
For original case1 (syscat doesn't exist and client has doNotUpgrade == true) -> You changes will lead to a TableNotFoundException and as mentioned earlier, can we catch and rethrow as UpgradeRequiredException so that this follows the original code path?
What about case2?
##########
File path: phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
##########
@@ -1546,17 +1538,14 @@ public GetVersionResponse call(MetaDataService instance)
MetaDataUtil.ClientServerCompatibility compatibility = MetaDataUtil.areClientAndServerCompatible(serverJarVersion);
if (!compatibility.getIsCompatible()) {
if (compatibility.getErrorCode() == SQLExceptionCode.OUTDATED_JARS.getErrorCode()) {
- HRegionLocation name = regionMap.get(result.getKey());
errorMessage.append("Newer Phoenix clients can't communicate with older "
+ "Phoenix servers. Client version: "
+ MetaDataProtocol.CURRENT_CLIENT_VERSION
+ "; Server version: "
+ getServerVersion(serverJarVersion)
+ " The following servers require an updated "
+ QueryConstants.DEFAULT_COPROCESS_JAR_NAME
- + " to be put in the classpath of HBase: ");
- errorMessage.append(name);
- errorMessage.append(';');
+ + " to be put in the classpath of HBase; ");
Review comment:
Change this error message log now that we aren't mentioning the region name. Instead of "The following servers .." we can say "Servers require an updated .. "
##########
File path: phoenix-core/src/it/java/org/apache/phoenix/end2end/SystemCatalogCreationOnConnectionIT.java
##########
@@ -658,4 +670,30 @@ private Properties getClientProperties(boolean nsMappingEnabled, boolean systemT
assertFalse(isSystemNamespaceCreated());
return driver;
}
+
+ @Test
+ public void testDoNotUpgradePropSet() throws Exception {
Review comment:
nit: Add comments like in other test cases as a header for the expected behavior for ease of understanding.
##########
File path: phoenix-core/src/it/java/org/apache/phoenix/end2end/SystemCatalogCreationOnConnectionIT.java
##########
@@ -658,4 +670,30 @@ private Properties getClientProperties(boolean nsMappingEnabled, boolean systemT
assertFalse(isSystemNamespaceCreated());
return driver;
}
+
+ @Test
+ public void testDoNotUpgradePropSet() throws Exception {
+ String tableName = "HBASE_SYNTH_TEST";
+ startMiniClusterWithToggleNamespaceMapping(Boolean.FALSE.toString());
+ Properties propsDoNotUpgradePropSet = new Properties();
+ // Create a dummy connection to make sure we have all system tables in place
+ Connection con1 = DriverManager.getConnection(getJdbcUrl(),propsDoNotUpgradePropSet);
Review comment:
nit: try-with-resources for conn and stmt
##########
File path: phoenix-core/src/it/java/org/apache/phoenix/end2end/SystemCatalogCreationOnConnectionIT.java
##########
@@ -658,4 +670,30 @@ private Properties getClientProperties(boolean nsMappingEnabled, boolean systemT
assertFalse(isSystemNamespaceCreated());
return driver;
}
+
+ @Test
+ public void testDoNotUpgradePropSet() throws Exception {
+ String tableName = "HBASE_SYNTH_TEST";
+ startMiniClusterWithToggleNamespaceMapping(Boolean.FALSE.toString());
+ Properties propsDoNotUpgradePropSet = new Properties();
+ // Create a dummy connection to make sure we have all system tables in place
+ Connection con1 = DriverManager.getConnection(getJdbcUrl(),propsDoNotUpgradePropSet);
+ String ddl = "CREATE TABLE "+ tableName +" (PK1 VARCHAR not null, PK2 VARCHAR not null, "
+ + "COL1 varchar, COL2 varchar " + "CONSTRAINT pk PRIMARY KEY(PK1,PK2))";
+ con1.createStatement().execute(ddl);
+ con1.createStatement().execute("UPSERT INTO " + tableName + " values ('pk1','pk2','c1','c2')");
+ con1.commit();
+ // Stop HMaster to check if we can create connection without active HMaster
+ testUtil.getMiniHBaseCluster().getMaster().stopMaster();
+ // Set doNotUpgradeProperty to true
+ UpgradeUtil.doNotUpgradeOnFirstConnection(propsDoNotUpgradePropSet);
+ Connection con2 = DriverManager.getConnection(getJdbcUrl(),propsDoNotUpgradePropSet);
Review comment:
Same here.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [phoenix] gjacoby126 closed pull request #792: PHOENIX-5920 Skip SYSTEM TABLE checks while creating phoenix connection if client has set the DoNotUpgrade config
Posted by GitBox <gi...@apache.org>.
gjacoby126 closed pull request #792:
URL: https://github.com/apache/phoenix/pull/792
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [phoenix] nsgupta1 commented on a change in pull request #792: PHOENIX-5920 Skip SYSTEM TABLE checks while creating phoenix connection if client has set the DoNotUpgrade config
Posted by GitBox <gi...@apache.org>.
nsgupta1 commented on a change in pull request #792:
URL: https://github.com/apache/phoenix/pull/792#discussion_r432799745
##########
File path: phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
##########
@@ -3199,12 +3188,9 @@ public Void call() throws Exception {
}
return null;
} catch (UpgradeRequiredException e) {
- // This will occur in 3 cases:
- // 1. SYSTEM.CATALOG does not exist and we don't want to allow the user to create it i.e.
- // !isAutoUpgradeEnabled or isDoNotUpgradePropSet is set
- // 2. SYSTEM.CATALOG exists and its timestamp < MIN_SYSTEM_TABLE_TIMESTAMP
- // 3. SYSTEM.CATALOG exists, but client and server-side namespace mapping is enabled so
- // we need to migrate SYSTEM tables to the SYSTEM namespace
+ // This will occur when SYSTEM.CATALOG exists, but client and
Review comment:
We are not checking case 2 if DoNotUpgrade conf is set to true.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [phoenix] ChinmaySKulkarni commented on pull request #792: PHOENIX-5920 Skip SYSTEM TABLE checks while creating phoenix connection if client has set the DoNotUpgrade config
Posted by GitBox <gi...@apache.org>.
ChinmaySKulkarni commented on pull request #792:
URL: https://github.com/apache/phoenix/pull/792#issuecomment-636234804
A generic comment: We set upgradeNotRequired when getting a connectionOnServer. Can you please check that this continues working as expected after your changes?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [phoenix] nsgupta1 commented on a change in pull request #792: PHOENIX-5920 Skip SYSTEM TABLE checks while creating phoenix connection if client has set the DoNotUpgrade config
Posted by GitBox <gi...@apache.org>.
nsgupta1 commented on a change in pull request #792:
URL: https://github.com/apache/phoenix/pull/792#discussion_r434039905
##########
File path: phoenix-core/src/it/java/org/apache/phoenix/end2end/SystemCatalogCreationOnConnectionIT.java
##########
@@ -658,4 +670,30 @@ private Properties getClientProperties(boolean nsMappingEnabled, boolean systemT
assertFalse(isSystemNamespaceCreated());
return driver;
}
+
+ @Test
+ public void testDoNotUpgradePropSet() throws Exception {
Review comment:
Added comments here.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [phoenix] dbwong commented on a change in pull request #792: PHOENIX-5920 Skip SYSTEM TABLE checks while creating phoenix connection if client has set the DoNotUpgrade config
Posted by GitBox <gi...@apache.org>.
dbwong commented on a change in pull request #792:
URL: https://github.com/apache/phoenix/pull/792#discussion_r432737941
##########
File path: phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
##########
@@ -1307,131 +1307,136 @@ private TableDescriptor ensureTableCreated(byte[] physicalTableName, PTableType
}
}
- try {
- existingDesc = admin.getDescriptor(TableName.valueOf(physicalTableName));
- } catch (org.apache.hadoop.hbase.TableNotFoundException e) {
- tableExist = false;
- if (tableType == PTableType.VIEW) {
- String fullTableName = Bytes.toString(physicalTableName);
- throw new ReadOnlyTableException(
- "An HBase table for a VIEW must already exist",
- SchemaUtil.getSchemaNameFromFullName(fullTableName),
- SchemaUtil.getTableNameFromFullName(fullTableName));
+ // If DoNotUpgrade config is set only check namespace mapping and
Review comment:
Can you explain why this check has to be in this path and not in init?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [phoenix] nsgupta1 commented on a change in pull request #792: PHOENIX-5920 Skip SYSTEM TABLE checks while creating phoenix connection if client has set the DoNotUpgrade config
Posted by GitBox <gi...@apache.org>.
nsgupta1 commented on a change in pull request #792:
URL: https://github.com/apache/phoenix/pull/792#discussion_r432741255
##########
File path: phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
##########
@@ -1307,131 +1307,136 @@ private TableDescriptor ensureTableCreated(byte[] physicalTableName, PTableType
}
}
- try {
- existingDesc = admin.getDescriptor(TableName.valueOf(physicalTableName));
- } catch (org.apache.hadoop.hbase.TableNotFoundException e) {
- tableExist = false;
- if (tableType == PTableType.VIEW) {
- String fullTableName = Bytes.toString(physicalTableName);
- throw new ReadOnlyTableException(
- "An HBase table for a VIEW must already exist",
- SchemaUtil.getSchemaNameFromFullName(fullTableName),
- SchemaUtil.getTableNameFromFullName(fullTableName));
+ // If DoNotUpgrade config is set only check namespace mapping and
Review comment:
The basic goal of this check is to skip the call to [admin.getDescriptor](https://github.com/nsgupta1/phoenix/blob/18b219d7d270d546d7be29164229161531bd9330/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java#L1311) and creation of system tables if "DoNotUpgrade" config is set. I had to add the if condition here anyway so I added CheckClientServerCompatibility too. Also we still need to keep the check from CQSI.ensureTableCreated 1259-1308. Then we will have to move this check also to init.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [phoenix] ChinmaySKulkarni commented on a change in pull request #792: PHOENIX-5920 Skip SYSTEM TABLE checks while creating phoenix connection if client has set the DoNotUpgrade config
Posted by GitBox <gi...@apache.org>.
ChinmaySKulkarni commented on a change in pull request #792:
URL: https://github.com/apache/phoenix/pull/792#discussion_r432780285
##########
File path: phoenix-core/src/it/java/org/apache/phoenix/end2end/SystemCatalogCreationOnConnectionIT.java
##########
@@ -658,4 +670,30 @@ private Properties getClientProperties(boolean nsMappingEnabled, boolean systemT
assertFalse(isSystemNamespaceCreated());
return driver;
}
+
+ @Test
+ public void testDoNotUpgradePropSet() throws Exception {
+ String tableName = "HBASE_SYNTH_TEST";
+ startMiniClusterWithToggleNamespaceMapping(Boolean.FALSE.toString());
+ Properties propsDoNotUpgradePropSet = new Properties();
+ // Create a dummy connection to make sure we have all system tables in place
+ Connection con1 = DriverManager.getConnection(getJdbcUrl(),propsDoNotUpgradePropSet);
+ String ddl = "CREATE TABLE "+ tableName +" (PK1 VARCHAR not null, PK2 VARCHAR not null, "
+ + "COL1 varchar, COL2 varchar " + "CONSTRAINT pk PRIMARY KEY(PK1,PK2))";
+ con1.createStatement().execute(ddl);
+ con1.createStatement().execute("UPSERT INTO " + tableName + " values ('pk1','pk2','c1','c2')");
+ con1.commit();
+ // Stop HMaster to check if we can create connection without active HMaster
+ testUtil.getMiniHBaseCluster().getMaster().stopMaster();
Review comment:
Restart hmaster later?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org