You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "xwxingyi (JIRA)" <ji...@apache.org> on 2015/01/13 05:45:34 UTC

[jira] [Commented] (PHOENIX-1336) Exception when select from local index:Cache of region boundaries are out of date

    [ https://issues.apache.org/jira/browse/PHOENIX-1336?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14274706#comment-14274706 ] 

xwxingyi commented on PHOENIX-1336:
-----------------------------------

rajeshbabu:

Maybe we found the reason of this problem.
When we create main table with salt buckets, the main table was split to several regions at the beginning. Then the local index of this table also will use salt buckets. Which means that the start row and end row of one region of local index should be using with a prefix. For example, when salt buckets = 7, the prefix is 0x00 to 0x06.

With the prefix, the error accuses.
Our logs shows that:
lowerInclusiveScanKey: 00 01 31 34 31 39 39 31 33 35 36 32 00 30 61 34 64 30 64 31 35 64 32 32 33 39 65 38 39 35 37 61 39 38 38 30 33 34 38 39 62 65 36 61 31
upperExclusiveScanKey: 04 00 01 31 34 31 39 39 31 35 36 30 30 00
expectedUpperRegionKey: 05

The lower scan key of this scan is from last ptr (Which I think is using for record a offset of scan process)
However, the scan region is not right for that the start row is not generate with prefix.
scan.setStartRow(ByteUtil.copyKeyBytesIfNecessary(lastKey);

We think that, if the log look like the following, it should be right:
lowerInclusiveScanKey: 04 00 01 31 34 31 39 39 31 33 35 36 32 00 30 61 34 64 30 64 31 35 64 32 32 33 39 65 38 39 35 37 61 39 38 38 30 33 34 38 39 62 65 36 61 31
upperExclusiveScanKey: 04 00 01 31 34 31 39 39 31 35 36 30 30 00
expectedUpperRegionKey: 05

But we do not know how to get the prefix from the scan class... Maybe get the first byte of the endRow is a good idea.
Wait for you reply!


> Exception when select from local index:Cache of region boundaries are out of date
> ---------------------------------------------------------------------------------
>
>                 Key: PHOENIX-1336
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-1336
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 4.1
>         Environment: jdk1.6 linux
>            Reporter: jelly Chen
>            Assignee: rajeshbabu
>         Attachments: exception.txt, hbase-cmf-hbase-MASTER-hdh138.log.out, hbase-cmf-hbase-REGIONSERVER-hdh138.log.out, hbase-cmf-hbase-REGIONSERVER-hdh139.log.out, hbase-cmf-hbase-REGIONSERVER-hdh140.log.out, regioninfos.txt
>
>
> when i select a colomn which indexed by local index(so local index will be used) from a primary table,
> it occurs an Exception:‍
> ----------------------------------------------------------------------------------------------------
> 14/10/10 19:49:03 DEBUG iterate.ChunkedResultIterator: Get first chunked result iterator over LOCAL_1000W_P with {"timeRange":[0,1412941671047],"batch":-1,"startRow":"\\x80\\x00\\x00\\x00\\x13/(M\\x80\\x00\\x00\\x00\\x00\\x00\\x00\\xA5\\x00\\x0D","stopRow":"\\x80\\x00\\x00\\x00\\x13/(M\\x80\\x00\\x00\\x00\\x00\\x00\\x00\\xA5\\x00\\x0E","loadColumnFamiliesOnDemand":null,"totalColumns":1,"cacheBlocks":true,"families":{"0":["ALL"]},"maxResultSize":-1,"maxVersions":1,"filter":"","caching":100}
> 14/10/10 19:49:03 DEBUG iterate.ChunkedResultIterator: Get next chunked result iterator over LOCAL_1000W_P with {"timeRange":[0,1412941671047],"batch":-1,"startRow":"\\x00\\x0DWJ11VS888\\x00\\x80\\x00\\x00\\x00\\x12\\xDB3\\xB4\\x80\\x00\\x00\\x00\\x00\\x00\\x00^","stopRow":"\\x80\\x00\\x00\\x00\\x12\\xD8\\x1B\\xF5\\x00\\x0E","loadColumnFamiliesOnDemand":null,"totalColumns":1,"cacheBlocks":true,"families":{"0":["ALL"]},"maxResultSize":-1,"maxVersions":1,"filter":"","caching":100}
> org.apache.phoenix.schema.StaleRegionBoundaryCacheException: ERROR 1108 (XCL07): Cache of region boundaries are out of date.
> 	at org.apache.phoenix.exception.SQLExceptionCode$13.newException(SQLExceptionCode.java:271)
> 	at org.apache.phoenix.exception.SQLExceptionInfo.buildException(SQLExceptionInfo.java:133)
> 	at org.apache.phoenix.util.ServerUtil.parseRemoteException(ServerUtil.java:124)
> 	at org.apache.phoenix.util.ServerUtil.parseServerExceptionOrNull(ServerUtil.java:108)
> 	at org.apache.phoenix.util.ServerUtil.parseServerException(ServerUtil.java:97)
> 	at org.apache.phoenix.iterate.TableResultIterator.<init>(TableResultIterator.java:57)
> 	at org.apache.phoenix.iterate.ChunkedResultIterator.getResultIterator(ChunkedResultIterator.java:118)
> 	at org.apache.phoenix.iterate.ChunkedResultIterator.peek(ChunkedResultIterator.java:94)
> 	at org.apache.phoenix.iterate.MergeSortResultIterator.minIterator(MergeSortResultIterator.java:68)
> 	at org.apache.phoenix.iterate.MergeSortResultIterator.next(MergeSortResultIterator.java:90)
> 	at org.apache.phoenix.jdbc.PhoenixResultSet.next(PhoenixResultSet.java:732)
> 	at com.hikvision.traffic.sql.test.TestSQL.testPhoenix(TestSQL.java:77)
> ----------------------------------------------------------------------------------------------------	
> the related query is "select plateinfo from v_pass_1000w".
> The exception show cache of region boundaries are out of date,but haven‘t region changed the whole process.
> the same excepton occcurs when direct to query from index "select * from LOCAL_1000W_P".
> The related scheme as follow:
> CREATE TABLE IF NOT EXISTS V_PASS_1000W (
>      VEHICLELSH BIGINT NOT NULL,
>      CROSSLSH BIGINT NOT NULL,
>      DEVICEINDEX VARCHAR(32),
>      VEHICLEINDEX VARCHAR(7),
>      DIRECTINDEX VARCHAR(4),
>      PLATEINFO VARCHAR(15),
>      PLATETYPE BIGINT,
>      PASSTIME TIMESTAMP,
>      /*PASSTIME VARCHAR(50),*/
>      VEHICLESPEED BIGINT,
>      VEHICLELEN BIGINT,
>      PLATECOLOR BIGINT,
>      PICFEATURE VARCHAR(64),
>      PICFULLVIEW VARCHAR(64),
>      PICFTPPATH VARCHAR(100),
>      DOWNLOADFLAG BIGINT,
>      PICLOCALPATH VARCHAR(100),
>      DRIVEWAYNUMBER BIGINT,
>      VEHICLETYPE BIGINT,
>      VEHICLECOLOR BIGINT,
>      VEHICLESTATE BIGINT,
>      VEHCOLORDEPTH BIGINT,
>      RECORDID VARCHAR(31),
>      SENDFLAG BIGINT,
>      VRPLSH BIGINT,
>      CREATEDATE TIMESTAMP
>      /*CREATEDATE VARCHAR(50)*/
>      CONSTRAINT PK PRIMARY KEY (VEHICLELSH,CROSSLSH)
> );
> > select * from LOCAL_1000W_P limit 2;
> +-------------+-------------+------------+
> | 0:PLATEINFO | :VEHICLELSH | :CROSSLSH  |
> +-------------+-------------+------------+
> | WJ0000009   | 323085883   | 117        |
> | WJ0000021   | 320798157   | 181        |
> +-------------+-------------+------------+



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