phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "chenglei (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (PHOENIX-2613) if any column of multi-part primary key is null, the Skip Scan may cause RegionServer scan indefinite loop
Date Wed, 20 Jan 2016 15:19:40 GMT

     [ https://issues.apache.org/jira/browse/PHOENIX-2613?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

chenglei updated PHOENIX-2613:
------------------------------
    Description: 
In pheonix 4.6,any column of multi-part primary key can be null.If a table has one row which
has a column of multi-part primary key is null, when we do a query,the Skip Scan may cause
RegionServer scan indefinite loop,just as the follow unit test:

{code:borderStyle=solid}

@Test
public void testNullInfiniteLoop() throws Exception
{
	this.jdbcTemplate.update("drop table if exists NULL_TEST ");
		
	this.jdbcTemplate.update(
          "create table NULL_TEST"+
          "("+
                 "CREATETIME VARCHAR,"+
                 "ACCOUNTID VARCHAR,"+
                 "SERVICENAME VARCHAR,"+
                 "SPAN.APPID VARCHAR,"+
                 "CONSTRAINT pk PRIMARY KEY(CREATETIME,ACCOUNTID,SERVICENAME)"+
          ")");
		
	this.jdbcTemplate.update("upsert into NULL_TEST(CREATETIME,SERVICENAME,SPAN.APPID) values('20160116141006','servlet','android')");
	this.jdbcTemplate.update("upsert into NULL_TEST(CREATETIME,ACCOUNTID,SERVICENAME,SPAN.APPID)
values('20160116151006','2404787','jdbc','ios')");
	this.jdbcTemplate.queryForList("select * from NULL_TEST where CREATETIME>='20160116121006'
and  CREATETIME<='20160116181006' and ACCOUNTID='2404787'");
				
}
{code}

as above unit test explained,we create a NULL_TEST table, and insert  a row which ACCOUNT
column is null, When we do a query which condition is  CREATETIME column and ACCOUNTID column,
Phoenix will use SkipScanFilter to scan the table. Unfortunately,the query will run forever,can
not return result.



  was:
In pheonix 4.6,any column of multi-part primary key can be null.If a table has one row which
has a column of multi-part primary key is null, when we do a query,the Skip Scan may cause
RegionServer scan indefinite loop,just as the follow unit test:

{code:borderStyle=solid}

@Test
public void testNullInfiniteLoop() throws Exception
{
	this.jdbcTemplate.update("drop table if exists NULL_TEST ");
		
	this.jdbcTemplate.update(
          "create table NULL_TEST"+
          "("+
                 "CREATETIME VARCHAR,"+
                 "ACCOUNTID VARCHAR,"+
                 "SERVICENAME VARCHAR,"+
                 "SPAN.APPID VARCHAR,"+
                 "CONSTRAINT pk PRIMARY KEY(CREATETIME,ACCOUNTID,SERVICENAME)"+
          ")");
		
	this.jdbcTemplate.update("upsert into NULL_TEST(CREATETIME,SERVICENAME,SPAN.APPID) values('20160116141006','servlet','android')");
	this.jdbcTemplate.update("upsert into NULL_TEST(CREATETIME,ACCOUNTID,SERVICENAME,SPAN.APPID)
values('20160116151006','2404787','jdbc','ios')");
	this.jdbcTemplate.queryForList("select * from NULL_TEST where CREATETIME>='20160116121006'
and  CREATETIME<='20160116181006' and ACCOUNTID='2404787'");
				
}
{code}

as above unit test explained,we create a NULL_TEST table, and insert  a row which ACCOUNT
column is null, When we do a query which condition is  CREATETIME column and ACCOUNTID column,
Phoenix will use SkipScanFilter to scan the table. Unfortunately,the query will run forever.




> if any column of multi-part primary key is null, the Skip Scan may cause RegionServer
scan indefinite loop
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: PHOENIX-2613
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-2613
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 4.6.0
>         Environment: HBase 0.98.6-cdh5.3.2, Phoenix 4.6.0-HBase-0.98
>            Reporter: chenglei
>
> In pheonix 4.6,any column of multi-part primary key can be null.If a table has one row
which has a column of multi-part primary key is null, when we do a query,the Skip Scan may
cause RegionServer scan indefinite loop,just as the follow unit test:
> {code:borderStyle=solid}
> @Test
> public void testNullInfiniteLoop() throws Exception
> {
> 	this.jdbcTemplate.update("drop table if exists NULL_TEST ");
> 		
> 	this.jdbcTemplate.update(
>           "create table NULL_TEST"+
>           "("+
>                  "CREATETIME VARCHAR,"+
>                  "ACCOUNTID VARCHAR,"+
>                  "SERVICENAME VARCHAR,"+
>                  "SPAN.APPID VARCHAR,"+
>                  "CONSTRAINT pk PRIMARY KEY(CREATETIME,ACCOUNTID,SERVICENAME)"+
>           ")");
> 		
> 	this.jdbcTemplate.update("upsert into NULL_TEST(CREATETIME,SERVICENAME,SPAN.APPID) values('20160116141006','servlet','android')");
> 	this.jdbcTemplate.update("upsert into NULL_TEST(CREATETIME,ACCOUNTID,SERVICENAME,SPAN.APPID)
values('20160116151006','2404787','jdbc','ios')");
> 	this.jdbcTemplate.queryForList("select * from NULL_TEST where CREATETIME>='20160116121006'
and  CREATETIME<='20160116181006' and ACCOUNTID='2404787'");
> 				
> }
> {code}
> as above unit test explained,we create a NULL_TEST table, and insert  a row which ACCOUNT
column is null, When we do a query which condition is  CREATETIME column and ACCOUNTID column,
Phoenix will use SkipScanFilter to scan the table. Unfortunately,the query will run forever,can
not return result.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message