richardantal commented on code in PR #2031:
URL: https://github.com/apache/phoenix/pull/2031#discussion_r2721306547
##########
phoenix-core/src/it/java/org/apache/phoenix/end2end/SystemTablesCreationOnConnectionIT.java:
##########
@@ -781,7 +786,6 @@ private PhoenixSysCatCreationTestingDriver
firstConnNSMappingServerEnabledClient
hbaseTables = getHBaseTables();
assertEquals(PHOENIX_SYSTEM_TABLES, hbaseTables);
assertEquals(0, countUpgradeAttempts);
- assertFalse(isSystemNamespaceCreated());
Review Comment:
This test was failing because of this and I was not able to disable the
creation of the SYSTEM namespace.
I don't think It was happening because of the code I added.
Here is my summary:
We start a mini cluster with NamespaceMapping enabled
in
[ConnectionQueryServicesImpl](https://github.com/apache/phoenix/blob/aecd1f51c9f9928d62ceb09380f25754d2054ad3/phoenix-core-client/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java#L2532)
we have this
```
byte[] physicalTableNameBytes = physicalTableName != null
? physicalTableName
: SchemaUtil.getPhysicalHBaseTableName(schemaBytes, tableBytes,
isNamespaceMapped).getBytes();
```
isNamespaceMapped is true here
and it will return byte name equivalent of "SYSTEM:CATALOG"
So later `ensureTableCreated(physicalTableNameBytes ...` makes sure we have
the table and SYSTEM namespace
https://github.com/apache/phoenix/blob/aecd1f51c9f9928d62ceb09380f25754d2054ad3/phoenix-core-client/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java#L1826
Here is a stacktrace and it looks like it got called because of a
SelfHealingTask where IS_SYSTEM_TABLE_MAPPED_TO_NAMESPACE is true
```
org.apache.phoenix.query.ConnectionQueryServicesImpl.createTable(ConnectionQueryServicesImpl.java:2558)
org.apache.phoenix.schema.MetaDataClient.createTableInternal(MetaDataClient.java:3748)
org.apache.phoenix.schema.MetaDataClient.createTable(MetaDataClient.java:1063)
org.apache.phoenix.compile.CreateTableCompiler$CreateTableMutationPlan.execute(CreateTableCompiler.java:760)
org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:663)
org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:610)
org.apache.phoenix.call.CallRunner.run(CallRunner.java:52)
org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:610)
org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:591)
org.apache.phoenix.jdbc.PhoenixStatement.executeUpdate(PhoenixStatement.java:2593)
org.apache.phoenix.query.ConnectionQueryServicesImpl$13.call(ConnectionQueryServicesImpl.java:4192)
org.apache.phoenix.query.ConnectionQueryServicesImpl$13.call(ConnectionQueryServicesImpl.java:4132)
org.apache.phoenix.util.PhoenixContextExecutor.call(PhoenixContextExecutor.java:71)
org.apache.phoenix.query.ConnectionQueryServicesImpl.init(ConnectionQueryServicesImpl.java:4132)
org.apache.phoenix.jdbc.PhoenixDriver.getConnectionQueryServices(PhoenixDriver.java:261)
org.apache.phoenix.jdbc.PhoenixEmbeddedDriver.createConnection(PhoenixEmbeddedDriver.java:145)
org.apache.phoenix.jdbc.PhoenixDriver.connect(PhoenixDriver.java:216)
java.sql.DriverManager.getConnection(DriverManager.java:664)
java.sql.DriverManager.getConnection(DriverManager.java:208)
org.apache.phoenix.util.QueryUtil.getConnection(QueryUtil.java:430)
org.apache.phoenix.util.QueryUtil.getConnectionOnServer(QueryUtil.java:408)
org.apache.phoenix.util.QueryUtil.getConnectionOnServer(QueryUtil.java:389)
org.apache.phoenix.coprocessor.TaskRegionObserver$SelfHealingTask.run(TaskRegionObserver.java:165)
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
java.util.concurrent.FutureTask.runAndReset$$$capture(FutureTask.java:308)
java.util.concurrent.FutureTask.runAndReset(FutureTask.java)
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
```
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]