You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Samarth Jain (JIRA)" <ji...@apache.org> on 2015/04/30 22:35:07 UTC

[jira] [Resolved] (PHOENIX-1943) UPSERT SELECT is not thread safe

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

Samarth Jain resolved PHOENIX-1943.
-----------------------------------
    Resolution: Invalid

> UPSERT SELECT is not thread safe
> --------------------------------
>
>                 Key: PHOENIX-1943
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-1943
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: Samarth Jain
>            Assignee: Samarth Jain
>
> When UPSERT SELECT is run on the client side, we use the UpsertingParallelIteratorFactory where every iterator returned by newIterator() method calls the UpsertSelect method. Each of these mutating iterators are called from different threads in parallel. However, the upsertSelect() method called from each of these iterators uses the same mutationState instance which is not thread safe. 
> In particular this code in UpsertCompiler#upsertSelect
> {code}
> PhoenixStatement statement = context.getStatement();
> PhoenixConnection connection = statement.getConnection();
> .....
> .....
> // Commit a batch if auto commit is true and we're at our batch size
>                 if (isAutoCommit && rowCount % batchSize == 0) {
>                     MutationState state = new MutationState(tableRef, mutation, 0, maxSize, connection);
>                     connection.getMutationState().join(state);
>                     connection.commit();
>                     mutation.clear();
>                 }
> {code}
> [~rajeshbabu] - I will try and get a fix for this by EOD today.
> FYI [~jamestaylor]



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