dcapwell commented on code in PR #4328:
URL: https://github.com/apache/cassandra/pull/4328#discussion_r2294038760


##########
src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java:
##########
@@ -948,20 +949,28 @@ public List<ReferenceOperation> getSubstitutions()
         return operations.allSubstitutions();
     }
 
-    public TxnWrite.Fragment getTxnWriteFragment(int index, ClientState state, 
QueryOptions options, PartitionKey partitionKey)
+    public List<TxnWrite.Fragment> getTxnWriteFragment(int index, ClientState 
state, QueryOptions options, PartitionKey partitionKey)
     {
-        PartitionUpdate baseUpdate = getTxnUpdate(state, options);
-        TxnReferenceOperations referenceOps = getTxnReferenceOps(options, 
state);
-        long timestamp = attrs.isTimestampSet() ? 
attrs.getTimestamp(TxnWrite.NO_TIMESTAMP, options) : TxnWrite.NO_TIMESTAMP;
-        return new TxnWrite.Fragment(partitionKey, index, baseUpdate, 
referenceOps, timestamp);
+        return getTxnWriteFragment(index, state, options, baseUpdate -> {
+            
Invariants.require(baseUpdate.partitionKey().equals(partitionKey.partitionKey()),
 "PartitionUpdate generated a partition key different than the one excepted");

Review Comment:
   safety check mostly.  Never hit this, but the signatures allow this to 
happen, so added this guard



-- 
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]

Reply via email to