phoenix-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geoffrey Jacoby (JIRA)" <>
Subject [jira] [Commented] (PHOENIX-5132) View indexes with different owners but of the same base table can be assigned same ViewIndexId
Date Mon, 11 Feb 2019 23:48:00 GMT


Geoffrey Jacoby commented on PHOENIX-5132:

My hunch is that this is a bigger deal for global view index + tenant view index, rather than
2 view indexes owned by different tenants. That's because I'd expect the automatic tenant-filtering
of a tenant connection to save us in the latter case, since ViewIndexId + TenantId would still
be unique to a single view index. 

> View indexes with different owners but of the same base table can be assigned same ViewIndexId
> ----------------------------------------------------------------------------------------------
>                 Key: PHOENIX-5132
>                 URL:
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 5.0.0, 4.14.1
>            Reporter: Geoffrey Jacoby
>            Assignee: Geoffrey Jacoby
>            Priority: Critical
>         Attachments: PHOENIX-5132-repro.patch
> All indexes on views for a particular base table are stored in the same physical HBase
table. Phoenix distinguishes them by prepending each row key with an encoded short or long
integer called a ViewIndexId. 
> The ViewIndexId is generated by using a sequence to guarantee that each view index id
is unique. Unfortunately, the sequence used follows a convention of [SaltByte, Tenant, Schema,
BaseTable] for its key, which means that there's a separate sequence for each tenant that
owns an index in the view index table. (See MetaDataUtil.getViewIndexSequenceKey) Since all
the sequences start at the same value, collisions are not only possible but likely. 
> I've written a test that confirms the ViewIndexId collision. This means it's very likely
that query results using one view index could mistakenly include rows from another index,
but I haven't confirmed this. 
> All view indexes for a base table, regardless of whether globally or tenant-owned, should
use the same sequence. 

This message was sent by Atlassian JIRA

View raw message