[
https://issues.apache.org/jira/browse/PHOENIX-7212?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17817150#comment-17817150
]
ASF GitHub Bot commented on PHOENIX-7212:
-----------------------------------------
palashc commented on code in PR #1823:
URL: https://github.com/apache/phoenix/pull/1823#discussion_r1488543940
##########
phoenix-core/src/test/java/org/apache/phoenix/cache/ServerMetadataCacheTest.java:
##########
@@ -1591,8 +1593,93 @@ public void
testAncestorLastDDLMapPopulatedInDifferentClient() throws Exception
}
}
+ /**
+ * Test that tenant connections are able to learn about state change of an
inherited index
+ * on their tenant views with different names.
+ */
+ @Test
+ public void testInheritedIndexOnTenantViewsDifferentNames() throws
Exception {
+ testInheritedIndexOnTenantViews(false);
+ }
+
+ /**
+ * Test that tenant connections are able to learn about state change of an
inherited index
+ * on their tenant views with same names.
+ */
+ @Test
+ public void testInheritedIndexOnTenantViewsSameNames() throws Exception {
Review Comment:
@tkhurana Added this test.
> Handle inherited indexes for tenant views when validating LAST_DDL_TIMESTAMPS
> -----------------------------------------------------------------------------
>
> Key: PHOENIX-7212
> URL: https://issues.apache.org/jira/browse/PHOENIX-7212
> Project: Phoenix
> Issue Type: Sub-task
> Reporter: Palash Chauhan
> Assignee: Palash Chauhan
> Priority: Major
>
> When a tenant view is resolved and it inherits an index from its parent
> view/table, a PTable object for the inherited index is added to the list of
> index PTables in the tenant view PTable object. This PTable object has a
> modified name of the form `TenantView#Index` and has its tenantId attribute
> set to that of the tenant view.
> During a query/upsert, along with the table/view, we also add the indexes of
> the table/view to the request for validating LAST_DDL_TIMESTAMP. We provide
> the key of the PTables i.e. (tenantId, schemaName, tableName) to the server.
> Server looks up its cache based on this key to find out the
> LAST_DDL_TIMESTAMP and if the key is not present, it fetches the table from
> SYSCAT.
> Suppose we perform a query on a tenant view which has inherited an index
> still in BUILDING state. After the query finishes, server would have cached
> (tenantId,schema,table) for the actual global index. The index is then built
> and its state changes to ACTIVE. Cache invalidation happens for the key
> (null, schema, table). A subsequent query on the tenant view will
> successfully validate the inherited index and will not learn about the state
> change.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)