petrov-mg commented on code in PR #13686:
URL: https://github.com/apache/ignite/pull/13686#discussion_r4345341546
##########
modules/core/src/main/java/org/apache/ignite/internal/management/cache/VerifyBackupPartitionsTask.java:
##########
@@ -494,32 +483,43 @@ private Future<Map<PartitionKey, PartitionHashRecord>>
calculatePartitionHashAsy
if (!part.reserve())
return res;
+ if (!gctx.offheap().stoppageLock().enterBusy()) {
+ part.release();
+
+ return res;
+ }
+
+ boolean gwLocked = false;
+
try {
PartitionUpdateCounter updCntr =
part.dataStore().partUpdateCounter();
PartitionUpdateCounter updateCntrBefore = updCntr == null
? null : updCntr.copy();
+ ignite.context().gateway().readLock();
Review Comment:
I do not understand which part is "tricky".
We asked `OffheapManager` for a page iterator. The introduced enterBusy and
leaveBusy methods help it understand when we are actually using it.
It is `OffheapManager`'s responsibility to keep the data we are iterating in
valid state. Therefore, **`OffheapManager`** should block node stopping/cache
destruction/deactivation (as I see it, it already does), not "idle verify".
So I believe that we should only use `OffheapManager` enterBusy and
leaveBusy with try/finally block.
Flags and acquiring gateway lock manually make code even more complicated
that it already is.
--
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]