Skip to content
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-6129 : Optimize tableExists() call while retrieving correct MUTEX table #920

Merged
merged 8 commits into from Oct 26, 2020
Merged

PHOENIX-6129 : Optimize tableExists() call while retrieving correct MUTEX table #920

merged 8 commits into from Oct 26, 2020

Conversation

virajjasani
Copy link
Contributor

No description provided.

@virajjasani
Copy link
Contributor Author

Since it is not allowed to mutate SYSTEM tables, providing corresponding IT test seems difficult.

: SchemaUtil.getTableKey(tenantId, schemaName, tableName);
byte[] rowKey = columnName != null ?
SchemaUtil.getColumnKey(tenantId, schemaName, tableName, columnName, familyName) :
SchemaUtil.getTableKey(tenantId, schemaName, tableName);
// at this point the system mutex table should have been created or
// an exception thrown
byte[] sysMutexPhysicalTableNameBytes = getSysMutexPhysicalTableNameBytes();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

byte[] sysMutexPhysicalTableNameBytes = getSysMutexPhysicalTableNameBytes();

If I understand correctly what @ChinmaySKulkarni described in the ticket, this call will still result to an admin.tableExists call to check the existance of SYSTEM.MUTEX/SYSTEM:MUTEX and you didn't changed that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

try (Table sysMutexTable = getTable(sysMutexPhysicalTableNameBytes)) {

Instead We could try the Table sysMutexTable =getTable() call with one of them and catch HBase TableNotFoundException, in that case try with the other one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If getSysMutexPhysicalTableNameBytes() start throwing TableNotFoundException, then at this point the Exception would be thrown and caught, so we would not go ahead with next getTable() call.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@virajjasani I think there is some confusion here. The aim of this Jira is to reduce the HBase calls to get the table. Currently, the call to writeMutexCell() calls getSysMutexPhysicalTableNameBytes() which does 1 or 2 HBase admin calls (tableExists()) and then we still do a getTable() call here.
The same happens for deleteMutexCell().

Instead of calling getSysMutexPhysicalTableNameBytes(), we can do 1 getTable() call with SYSTEM.MUTEX and if that throws a TNFE, try again with SYSTEM:MUTEX thus eliminating the tableExists() calls.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad for this misunderstanding. Addressed concerns, updated the PR.

@stoty
Copy link
Contributor

stoty commented Oct 15, 2020

💔 -1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 10m 18s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+1 💚 hbaseanti 0m 0s Patch does not have any anti-patterns.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
-1 ❌ 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 💚 mvninstall 49m 54s master passed
+1 💚 compile 1m 15s master passed
+1 💚 checkstyle 1m 17s master passed
+1 💚 javadoc 0m 57s master passed
+0 🆗 spotbugs 3m 23s phoenix-core in master has 973 extant spotbugs warnings.
_ Patch Compile Tests _
+1 💚 mvninstall 41m 32s the patch passed
+1 💚 compile 0m 59s the patch passed
+1 💚 javac 0m 59s the patch passed
-1 ❌ checkstyle 1m 8s phoenix-core: The patch generated 39 new + 2201 unchanged - 41 fixed = 2240 total (was 2242)
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
+1 💚 javadoc 0m 45s the patch passed
+1 💚 spotbugs 3m 20s the patch passed
_ Other Tests _
-1 ❌ unit 166m 17s phoenix-core in the patch failed.
+1 💚 asflicense 0m 22s The patch does not generate ASF License warnings.
283m 57s
Reason Tests
Failed junit tests phoenix.end2end.OrphanViewToolIT
phoenix.end2end.ConcurrentMutationsExtendedIT
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-920/1/artifact/yetus-general-check/output/Dockerfile
GITHUB PR #920
Optional Tests dupname asflicense javac javadoc unit spotbugs hbaseanti checkstyle compile
uname Linux 747e6da3f8ca 4.15.0-112-generic #113-Ubuntu SMP Thu Jul 9 23:41:39 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev/phoenix-personality.sh
git revision master / 5b2eeb6
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-920/1/artifact/yetus-general-check/output/diff-checkstyle-phoenix-core.txt
unit https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-920/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-920/1/testReport/
Max. process+thread count 6223 (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-920/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.

@virajjasani
Copy link
Contributor Author

virajjasani commented Oct 15, 2020

Test failures don't seem relevant, tried locally, all passed. Fixed checkstyle issues relevant to this PR.
Could you please take a look @yanxinyi ?

@stoty
Copy link
Contributor

stoty commented Oct 15, 2020

💔 -1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 1m 19s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+1 💚 hbaseanti 0m 0s Patch does not have any anti-patterns.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
-1 ❌ 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 💚 mvninstall 47m 16s master passed
+1 💚 compile 1m 4s master passed
+1 💚 checkstyle 1m 3s master passed
+1 💚 javadoc 0m 51s master passed
+0 🆗 spotbugs 3m 37s phoenix-core in master has 973 extant spotbugs warnings.
_ Patch Compile Tests _
+1 💚 mvninstall 43m 2s the patch passed
+1 💚 compile 0m 57s the patch passed
+1 💚 javac 0m 57s the patch passed
-1 ❌ checkstyle 1m 6s phoenix-core: The patch generated 4 new + 2230 unchanged - 12 fixed = 2234 total (was 2242)
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
+1 💚 javadoc 0m 46s the patch passed
+1 💚 spotbugs 3m 18s the patch passed
_ Other Tests _
-1 ❌ unit 156m 12s phoenix-core in the patch failed.
+1 💚 asflicense 0m 21s The patch does not generate ASF License warnings.
263m 22s
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-920/2/artifact/yetus-general-check/output/Dockerfile
GITHUB PR #920
Optional Tests dupname asflicense javac javadoc unit spotbugs hbaseanti checkstyle compile
uname Linux fe9ca6f1804b 4.15.0-112-generic #113-Ubuntu SMP Thu Jul 9 23:41:39 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev/phoenix-personality.sh
git revision master / fe7c46c
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-920/2/artifact/yetus-general-check/output/diff-checkstyle-phoenix-core.txt
unit https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-920/2/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-920/2/testReport/
Max. process+thread count 6070 (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-920/2/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.

@stoty
Copy link
Contributor

stoty commented Oct 16, 2020

💔 -1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 2m 43s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+1 💚 hbaseanti 0m 0s Patch does not have any anti-patterns.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
-1 ❌ 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 ❌ mvninstall 45m 37s root in master failed.
+1 💚 compile 1m 3s master passed
+1 💚 checkstyle 1m 4s master passed
+1 💚 javadoc 0m 49s master passed
+0 🆗 spotbugs 3m 16s phoenix-core in master has 973 extant spotbugs warnings.
_ Patch Compile Tests _
-1 ❌ mvninstall 42m 40s root in the patch failed.
+1 💚 compile 1m 10s the patch passed
+1 💚 javac 1m 10s the patch passed
-1 ❌ checkstyle 1m 10s phoenix-core: The patch generated 31 new + 2192 unchanged - 50 fixed = 2223 total (was 2242)
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
+1 💚 javadoc 0m 58s the patch passed
+1 💚 spotbugs 4m 2s phoenix-core generated 0 new + 972 unchanged - 1 fixed = 972 total (was 973)
_ Other Tests _
-1 ❌ unit 155m 13s phoenix-core in the patch failed.
+1 💚 asflicense 0m 22s The patch does not generate ASF License warnings.
262m 36s
Reason Tests
Failed junit tests phoenix.end2end.SystemTablesCreationOnConnectionIT
phoenix.end2end.MigrateSystemTablesToSystemNamespaceIT
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-920/3/artifact/yetus-general-check/output/Dockerfile
GITHUB PR #920
Optional Tests dupname asflicense javac javadoc unit spotbugs hbaseanti checkstyle compile
uname Linux eb4521000838 4.15.0-112-generic #113-Ubuntu SMP Thu Jul 9 23:41:39 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev/phoenix-personality.sh
git revision master / 628fa0d
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-920/3/artifact/yetus-general-check/output/branch-mvninstall-root.txt
mvninstall https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-920/3/artifact/yetus-general-check/output/patch-mvninstall-root.txt
checkstyle https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-920/3/artifact/yetus-general-check/output/diff-checkstyle-phoenix-core.txt
unit https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-920/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-920/3/testReport/
Max. process+thread count 6207 (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-920/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.

@virajjasani
Copy link
Contributor Author

@ChinmaySKulkarni IMHO we can not live without tableExists() call because Connection.getTable() has no guarantee that it will throw TableNotFoundException if table doesn't exist. What happens during namespace upgrade is that even if SYSTEM.MUTEX has been deleted (removed entry from meta), Connection.getTable() still returns us an instance of Table, however, we can't perform actions on it.

Admin.tableExists is the only thread safe way to identify if table already exists:

  /**
   * @param tableName Table to check.
   * @return <code>true</code> if table exists already.
   * @throws IOException if a remote or network exception occurs
   */
  boolean tableExists(TableName tableName) throws IOException;

&

  /**
   * Retrieve a Table implementation for accessing a table.
   * The returned Table is not thread safe, a new instance should be created for each using thread.
   * This is a lightweight operation, pooling or caching of the returned Table
   * is neither required nor desired.
   * <p>
   * The caller is responsible for calling {@link Table#close()} on the returned
   * table instance.
   * <p>
   * Since 0.98.1 this method no longer checks table existence. An exception
   * will be thrown if the table does not exist only when the first operation is
   * attempted.
   * @param tableName the name of the table
   * @return a Table to use for interactions with this table
   */
  default Table getTable(TableName tableName) throws IOException {
    return getTable(tableName, null);
  }

I checked implementation also, and getTable() internally uses getTableBuilder() which just provides a builder instance for just creating Table object to access actual table, but there is no guarantee that a table exists while accessing it. Only existsTable() goes to meta table and checks for the existing entry of Table.

We can do one improvement though, we can utilize same connection to perform both: tableExists() and getTable().
If we don't have tableExists(), test cases MigrateSystemTablesToSystemNamespaceIT are guaranteed to fail.
Updating the PR accordingly.

@virajjasani virajjasani changed the title PHOENIX-6129 : Avoid redundant Admin API call in the absence of SYSTEM.MUTEX table PHOENIX-6129 : Use same connection for tableExists() and getTable() for MUTEX table Oct 16, 2020
@virajjasani virajjasani changed the title PHOENIX-6129 : Use same connection for tableExists() and getTable() for MUTEX table PHOENIX-6129 : Use same connection for tableExists() and getTable() in same method to retrieve correct MUTEX table Oct 16, 2020
@stoty
Copy link
Contributor

stoty commented Oct 16, 2020

💔 -1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 1m 1s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+1 💚 hbaseanti 0m 0s Patch does not have any anti-patterns.
+1 💚 @author 0m 1s The patch does not contain any @author tags.
-1 ❌ 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 ❌ mvninstall 46m 12s root in master failed.
+1 💚 compile 1m 3s master passed
+1 💚 checkstyle 1m 6s master passed
+1 💚 javadoc 0m 48s master passed
+0 🆗 spotbugs 3m 7s phoenix-core in master has 973 extant spotbugs warnings.
_ Patch Compile Tests _
-1 ❌ mvninstall 42m 31s root in the patch failed.
+1 💚 compile 0m 58s the patch passed
+1 💚 javac 0m 58s the patch passed
-1 ❌ checkstyle 1m 7s phoenix-core: The patch generated 2 new + 2221 unchanged - 21 fixed = 2223 total (was 2242)
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
+1 💚 javadoc 0m 46s the patch passed
+1 💚 spotbugs 3m 20s phoenix-core generated 0 new + 972 unchanged - 1 fixed = 972 total (was 973)
_ Other Tests _
-1 ❌ unit 150m 24s phoenix-core in the patch failed.
+1 💚 asflicense 0m 21s The patch does not generate ASF License warnings.
255m 8s
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-920/4/artifact/yetus-general-check/output/Dockerfile
GITHUB PR #920
Optional Tests dupname asflicense javac javadoc unit spotbugs hbaseanti checkstyle compile
uname Linux 88e6e2e470a4 4.15.0-112-generic #113-Ubuntu SMP Thu Jul 9 23:41:39 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev/phoenix-personality.sh
git revision master / 628fa0d
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-920/4/artifact/yetus-general-check/output/branch-mvninstall-root.txt
mvninstall https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-920/4/artifact/yetus-general-check/output/patch-mvninstall-root.txt
checkstyle https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-920/4/artifact/yetus-general-check/output/diff-checkstyle-phoenix-core.txt
unit https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-920/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-920/4/testReport/
Max. process+thread count 6092 (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-920/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.

@stoty
Copy link
Contributor

stoty commented Oct 16, 2020

💔 -1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 59s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+1 💚 hbaseanti 0m 0s Patch does not have any anti-patterns.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
-1 ❌ 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 ❌ mvninstall 44m 54s root in master failed.
+1 💚 compile 1m 1s master passed
+1 💚 checkstyle 1m 7s master passed
+1 💚 javadoc 0m 47s master passed
+0 🆗 spotbugs 3m 9s phoenix-core in master has 973 extant spotbugs warnings.
_ Patch Compile Tests _
-1 ❌ mvninstall 41m 48s root in the patch failed.
+1 💚 compile 0m 55s the patch passed
+1 💚 javac 0m 55s the patch passed
-1 ❌ checkstyle 1m 7s phoenix-core: The patch generated 2 new + 2221 unchanged - 21 fixed = 2223 total (was 2242)
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
+1 💚 javadoc 0m 46s the patch passed
+1 💚 spotbugs 3m 16s phoenix-core generated 0 new + 972 unchanged - 1 fixed = 972 total (was 973)
_ Other Tests _
-1 ❌ unit 154m 15s phoenix-core in the patch failed.
+1 💚 asflicense 0m 21s The patch does not generate ASF License warnings.
256m 51s
Reason Tests
Failed junit tests phoenix.end2end.OrphanViewToolIT
phoenix.end2end.index.ViewIndexIT
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-920/5/artifact/yetus-general-check/output/Dockerfile
GITHUB PR #920
Optional Tests dupname asflicense javac javadoc unit spotbugs hbaseanti checkstyle compile
uname Linux 8d5b1a70eb70 4.15.0-112-generic #113-Ubuntu SMP Thu Jul 9 23:41:39 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev/phoenix-personality.sh
git revision master / 628fa0d
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-920/5/artifact/yetus-general-check/output/branch-mvninstall-root.txt
mvninstall https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-920/5/artifact/yetus-general-check/output/patch-mvninstall-root.txt
checkstyle https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-920/5/artifact/yetus-general-check/output/diff-checkstyle-phoenix-core.txt
unit https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-920/5/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-920/5/testReport/
Max. process+thread count 6183 (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-920/5/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.

@virajjasani virajjasani changed the title PHOENIX-6129 : Use same connection for tableExists() and getTable() in same method to retrieve correct MUTEX table PHOENIX-6129 : Optimize tableExists() call while retrieving correct MUTEX table Oct 20, 2020
@stoty
Copy link
Contributor

stoty commented Oct 20, 2020

💔 -1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 5m 45s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+1 💚 hbaseanti 0m 0s Patch does not have any anti-patterns.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
-1 ❌ 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 💚 mvninstall 14m 44s master passed
+1 💚 compile 1m 2s master passed
+1 💚 checkstyle 1m 6s master passed
+1 💚 javadoc 0m 48s master passed
+0 🆗 spotbugs 3m 9s phoenix-core in master has 973 extant spotbugs warnings.
_ Patch Compile Tests _
+1 💚 mvninstall 9m 4s the patch passed
+1 💚 compile 0m 57s the patch passed
+1 💚 javac 0m 57s the patch passed
-1 ❌ checkstyle 1m 8s phoenix-core: The patch generated 31 new + 2191 unchanged - 50 fixed = 2222 total (was 2241)
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
+1 💚 javadoc 0m 47s the patch passed
+1 💚 spotbugs 3m 19s phoenix-core generated 0 new + 972 unchanged - 1 fixed = 972 total (was 973)
_ Other Tests _
-1 ❌ unit 164m 43s phoenix-core in the patch failed.
+1 💚 asflicense 0m 24s The patch does not generate ASF License warnings.
209m 18s
Reason Tests
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-920/6/artifact/yetus-general-check/output/Dockerfile
GITHUB PR #920
Optional Tests dupname asflicense javac javadoc unit spotbugs hbaseanti checkstyle compile
uname Linux 8835fa318632 4.15.0-112-generic #113-Ubuntu SMP Thu Jul 9 23:41:39 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev/phoenix-personality.sh
git revision master / 4703e46
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-920/6/artifact/yetus-general-check/output/diff-checkstyle-phoenix-core.txt
unit https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-920/6/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-920/6/testReport/
Max. process+thread count 6239 (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-920/6/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.

Copy link
Contributor

@ChinmaySKulkarni ChinmaySKulkarni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some comments. One generic question regarding your finding:

Connection.getTable() has no guarantee that it will throw TableNotFoundException if table doesn't exist.

CQSI.getTable() depends on HBaseFactoryProvider.getHTableFactory().getTable() which internally also uses connection.getTable(). As you can see from the CQSI.getTable() code, it tries to catch TableNotFoundException and probably expects one to be thrown if the table doesn't exist. As per your findings however, this is not guaranteed. This is a problem right? Do we need a separate Jira for this (if yes, can you please open one and mention your findings there)

} else if (admin.tableExists(TableName.valueOf(
SchemaUtil.getPhysicalTableName(SYSTEM_MUTEX_NAME, props).getName()))) {
sysMutexPhysicalTableNameBytes = SchemaUtil.getPhysicalTableName(SYSTEM_MUTEX_NAME, props).getName();
private Table getSysMutexTable() throws SQLException, IOException {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a unit test for this new method.

@ChinmaySKulkarni
Copy link
Contributor

@virajjasani please also make the commit message the same as the Jira (or update the Jira if you think this is more appropriate).

@virajjasani
Copy link
Contributor Author

@ChinmaySKulkarni I have addressed your comments, updated Jira message and created Jira PHOENIX-6203 for TNFE issue.
Could you please take a look?

Thanks for the review!

@stoty
Copy link
Contributor

stoty commented Oct 21, 2020

💔 -1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 36s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+1 💚 hbaseanti 0m 0s Patch does not have any anti-patterns.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 1 new or modified test files.
_ master Compile Tests _
+1 💚 mvninstall 15m 51s master passed
+1 💚 compile 1m 11s master passed
+1 💚 checkstyle 1m 17s master passed
+1 💚 javadoc 0m 55s master passed
+0 🆗 spotbugs 3m 35s phoenix-core in master has 970 extant spotbugs warnings.
_ Patch Compile Tests _
+1 💚 mvninstall 9m 53s the patch passed
+1 💚 compile 1m 6s the patch passed
+1 💚 javac 1m 6s the patch passed
-1 ❌ checkstyle 1m 18s phoenix-core: The patch generated 32 new + 2194 unchanged - 50 fixed = 2226 total (was 2244)
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
+1 💚 javadoc 0m 53s the patch passed
+1 💚 spotbugs 4m 17s phoenix-core generated 0 new + 969 unchanged - 1 fixed = 969 total (was 970)
_ Other Tests _
-1 ❌ unit 111m 28s phoenix-core in the patch failed.
+1 💚 asflicense 0m 30s The patch does not generate ASF License warnings.
155m 33s
Reason Tests
Failed junit tests phoenix.end2end.TableSnapshotReadsMapReduceIT
phoenix.end2end.index.LocalImmutableNonTxIndexIT
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-920/7/artifact/yetus-general-check/output/Dockerfile
GITHUB PR #920
Optional Tests dupname asflicense javac javadoc unit spotbugs hbaseanti checkstyle compile
uname Linux 7845ebd69e68 4.15.0-58-generic #64-Ubuntu SMP Tue Aug 6 11:12:41 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev/phoenix-personality.sh
git revision master / 8c81131
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-920/7/artifact/yetus-general-check/output/diff-checkstyle-phoenix-core.txt
unit https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-920/7/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-920/7/testReport/
Max. process+thread count 6514 (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-920/7/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.

@stoty
Copy link
Contributor

stoty commented Oct 22, 2020

💔 -1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 2m 0s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+1 💚 hbaseanti 0m 0s Patch does not have any anti-patterns.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 1 new or modified test files.
_ master Compile Tests _
+1 💚 mvninstall 15m 15s master passed
+1 💚 compile 1m 7s master passed
+1 💚 checkstyle 1m 9s master passed
+1 💚 javadoc 0m 51s master passed
+0 🆗 spotbugs 3m 20s phoenix-core in master has 970 extant spotbugs warnings.
_ Patch Compile Tests _
+1 💚 mvninstall 11m 0s the patch passed
+1 💚 compile 1m 3s the patch passed
+1 💚 javac 1m 3s the patch passed
-1 ❌ checkstyle 1m 9s phoenix-core: The patch generated 3 new + 2223 unchanged - 21 fixed = 2226 total (was 2244)
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
+1 💚 javadoc 0m 50s the patch passed
+1 💚 spotbugs 3m 35s phoenix-core generated 0 new + 969 unchanged - 1 fixed = 969 total (was 970)
_ Other Tests _
-1 ❌ unit 152m 0s phoenix-core in the patch failed.
+1 💚 asflicense 0m 22s The patch does not generate ASF License warnings.
196m 10s
Reason Tests
Failed junit tests phoenix.end2end.OrphanViewToolIT
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-920/8/artifact/yetus-general-check/output/Dockerfile
GITHUB PR #920
Optional Tests dupname asflicense javac javadoc unit spotbugs hbaseanti checkstyle compile
uname Linux 962ce30e7af0 4.15.0-112-generic #113-Ubuntu SMP Thu Jul 9 23:41:39 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev/phoenix-personality.sh
git revision master / 8c81131
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-920/8/artifact/yetus-general-check/output/diff-checkstyle-phoenix-core.txt
unit https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-920/8/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-920/8/testReport/
Max. process+thread count 6202 (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-920/8/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.

@virajjasani
Copy link
Contributor Author

@ChinmaySKulkarni please take a look when you get time. Failed tests are not relevant.

Copy link
Contributor

@ChinmaySKulkarni ChinmaySKulkarni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1. Thanks for fixing this @virajjasani !

@ChinmaySKulkarni ChinmaySKulkarni merged commit b9fb461 into apache:master Oct 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants