tkalkirill commented on code in PR #3358:
URL: https://github.com/apache/ignite-3/pull/3358#discussion_r1522699618
##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/TableManager.java:
##########
@@ -1836,11 +1837,13 @@ private CompletableFuture<Void>
handleChangePendingAssignmentEvent(
)
.thenComposeAsync(unused -> inBusyLock(busyLock, () -> {
if (!isRecovery) {
+ // TODO
https://issues.apache.org/jira/browse/IGNITE-21738 Fix potential race.
+ HybridTimestamp lwm =
lowWatermark.getLowWatermark();
// We create index storages (and also register the
necessary structures) for the rebalancing one partition
// before start the raft node, so that the updates
that come when applying the replication log can safely
// update the indexes. On recovery node, we do not
need to call this code, since during restoration we start
// all partitions and already register indexes
there.
- registerIndexesToTable(tbl, catalogService,
singlePartitionIdSet, tbl.schemaView());
+ registerIndexesToTable(tbl, catalogService,
singlePartitionIdSet, tbl.schemaView(), lwm);
Review Comment:
What if you temporarily make reading the lwm under lock?
Make some kind of method
`LowWatermark#getLowWatermarkSafe(Consumer<HybridTimestamp> consumer)` in which
it will be possible to safely read the sign?
--
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]