rpuch commented on code in PR #1246:
URL: https://github.com/apache/ignite-3/pull/1246#discussion_r1006542603
##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/raft/snapshot/outgoing/OutgoingSnapshot.java:
##########
@@ -133,49 +155,35 @@ CompletableFuture<SnapshotMetaResponse>
handleSnapshotMetaRequest(SnapshotMetaRe
}
/**
- * Reads chunk of partition data and returns a future with the response.
+ * Reads a chunk of partition data and returns a future with the response.
*
* @param request Data request.
*/
CompletableFuture<SnapshotMvDataResponse>
handleSnapshotMvDataRequest(SnapshotMvDataRequest request) {
- // TODO: IGNITE-17935 - executor?
-
- assert !finished;
+ assert !finishedMvData : "MV data sending has already been finished";
long totalBatchSize = 0;
List<SnapshotMvDataResponse.ResponseEntry> batch = new ArrayList<>();
while (true) {
- acquireLock();
-
- try {
+ try (AutoLockup ignored = acquireMvLock()) {
totalBatchSize = fillWithOutOfOrderRows(batch, totalBatchSize,
request);
totalBatchSize = tryProcessRowFromPartition(batch,
totalBatchSize, request);
if (exhaustedPartition() && outOfOrderMvData.isEmpty()) {
- finished = true;
+ finishedMvData = true;
Review Comment:
You are right, the situation when the queue is not empty, but the partition
is exhausted could only happen if something was enqueued while reading the
partition, which is not possible due to locks.
Simplified the code.
--
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]