belliottsmith commented on code in PR #4583:
URL: https://github.com/apache/cassandra/pull/4583#discussion_r2987736676
##########
src/java/org/apache/cassandra/cql3/statements/TransactionStatement.java:
##########
@@ -556,6 +560,36 @@ public ResultMessage execute(QueryState state,
QueryOptions options, Dispatcher.
checkTrue(returningSelect.select.getLimit(options) ==
DataLimits.NO_LIMIT, NO_PARTITION_IN_CLAUSE_WITH_LIMIT, "SELECT",
returningSelect.select.source);
}
+ // check that within a transaction we don't have multiple updates to
the same primary key, column pair
+ HashMap<RowKey, Columns> seenRegularColumns = new HashMap<>();
+ HashMap<DecoratedKey, Columns> seenStaticColumns = new HashMap<>();
+
+ for (ModificationStatement statement : updates)
+ {
+ List<RowKey> rowKeys =
statement.getRowKeys(state.getClientState(), options);
Review Comment:
I missed this on prior review, but this looks to be potentially rather
expensive, since we redundantly construct the `PartitionUpdate`. It would be
better to roll this check into a place we already have constructed this, or if
this is impossible to build the minimal amount of information to get the row
keys.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]