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/10/28 13:50:00 UTC

[GitHub] [phoenix] richardantal opened a new pull request #944: PHOENIX-6127 Prevent unnecessary HBase admin API calls in ViewUtil.ge…

richardantal opened a new pull request #944:
URL: https://github.com/apache/phoenix/pull/944


   …tSystemTableForChildLinks() and act lazily instead


----------------------------------------------------------------
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] richardantal commented on pull request #944: PHOENIX-6127 Prevent unnecessary HBase admin API calls in ViewUtil.ge…

Posted by GitBox <gi...@apache.org>.
richardantal commented on pull request #944:
URL: https://github.com/apache/phoenix/pull/944#issuecomment-731246068


   Thx @gjacoby126 for the review!
   You are right, the only difference between the 2 dropChildViews functions should be that one will try lazily.
   (The original function was edited simultaneously and I did not realise it, and failed to rebase well.)
   The original one was used after an HBase admin call but I get rid of it.
   I have added a small commentary to the functions and created a common part which should be the same in both functions.


----------------------------------------------------------------
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] richardantal commented on pull request #944: PHOENIX-6127 Prevent unnecessary HBase admin API calls in ViewUtil.ge…

Posted by GitBox <gi...@apache.org>.
richardantal commented on pull request #944:
URL: https://github.com/apache/phoenix/pull/944#issuecomment-720999062


   I ran the tests locally, all of them were successful, but let's wait the test result on the new version.


----------------------------------------------------------------
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 #944: PHOENIX-6127 Prevent unnecessary HBase admin API calls in ViewUtil.ge…

Posted by GitBox <gi...@apache.org>.
ChinmaySKulkarni commented on a change in pull request #944:
URL: https://github.com/apache/phoenix/pull/944#discussion_r528022575



##########
File path: phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java
##########
@@ -2458,6 +2455,35 @@ private MetaDataResponse processRemoteRegionMutations(byte[] systemTableName,
         return null;
     }
 
+    private MetaDataResponse processRemoteRegionMutationsOnSystemChildLinkTable(
+            List<Mutation> remoteMutations, MetaDataProtos.MutationCode mutationCode)
+            throws IOException {
+        if (remoteMutations.isEmpty())

Review comment:
       nit: Please use `{` `}` braces even if it is a single-line `if` condition

##########
File path: phoenix-core/src/main/java/org/apache/phoenix/util/ViewUtil.java
##########
@@ -353,14 +396,20 @@ public static void dropChildViews(RegionCoprocessorEnvironment env, byte[] tenan
         Table hTable = null;
         try {
             hTable = ServerUtil.getHTableForCoprocessorScan(env, SchemaUtil.getPhysicalTableName(
-                            sysCatOrSysChildLink, env.getConfiguration()));
+                    sysCatOrSysChildLink, env.getConfiguration()));
         } catch (Exception e){
             logger.error("ServerUtil.getHTableForCoprocessorScan error!", e);
         }
         // if the SYSTEM.CATALOG or SYSTEM.CHILD_LINK doesn't exist just return
         if (hTable==null) {
             return;
         }
