ptupitsyn commented on code in PR #3713:
URL: https://github.com/apache/ignite-3/pull/3713#discussion_r1593688755
##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/replicator/PartitionReplicaListener.java:
##########
@@ -2374,7 +2374,13 @@ private CompletableFuture<ReplicaResult>
processMultiEntryAction(ReadWriteMultiR
rowIdFuts[i] = resolveRowByPk(pk, txId, (rowId, row,
lastCommitTime) -> {
if (isDelete && rowId == null) {
- // Does not exist, nothing to delete.
+ // Does not exist in storage, nothing to delete.
+ // If there was an insert in this batch before, we
need to skip it.
+ Integer prevRowIdx =
newKeyMap.remove(pk.byteBuffer());
Review Comment:
You are right, it is not safe, and also not efficient.
Reworked the code to detect duplicate keys in a separate loop before taking
any locks or doing any async work.
--
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]