cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aleksey Yeschenko (JIRA)" <>
Subject [jira] [Updated] (CASSANDRA-5415) Batch with timestamp failed
Date Sun, 07 Apr 2013 20:45:16 GMT


Aleksey Yeschenko updated CASSANDRA-5415:

    Attachment: 5415.txt

BatchStatement.getMutations() currently modifies its nested modification statements when you
set a batch-level timestamp:

for (ModificationStatement statement : statements)
    if (isSetTimestamp())

Because of this, only the first execution of such a prepared statement will succeed. All subsequent
attempts will fall because of this check in BatchStatement.validate():

for (ModificationStatement statement : statements)
    if (isSetTimestamp() && statement.isSetTimestamp())
        throw new InvalidRequestException("Timestamp must be set either on BATCH or individual

The attached patch fixes this.
> Batch with timestamp failed
> ---------------------------
>                 Key: CASSANDRA-5415
>                 URL:
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.2.3
>            Reporter: Alexey Tereschenko
>            Assignee: Aleksey Yeschenko
>            Priority: Minor
>             Fix For: 1.2.4
>         Attachments: 5415.txt
> When I create a prepared statement with the following CQL3 using Thrift protocol:
> {code}
> <some INSERT INTO or UPDATE statements ....>
> {code}
> and execute this statement in a loop, I randomly get the error:
> *InvalidRequestException(why:Timestamp must be set either on BATCH or individual statements)*
> All statements inside the batch have no individual USING TIMESTAMP.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message