tkalkirill commented on code in PR #3414:
URL: https://github.com/apache/ignite-3/pull/3414#discussion_r1529667583
##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/raft/snapshot/FullStateTransferIndexChooser.java:
##########
@@ -238,21 +260,36 @@ private static List<Integer>
mergeWithoutDuplicates(List<Integer> l0, List<Integ
private void addListenersBusy() {
catalogService.listen(INDEX_CREATE,
fromConsumer(this::onIndexCreated));
catalogService.listen(INDEX_REMOVED,
fromConsumer(this::onIndexRemoved));
+
+ lowWatermark.addUpdateListener(this::onLwmChanged);
}
private void onIndexRemoved(RemoveIndexEventParameters parameters) {
inBusyLock(busyLock, () -> {
int indexId = parameters.indexId();
int catalogVersion = parameters.catalogVersion();
- CatalogIndexDescriptor index = indexBusy(indexId, catalogVersion -
1);
+ lowWatermark.getLowWatermarkSafe(lwm -> {
+ int lwmCatalogVersion =
catalogService.activeCatalogVersion(hybridTimestampToLong(lwm));
- if (index.status() == AVAILABLE) {
- // On drop table event.
- readOnlyIndexes.add(new ReadOnlyIndexInfo(index,
catalogActivationTimestampBusy(catalogVersion)));
- } else if (index.status() == STOPPING) {
- readOnlyIndexes.add(new ReadOnlyIndexInfo(index,
findStoppingActivationTsBusy(indexId, catalogVersion - 1)));
- }
+ if (catalogVersion <= lwmCatalogVersion) {
Review Comment:
Do I understand correctly that you mean that when the index goes to STOPPED
and the low watermark has already occurred, then we can immediately drop the
index?
Let me not leave TODO for now and just create a ticket for this?
--
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]