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

James Taylor commented on PHOENIX-1257:
---------------------------------------

[~lhofhansl] - I agree it's important that this get fixed. The issue is likely 
in ChunkedResultIterator or UpsertCompiler. It looks like we're not keeping the 
max timestamp range of the scan constant across multiple batches of scans 
and/or commits. They way it *should* work is that the max timestamp of the 
scans for the SELECT part of the query is set based on the timestamp we get 
back when we resolve the table. Then the Puts for the UPSERT part should use 
that timestamp (and thus won't be seen by the scans). My guess is that we're 
correctly doing that for the first batch, but not for subsequent batches. 

The SELECT part will get chunked up by the ChunkedResultIterator, so that's the 
first place I'd look. Start with a unit test that repros it by setting the 
phoenix.query.scanResultChunkSize property to a smaller size (so you don't have 
to upsert as many rows). Check what the timeRange is for the initial scan 
(ChunkedResultIterator:81) versus subsequent scans (ChunkedResultIterator:115) 
for the next batch.

We're trying to get a 3.2/4.2 RC out at the end of the week. Maybe you can take 
a look, [~lhofhansl]? Or [~gabriel.reid]?

> Strange behavior wirh "upsert into ... select from ..." with sequences
> ----------------------------------------------------------------------
>
>                 Key: PHOENIX-1257
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-1257
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: Lars Hofhansl
>
> I have the following scenario:
> create sequence keys;
> create table X (pk unsigned_long primary key, val integer);
> upsert into x values (1,1);
> Followed by repeated:
> upsert into x select next value for keys, val from x;
> This works well until 2048 rows are inserted. The next
> upsert into x select next value for keys, val from x;
> That loops forever inserting more and more rows until it is stopped.



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

Reply via email to