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

Rajeshbabu Chintaguntla edited comment on PHOENIX-6590 at 11/23/21, 3:12 AM:
-----------------------------------------------------------------------------

[~stoty]
bq.How is this feautere different from simply setting the batch size to 1 ?
As discussed we can use phoenix.connection.autoCommit config to control 
autocommit to be enabled/disable in phoenix workers instead of changing the 
batchsize so am reverting the changes done to enable to auto commit.

bq.The only way I can think of that would get the Spark transactional behaviour 
is using Phoenix transactional tables and not using batch commit at all.I don't 
know how well Phoenix handles transactions of many thousads of millons of rows, 
either via Tephra or Omid)

The main goal here it make the Tephra or Omid transactional system to handle 
transactions on transactional tables in spark connector instead of spark 
handles transactions. While running the batch wise commits or partition wise 
commits the transactions can be enabled in phoenix workers so that conflicts 
introduced in other streaming applications or spark jobs can be detected in the 
ongoing transactions, rollback and retry the spark tasks so that database can 
have consistent data.

Currently there is no way specify whether to use batch wise transactions or 
task wise transactions in spark jobs but as you suggested we can control it by 
changing the batch size phoenix.upsert.batch.size config value like if we set 
bigger value only one transaction can be run for partition etc. but we cannot 
determine users workload so better to make to 0 or -1 so that batchwise commits 
can be disabled or enabled.

Rollbacks are properly handled by Omid in case of conflicts detected but in 
case any other failures better to handle the rollbacks in abort api provided by 
datasource so that no hanging transactions to wait for timeouts.

As part of the JIRA add more tests to check transactions with transactional 
tables,handle the rollbacks and can can consider batch size 0 means task wise 
commits instead of batchwise transactions.


was (Author: rajeshbabu):
[~stoty]
bq.How is this feautere different from simply setting the batch size to 1 ?
As discussed we can use phoenix.connection.autoCommit config to control 
autocommit to be enabled/disable in phoenix workers instead of changing the 
batchsize so am reverting the changes done to enable to auto commit.

bq.The only way I can think of that would get the Spark transactional behaviour 
is using Phoenix transactional tables and not using batch commit at all.I don't 
know how well Phoenix handles transactions of many thousads of millons of rows, 
either via Tephra or Omid)

The main goal here it make the Tephra or Omid transactional system to handle 
transactions on transactional tables in spark connector instead of spark 
handles transactions. While running the batch wise commits or partition wise 
commits the transactions can be enabled in phoenix workers so that conflicts 
introduced in other streaming applications or spark jobs can be detected in the 
ongoing transactions, rollback and retry the spark tasks so that database can 
have consistent data.

Currently there is no way specify whether to use batch wise transactions or 
task wise transactions in spark jobs but as you suggested we can control it by 
changing the batch size phoenix.upsert.batch.size config value like if we set 
bigger value only one transaction can be run for partition etc.


> Add autocommit option to enable/disable autocommit on phoenix connections 
> created in workers
> --------------------------------------------------------------------------------------------
>
>                 Key: PHOENIX-6590
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-6590
>             Project: Phoenix
>          Issue Type: Sub-task
>          Components: spark-connector
>            Reporter: Rajeshbabu Chintaguntla
>            Assignee: Rajeshbabu Chintaguntla
>            Priority: Major
>




--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to