sashapolo commented on code in PR #5242:
URL: https://github.com/apache/ignite-3/pull/5242#discussion_r1959570526
##########
modules/partition-replicator/src/main/java/org/apache/ignite/internal/partition/replicator/raft/snapshot/outgoing/OutgoingSnapshot.java:
##########
@@ -515,14 +563,20 @@ public boolean alreadyPassed(int tableId, RowId rowId) {
assert mvOperationsLock.isLocked() : "MV operations lock must be
acquired!";
if (mvPartitionDeliveryState == null) {
- // We haven't started sending MV data yet.
+ // We haven't even frozen the snapshot scope yet.
return false;
}
- if (finishedMvData()) {
+ // First, check if all MV data is delivered, because it can also be
empty.
+ if (mvPartitionDeliveryState.isExhausted() ||
!mvPartitionDeliveryState.containsTableId(tableId)) {
Review Comment:
> Can this check be made out of this method, before calling alreadyPassed()?
I don't like this approach, because it makes the `OutgoingSnapshot` protocol
more complex for the callers. Also, the javadoc of this method states:
```
Returns {@code true} if the given {@link RowId} does not interfere with the
rows that this snapshot is going to send ```
So it makes sense to keep this check inside.
As for the renaming, I agree to do that.
##########
modules/partition-replicator/src/main/java/org/apache/ignite/internal/partition/replicator/raft/snapshot/outgoing/OutgoingSnapshot.java:
##########
@@ -515,14 +563,20 @@ public boolean alreadyPassed(int tableId, RowId rowId) {
assert mvOperationsLock.isLocked() : "MV operations lock must be
acquired!";
if (mvPartitionDeliveryState == null) {
- // We haven't started sending MV data yet.
+ // We haven't even frozen the snapshot scope yet.
return false;
}
- if (finishedMvData()) {
+ // First, check if all MV data is delivered, because it can also be
empty.
+ if (mvPartitionDeliveryState.isExhausted() ||
!mvPartitionDeliveryState.containsTableId(tableId)) {
Review Comment:
> Can this check be made out of this method, before calling alreadyPassed()?
I don't like this approach, because it makes the `OutgoingSnapshot` protocol
more complex for the callers. Also, the javadoc of this method states:
```
Returns {@code true} if the given {@link RowId} does not interfere with the
rows that this snapshot is going to send
```
So it makes sense to keep this check inside.
As for the renaming, I agree to do that.
--
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]