+        dropChildViewsCommon(env, tenantIdBytes, schemaName, tableOrViewName, hTable);
+    }
+
+    public static void dropChildViewsCommon(RegionCoprocessorEnvironment env, byte[] tenantIdBytes,

Review comment:
       can we make this `private`?

##########
File path: phoenix-core/src/main/java/org/apache/phoenix/util/ViewUtil.java
##########
@@ -337,6 +337,49 @@ public boolean filterAllRemaining() {
     /**
      * Attempt to drop an orphan child view i.e. a child view for which we see a parent->child entry
      * in SYSTEM.CHILD_LINK/SYSTEM.CATALOG (as a child) but for whom the parent no longer exists.
+     * Its better to use this version, and trying to get the hTable Lazily instead of checking it
+     * first via HBase admin call
+     * @param env Region Coprocessor environment
+     * @param tenantIdBytes tenantId of the parent
+     * @param schemaName schema of the parent
+     * @param tableOrViewName parent table/view name
+     * @throws IOException thrown if there is an error scanning SYSTEM.CHILD_LINK or SYSTEM.CATALOG
+     * @throws SQLException thrown if there is an error getting a connection to the server or
+     * an error retrieving the PTable for a child view
+     */
+    public static void dropChildViews(RegionCoprocessorEnvironment env, byte[] tenantIdBytes,
+                                      byte[] schemaName, byte[] tableOrViewName)
+            throws IOException, SQLException {
+        Configuration conf = env.getConfiguration();
+        Table hTable = null;
+        try {
+            byte[] sysCatOrSysChildLink = SchemaUtil.getPhysicalTableName(SYSTEM_CATALOG_NAME_BYTES,

Review comment:
       The order needs to be reversed here. We should first try to get `SYSTEM.CHILD_LINK` and if that fails, fallback to using `SYSTEM.CATALOG`. We also need to maintain the client version logic that [ViewUtil.getSystemTableForChildLinks()](https://github.com/apache/phoenix/blob/bf8bb519b0c3d0fe96e7e1e33a7672fc0e15b1ad/phoenix-core/src/main/java/org/apache/phoenix/util/ViewUtil.java#L497) has. Btw, with your changes, do we need that API anymore?

##########
File path: phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java
##########
@@ -2239,8 +2238,7 @@ public void dropTable(RpcController controller, DropTableRequest request,
 
             if (pTableType == PTableType.TABLE || pTableType == PTableType.VIEW) {
                 // check to see if the table has any child views
-                try (Table hTable = ServerUtil.getHTableForCoprocessorScan(env,
-                        getSystemTableForChildLinks(clientVersion, env.getConfiguration()))) {
+                try (Table hTable = ServerUtil.getHTableSystemChildLink(env)) {

Review comment:
       nit: Rename to `getHTableSysChildLinkOrSysCat` or something to indicate that we may get the latter too 

##########
File path: phoenix-core/src/main/java/org/apache/phoenix/util/ViewUtil.java
##########
@@ -337,6 +337,49 @@ public boolean filterAllRemaining() {
     /**
      * Attempt to drop an orphan child view i.e. a child view for which we see a parent->child entry
      * in SYSTEM.CHILD_LINK/SYSTEM.CATALOG (as a child) but for whom the parent no longer exists.
+     * Its better to use this version, and trying to get the hTable Lazily instead of checking it
+     * first via HBase admin call
+     * @param env Region Coprocessor environment
+     * @param tenantIdBytes tenantId of the parent
+     * @param schemaName schema of the parent
+     * @param tableOrViewName parent table/view name
+     * @throws IOException thrown if there is an error scanning SYSTEM.CHILD_LINK or SYSTEM.CATALOG
+     * @throws SQLException thrown if there is an error getting a connection to the server or
+     * an error retrieving the PTable for a child view
+     */
+    public static void dropChildViews(RegionCoprocessorEnvironment env, byte[] tenantIdBytes,
+                                      byte[] schemaName, byte[] tableOrViewName)
+            throws IOException, SQLException {
+        Configuration conf = env.getConfiguration();
+        Table hTable = null;
+        try {
+            byte[] sysCatOrSysChildLink = SchemaUtil.getPhysicalTableName(SYSTEM_CATALOG_NAME_BYTES,
+                    conf).getName();
+            hTable = ServerUtil.getHTableForCoprocessorScan(env, SchemaUtil.getPhysicalTableName(
+                    sysCatOrSysChildLink, env.getConfiguration()));
+        } catch (Exception e){
+            try {
+                byte[] sysCatOrSysChildLink = SchemaUtil.getPhysicalTableName(
+                        SYSTEM_CHILD_LINK_NAME_BYTES, conf).getName();
+                hTable = ServerUtil.getHTableForCoprocessorScan(env,
+                        SchemaUtil.getPhysicalTableName(sysCatOrSysChildLink,
+                                env.getConfiguration()));
+            } catch (Exception e1){
+                logger.error("ServerUtil.getHTableForCoprocessorScan error!", e);
+            }
+        }
+        // if the SYSTEM.CATALOG or SYSTEM.CHILD_LINK doesn't exist just return
+        if (hTable==null) {

Review comment:
       We should log an error 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 commented on a change in pull request #944: PHOENIX-6127 Prevent unnecessary HBase admin API calls in ViewUtil.ge…

Posted by GitBox <gi...@apache.org>.
gjacoby126 commented on a change in pull request #944:
URL: https://github.com/apache/phoenix/pull/944#discussion_r516342109



##########
File path: phoenix-core/src/main/java/org/apache/phoenix/util/ServerUtil.java
##########
@@ -225,6 +227,21 @@ public static Table getHTableForCoprocessorScan (RegionCoprocessorEnvironment en
         }
         return getTableFromSingletonPool(env, tableName);
     }
+
+    public static Table getHTableSystemChildLink (RegionCoprocessorEnvironment env) throws IOException {
+        if (coprocessorScanWorks(env)) {

Review comment:
       Looks like coprocessorScanWorks will return true for any HBase version >= 0.98.6, and the earliest version we currently support is 1.3. Can we rid of the getTableFromSingletonPool calls?




----------------------------------------------------------------
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] stoty commented on pull request #944: PHOENIX-6127 Prevent unnecessary HBase admin API calls in ViewUtil.ge…

Posted by GitBox <gi...@apache.org>.
stoty commented on pull request #944:
URL: https://github.com/apache/phoenix/pull/944#issuecomment-721027327


   :broken_heart: **-1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime | Comment |
   |:----:|----------:|--------:|:--------|
   | +0 :ok: |  reexec  |   5m 17s |  Docker mode activated.  |
   ||| _ Prechecks _ |
   | +1 :green_heart: |  dupname  |   0m  0s |  No case conflicting files found.  |
   | +1 :green_heart: |  hbaseanti  |   0m  0s |  Patch does not have any anti-patterns.  |
   | +1 :green_heart: |  @author  |   0m  0s |  The patch does not contain any @author tags.  |
   | -1 :x: |  test4tests  |   0m  0s |  The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.  |
   ||| _ master Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |  12m 42s |  master passed  |
   | +1 :green_heart: |  compile  |   0m 57s |  master passed  |
   | +1 :green_heart: |  checkstyle  |   1m 18s |  master passed  |
   | +1 :green_heart: |  javadoc  |   0m 46s |  master passed  |
   | +0 :ok: |  spotbugs  |   2m 56s |  phoenix-core in master has 969 extant spotbugs warnings.  |
   ||| _ Patch Compile Tests _ |
   | -1 :x: |  mvninstall  |   0m 38s |  root in the patch failed.  |
   | -1 :x: |  compile  |   0m 27s |  phoenix-core in the patch failed.  |
   | -1 :x: |  javac  |   0m 27s |  phoenix-core in the patch failed.  |
   | -1 :x: |  checkstyle  |   0m 18s |  The patch fails to run checkstyle in phoenix-core  |
   | +1 :green_heart: |  whitespace  |   0m  0s |  The patch has no whitespace issues.  |
   | -1 :x: |  javadoc  |   0m 18s |  phoenix-core in the patch failed.  |
   | -1 :x: |  spotbugs  |   0m 25s |  phoenix-core in the patch failed.  |
   ||| _ Other Tests _ |
   | -1 :x: |  unit  |   0m 25s |  phoenix-core in the patch failed.  |
   | +1 :green_heart: |  asflicense  |   0m  9s |  The patch does not generate ASF License warnings.  |
   |  |   |  27m 17s |   |
   
   
   | Subsystem | Report/Notes |
   |----------:|:-------------|
   | Docker | ClientAPI=1.40 ServerAPI=1.40 base: https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-944/3/artifact/yetus-general-check/output/Dockerfile |
   | GITHUB PR | https://github.com/apache/phoenix/pull/944 |
   | Optional Tests | dupname asflicense javac javadoc unit spotbugs hbaseanti checkstyle compile |
   | uname | Linux 840beb4c2212 4.15.0-65-generic #74-Ubuntu SMP Tue Sep 17 17:06:04 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux |
   | Build tool | maven |
   | Personality | dev/phoenix-personality.sh |
   | git revision | master / d8a0a8a |
   | Default Java | Private Build-1.8.0_242-8u242-b08-0ubuntu3~16.04-b08 |
   | mvninstall | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-944/3/artifact/yetus-general-check/output/patch-mvninstall-root.txt |
   | compile | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-944/3/artifact/yetus-general-check/output/patch-compile-phoenix-core.txt |
   | javac | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-944/3/artifact/yetus-general-check/output/patch-compile-phoenix-core.txt |
   | checkstyle | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-944/3/artifact/yetus-general-check/output/buildtool-patch-checkstyle-phoenix-core.txt |
   | javadoc | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-944/3/artifact/yetus-general-check/output/patch-javadoc-phoenix-core.txt |
   | spotbugs | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-944/3/artifact/yetus-general-check/output/patch-spotbugs-phoenix-core.txt |
   | unit | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-944/3/artifact/yetus-general-check/output/patch-unit-phoenix-core.txt |
   |  Test Results | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-944/3/testReport/ |
   | Max. process+thread count | 94 (vs. ulimit of 30000) |
   | modules | C: phoenix-core U: phoenix-core |
   | Console output | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-944/3/console |
   | versions | git=2.7.4 maven=3.3.9 spotbugs=4.1.3 |
   | Powered by | Apache Yetus 0.12.0 https://yetus.apache.org |
   
   
   This message was automatically generated.
   
   


----------------------------------------------------------------
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] stoty commented on pull request #944: PHOENIX-6127 Prevent unnecessary HBase admin API calls in ViewUtil.ge…

Posted by GitBox <gi...@apache.org>.
stoty commented on pull request #944:
URL: https://github.com/apache/phoenix/pull/944#issuecomment-731362231


   :broken_heart: **-1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime | Comment |
   |:----:|----------:|--------:|:--------|
   | +0 :ok: |  reexec  |   5m  3s |  Docker mode activated.  |
   ||| _ Prechecks _ |
   | +1 :green_heart: |  dupname  |   0m  0s |  No case conflicting files found.  |
   | +1 :green_heart: |  hbaseanti  |   0m  0s |  Patch does not have any anti-patterns.  |
   | +1 :green_heart: |  @author  |   0m  0s |  The patch does not contain any @author tags.  |
   | -1 :x: |  test4tests  |   0m  0s |  The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.  |
   ||| _ master Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |  13m 18s |  master passed  |
   | +1 :green_heart: |  compile  |   0m 59s |  master passed  |
   | +1 :green_heart: |  checkstyle  |   1m 26s |  master passed  |
   | +1 :green_heart: |  javadoc  |   0m 45s |  master passed  |
   | +0 :ok: |  spotbugs  |   2m 52s |  phoenix-core in master has 965 extant spotbugs warnings.  |
   ||| _ Patch Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |   7m 28s |  the patch passed  |
   | +1 :green_heart: |  compile  |   0m 53s |  the patch passed  |
   | +1 :green_heart: |  javac  |   0m 53s |  the patch passed  |
   | -1 :x: |  checkstyle  |   1m 28s |  phoenix-core: The patch generated 46 new + 2326 unchanged - 8 fixed = 2372 total (was 2334)  |
   | +1 :green_heart: |  whitespace  |   0m  0s |  The patch has no whitespace issues.  |
   | +1 :green_heart: |  javadoc  |   0m 43s |  the patch passed  |
   | -1 :x: |  spotbugs  |   3m  8s |  phoenix-core generated 1 new + 965 unchanged - 0 fixed = 966 total (was 965)  |
   ||| _ Other Tests _ |
   | -1 :x: |  unit  | 181m 26s |  phoenix-core in the patch failed.  |
   | +1 :green_heart: |  asflicense  |   0m 27s |  The patch does not generate ASF License warnings.  |
   |  |   | 222m 41s |   |
   
   
   | Reason | Tests |
   |-------:|:------|
   | FindBugs | module:phoenix-core |
   |  |  Exception is caught when Exception is not thrown in org.apache.phoenix.coprocessor.MetaDataEndpointImpl.processRemoteRegionMutationsOnSystemChildLinkTable(List, MetaDataProtos$MutationCode)  At MetaDataEndpointImpl.java:is not thrown in org.apache.phoenix.coprocessor.MetaDataEndpointImpl.processRemoteRegionMutationsOnSystemChildLinkTable(List, MetaDataProtos$MutationCode)  At MetaDataEndpointImpl.java:[line 2477] |
   | Failed junit tests | phoenix.end2end.TableSnapshotReadsMapReduceIT |
   
   
   | Subsystem | Report/Notes |
   |----------:|:-------------|
   | Docker | ClientAPI=1.40 ServerAPI=1.40 base: https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-944/4/artifact/yetus-general-check/output/Dockerfile |
   | GITHUB PR | https://github.com/apache/phoenix/pull/944 |
   | Optional Tests | dupname asflicense javac javadoc unit spotbugs hbaseanti checkstyle compile |
   | uname | Linux f8a512c6aec1 4.15.0-65-generic #74-Ubuntu SMP Tue Sep 17 17:06:04 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux |
   | Build tool | maven |
   | Personality | dev/phoenix-personality.sh |
   | git revision | master / 2af2adf |
   | Default Java | Private Build-1.8.0_242-8u242-b08-0ubuntu3~16.04-b08 |
   | checkstyle | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-944/4/artifact/yetus-general-check/output/diff-checkstyle-phoenix-core.txt |
   | spotbugs | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-944/4/artifact/yetus-general-check/output/new-spotbugs-phoenix-core.html |
   | unit | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-944/4/artifact/yetus-general-check/output/patch-unit-phoenix-core.txt |
   |  Test Results | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-944/4/testReport/ |
   | Max. process+thread count | 6537 (vs. ulimit of 30000) |
   | modules | C: phoenix-core U: phoenix-core |
   | Console output | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-944/4/console |
   | versions | git=2.7.4 maven=3.3.9 spotbugs=4.1.3 |
   | Powered by | Apache Yetus 0.12.0 https://yetus.apache.org |
   
   
   This message was automatically generated.
   
   


----------------------------------------------------------------
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] stoty commented on pull request #944: PHOENIX-6127 Prevent unnecessary HBase admin API calls in ViewUtil.ge…

Posted by GitBox <gi...@apache.org>.
stoty commented on pull request #944:
URL: https://github.com/apache/phoenix/pull/944#issuecomment-718085145


   :broken_heart: **-1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime | Comment |
   |:----:|----------:|--------:|:--------|
   | +0 :ok: |  reexec  |   1m  4s |  Docker mode activated.  |
   ||| _ Prechecks _ |
   | +1 :green_heart: |  dupname  |   0m  1s |  No case conflicting files found.  |
   | +1 :green_heart: |  hbaseanti  |   0m  0s |  Patch does not have any anti-patterns.  |
   | +1 :green_heart: |  @author  |   0m  0s |  The patch does not contain any @author tags.  |
   | -1 :x: |  test4tests  |   0m  0s |  The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.  |
   ||| _ master Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |  12m 49s |  master passed  |
   | +1 :green_heart: |  compile  |   0m 56s |  master passed  |
   | +1 :green_heart: |  checkstyle  |   1m 26s |  master passed  |
   | +1 :green_heart: |  javadoc  |   0m 43s |  master passed  |
   | +0 :ok: |  spotbugs  |   2m 51s |  phoenix-core in master has 969 extant spotbugs warnings.  |
   ||| _ Patch Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |   7m 18s |  the patch passed  |
   | +1 :green_heart: |  compile  |   0m 53s |  the patch passed  |
   | +1 :green_heart: |  javac  |   0m 53s |  the patch passed  |
   | -1 :x: |  checkstyle  |   1m 28s |  phoenix-core: The patch generated 32 new + 2342 unchanged - 15 fixed = 2374 total (was 2357)  |
   | +1 :green_heart: |  whitespace  |   0m  0s |  The patch has no whitespace issues.  |
   | +1 :green_heart: |  javadoc  |   0m 43s |  the patch passed  |
   | -1 :x: |  spotbugs  |   3m  6s |  phoenix-core generated 1 new + 969 unchanged - 0 fixed = 970 total (was 969)  |
   ||| _ Other Tests _ |
   | -1 :x: |  unit  | 172m 20s |  phoenix-core in the patch failed.  |
   | +1 :green_heart: |  asflicense  |   0m 27s |  The patch does not generate ASF License warnings.  |
   |  |   | 208m 44s |   |
   
   
   | Reason | Tests |
   |-------:|:------|
   | FindBugs | module:phoenix-core |
   |  |  Exception is caught when Exception is not thrown in org.apache.phoenix.coprocessor.MetaDataEndpointImpl.processRemoteRegionMutationsOnSystemChildLinkTable(List, MetaDataProtos$MutationCode)  At MetaDataEndpointImpl.java:is not thrown in org.apache.phoenix.coprocessor.MetaDataEndpointImpl.processRemoteRegionMutationsOnSystemChildLinkTable(List, MetaDataProtos$MutationCode)  At MetaDataEndpointImpl.java:[line 2469] |
   | Failed junit tests | phoenix.end2end.TenantSpecificTablesDDLIT |
   |   | phoenix.end2end.DropTableWithViewsIT |
   |   | phoenix.end2end.TableSnapshotReadsMapReduceIT |
   |   | phoenix.end2end.ViewMetadataIT |
   
   
   | Subsystem | Report/Notes |
   |----------:|:-------------|
   | Docker | ClientAPI=1.40 ServerAPI=1.40 base: https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-944/1/artifact/yetus-general-check/output/Dockerfile |
   | GITHUB PR | https://github.com/apache/phoenix/pull/944 |
   | Optional Tests | dupname asflicense javac javadoc unit spotbugs hbaseanti checkstyle compile |
   | uname | Linux b1296d3f8a4a 4.15.0-65-generic #74-Ubuntu SMP Tue Sep 17 17:06:04 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux |
   | Build tool | maven |
   | Personality | dev/phoenix-personality.sh |
   | git revision | master / 6d84d0f |
   | Default Java | Private Build-1.8.0_242-8u242-b08-0ubuntu3~16.04-b08 |
   | checkstyle | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-944/1/artifact/yetus-general-check/output/diff-checkstyle-phoenix-core.txt |
   | spotbugs | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-944/1/artifact/yetus-general-check/output/new-spotbugs-phoenix-core.html |
   | unit | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-944/1/artifact/yetus-general-check/output/patch-unit-phoenix-core.txt |
   |  Test Results | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-944/1/testReport/ |
   | Max. process+thread count | 6923 (vs. ulimit of 30000) |
   | modules | C: phoenix-core U: phoenix-core |
   | Console output | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-944/1/console |
   | versions | git=2.7.4 maven=3.3.9 spotbugs=4.1.3 |
   | Powered by | Apache Yetus 0.12.0 https://yetus.apache.org |
   
   
   This message was automatically generated.
   
   


----------------------------------------------------------------
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] yanxinyi commented on pull request #944: PHOENIX-6127 Prevent unnecessary HBase admin API calls in ViewUtil.ge…

Posted by GitBox <gi...@apache.org>.
yanxinyi commented on pull request #944:
URL: https://github.com/apache/phoenix/pull/944#issuecomment-724444611


   hi @gjacoby126 , can you take another look for @richardantal , thanks!


----------------------------------------------------------------
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] richardantal commented on a change in pull request #944: PHOENIX-6127 Prevent unnecessary HBase admin API calls in ViewUtil.ge…

Posted by GitBox <gi...@apache.org>.
richardantal commented on a change in pull request #944:
URL: https://github.com/apache/phoenix/pull/944#discussion_r516520567



##########
File path: phoenix-core/src/main/java/org/apache/phoenix/util/ServerUtil.java
##########
@@ -225,6 +227,21 @@ public static Table getHTableForCoprocessorScan (RegionCoprocessorEnvironment en
         }
         return getTableFromSingletonPool(env, tableName);
     }
+
+    public static Table getHTableSystemChildLink (RegionCoprocessorEnvironment env) throws IOException {
+        if (coprocessorScanWorks(env)) {

Review comment:
       It seems yes we can, nice catch @gjacoby126.
   Thank you for the review, I have updated the 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] ChinmaySKulkarni commented on a change in pull request #944: PHOENIX-6127 Prevent unnecessary HBase admin API calls in ViewUtil.ge…

Posted by GitBox <gi...@apache.org>.
ChinmaySKulkarni commented on a change in pull request #944:
URL: https://github.com/apache/phoenix/pull/944#discussion_r528024432



##########
File path: phoenix-core/src/main/java/org/apache/phoenix/util/ViewUtil.java
##########
@@ -337,6 +337,49 @@ public boolean filterAllRemaining() {
     /**
      * Attempt to drop an orphan child view i.e. a child view for which we see a parent->child entry
      * in SYSTEM.CHILD_LINK/SYSTEM.CATALOG (as a child) but for whom the parent no longer exists.
+     * Its better to use this version, and trying to get the hTable Lazily instead of checking it
+     * first via HBase admin call
+     * @param env Region Coprocessor environment
+     * @param tenantIdBytes tenantId of the parent
+     * @param schemaName schema of the parent
+     * @param tableOrViewName parent table/view name
+     * @throws IOException thrown if there is an error scanning SYSTEM.CHILD_LINK or SYSTEM.CATALOG
+     * @throws SQLException thrown if there is an error getting a connection to the server or
+     * an error retrieving the PTable for a child view
+     */
+    public static void dropChildViews(RegionCoprocessorEnvironment env, byte[] tenantIdBytes,
+                                      byte[] schemaName, byte[] tableOrViewName)
+            throws IOException, SQLException {
+        Configuration conf = env.getConfiguration();
+        Table hTable = null;
+        try {
+            byte[] sysCatOrSysChildLink = SchemaUtil.getPhysicalTableName(SYSTEM_CATALOG_NAME_BYTES,

Review comment:
       The order needs to be reversed here. We should first try to get `SYSTEM.CHILD_LINK` and if that fails, fallback to using `SYSTEM.CATALOG`. We also need to maintain the client version logic that [ViewUtil.getSystemTableForChildLinks()](https://github.com/apache/phoenix/blob/bf8bb519b0c3d0fe96e7e1e33a7672fc0e15b1ad/phoenix-core/src/main/java/org/apache/phoenix/util/ViewUtil.java#L497) has. Btw, with your changes, do we need the `getSystemTableForChildLinks()` API anymore?




----------------------------------------------------------------
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