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

Tania S Engel commented on CASSANDRA-10876:
-------------------------------------------

Cassandra data models are based on queries so tables can often be the same 
partition key with different frequently queried data points making up the 
clustering keys. In that case, the data being the same, it's also quite common 
to want to atomically batch insert the data. In this example, which I also 
posted on stack overflow,

[https://stackoverflow.com/questions/50652243/can-a-cassandra-partition-key-span-multiple-tables-in-one-keyspace]

would the coordinator farm these inserts out to different nodes given a RF < 
nodes? Or would the partition key, albeit in different tables, hash to the same 
value? I ask because of all the recommendations not to use multiple partition 
batches. And, in our design we are still seeing these batch_size_warn_threshold 
warnings in 3.11.1. 

 

use logskeyspace;

CREATE TABLE Log_User(LogDay timestamp, UserId int, EventId int) PRIMARY KEY 
(Day, UserId)

CREATE TABLE Log_Event(LogDay timestamp, EventId int,  UserId int) PRIMARY KEY 
(Day, EventId)

BEGIN BATCH

INSERT INTO Log_User(LogDay timestamp,  UserId int, EventId int) 
VALUES("2018-03-21 00:00Z", 10, 23);

INSERT INTO Log_Event(LogDay timestamp, EventId int,  UserId int) 
VALUES("2018-03-21 00:00Z", 23, 10);

APPLY BATCH;

> Alter behavior of batch WARN and fail on single partition batches
> -----------------------------------------------------------------
>
>                 Key: CASSANDRA-10876
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-10876
>             Project: Cassandra
>          Issue Type: Improvement
>            Reporter: Patrick McFadin
>            Assignee: Sylvain Lebresne
>            Priority: Minor
>              Labels: lhf
>             Fix For: 3.6
>
>         Attachments: 10876.txt
>
>
> In an attempt to give operator insight into potentially harmful batch usage, 
> Jiras were created to log WARN or fail on certain batch sizes. This ignores 
> the single partition batch, which doesn't create the same issues as a 
> multi-partition batch. 
> The proposal is to ignore size on single partition batch statements. 
> Reference:
> [CASSANDRA-6487|https://issues.apache.org/jira/browse/CASSANDRA-6487]
> [CASSANDRA-8011|https://issues.apache.org/jira/browse/CASSANDRA-8011]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to