You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by am...@apache.org on 2024/02/02 20:07:34 UTC
(ignite-3) branch ignite-20680-conflicts updated (c17e273fac -> 6922d81da6)
This is an automated email from the ASF dual-hosted git repository.
amashenkov pushed a change to branch ignite-20680-conflicts
in repository https://gitbox.apache.org/repos/asf/ignite-3.git
discard c17e273fac Fix test after merge with main
new 6922d81da6 Fix test after merge with main
This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version. This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:
* -- * -- B -- O -- O -- O (c17e273fac)
\
N -- N -- N refs/heads/ignite-20680-conflicts (6922d81da6)
You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.
Any revisions marked "omit" are not gone; other references still
refer to them. Any revisions marked "discard" are gone forever.
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../internal/catalog/CatalogManagerImpl.java | 20 ++++++++-------
.../internal/catalog/events/DestroyIndexEvent.java | 2 +-
.../internal/catalog/CatalogManagerSelfTest.java | 2 +-
.../ignite/internal/index/ItIndexManagerTest.java | 4 +--
.../apache/ignite/internal/index/IndexManager.java | 20 ++++++---------
.../ignite/internal/index/IndexManagerTest.java | 29 +++++++++++-----------
6 files changed, 37 insertions(+), 40 deletions(-)
(ignite-3) 01/01: Fix test after merge with main
Posted by am...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
amashenkov pushed a commit to branch ignite-20680-conflicts
in repository https://gitbox.apache.org/repos/asf/ignite-3.git
commit 6922d81da6cd63a5c63ab31cb1b4f94f8eec9139
Author: amashenkov <an...@gmail.com>
AuthorDate: Fri Feb 2 23:07:08 2024 +0300
Fix test after merge with main
---
.../internal/catalog/CatalogManagerImpl.java | 20 +++++++++--------
.../internal/catalog/events/DestroyIndexEvent.java | 2 +-
.../internal/catalog/CatalogManagerSelfTest.java | 2 +-
.../apache/ignite/internal/index/IndexManager.java | 16 +-------------
.../ignite/internal/index/IndexManagerTest.java | 25 +++++++++++++++++++++-
5 files changed, 38 insertions(+), 27 deletions(-)
diff --git a/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/CatalogManagerImpl.java b/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/CatalogManagerImpl.java
index f283b6f822..21eb546bbb 100644
--- a/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/CatalogManagerImpl.java
+++ b/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/CatalogManagerImpl.java
@@ -457,18 +457,20 @@ public class CatalogManagerImpl extends AbstractEventProducer<CatalogEvent, Cata
Collection<Catalog> droppedCatalogVersions = catalogByVer.subMap(earliestCatalogVersion(), catalog.version()).values();
// Dropped indexes
- droppedCatalogVersions.forEach(old -> {
- old.managedIndexes().intStream()
+ IntOpenHashSet uniqSet = new IntOpenHashSet();
+ droppedCatalogVersions.forEach(oldCatalog -> {
+ oldCatalog.managedIndexes().intStream()
.filter(id -> !managedIndexes.contains(id))
- .filter(new IntOpenHashSet()::add) // unique
- .forEach(id -> events.add(new DestroyIndexEvent(id, old.index(id).tableId())));
+ .filter(uniqSet::add) // unique
+ .forEach(id -> events.add(new DestroyIndexEvent(id, oldCatalog.index(id).tableId())));
});
// Dropped tables
- droppedCatalogVersions.forEach(old -> {
- old.managedTables().intStream()
+ uniqSet.clear();
+ droppedCatalogVersions.forEach(oldCatalog -> {
+ oldCatalog.managedTables().intStream()
.filter(id -> !managedTables.contains(id))
- .filter(new IntOpenHashSet()::add) // unique
- .forEach(id -> events.add(new DestroyTableEvent(id, old.zone(old.table(id).zoneId()).partitions())));
+ .filter(uniqSet::add) // unique
+ .forEach(id -> events.add(new DestroyTableEvent(id, oldCatalog.zone(oldCatalog.table(id).zoneId()).partitions())));
});
// On recovery phase, we must register catalog from the snapshot.
@@ -513,7 +515,7 @@ public class CatalogManagerImpl extends AbstractEventProducer<CatalogEvent, Cata
for (UpdateEntry entry : update.entries()) {
if (entry instanceof Fireable) {
Fireable fireEvent = (Fireable) entry;
-
+LOG.warn("FIRED: " + entry);
eventFutures.add(fireEvent(
fireEvent.eventType(),
fireEvent.createEventParameters(causalityToken, version)
diff --git a/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/events/DestroyIndexEvent.java b/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/events/DestroyIndexEvent.java
index 6b2314a7e2..38992a4e52 100644
--- a/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/events/DestroyIndexEvent.java
+++ b/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/events/DestroyIndexEvent.java
@@ -42,6 +42,6 @@ public class DestroyIndexEvent implements Fireable {
@Override
public CatalogEventParameters createEventParameters(long causalityToken, int catalogVersion) {
- return new StoppingIndexEventParameters(causalityToken, catalogVersion, indexId, tableId);
+ return new RemoveIndexEventParameters(causalityToken, catalogVersion, indexId, tableId);
}
}
diff --git a/modules/catalog/src/test/java/org/apache/ignite/internal/catalog/CatalogManagerSelfTest.java b/modules/catalog/src/test/java/org/apache/ignite/internal/catalog/CatalogManagerSelfTest.java
index 4b378937e3..48af1d12e4 100644
--- a/modules/catalog/src/test/java/org/apache/ignite/internal/catalog/CatalogManagerSelfTest.java
+++ b/modules/catalog/src/test/java/org/apache/ignite/internal/catalog/CatalogManagerSelfTest.java
@@ -1258,7 +1258,7 @@ public class CatalogManagerSelfTest extends BaseCatalogManagerTest {
clearInvocations(eventListener);
// Drop index.
- assertThat(manager.execute(dropIndexCmd), willBe(nullValue()));
+ dropIndex(INDEX_NAME);
verify(eventListener).notify(any(StoppingIndexEventParameters.class), isNull());
// Remove index.
diff --git a/modules/index/src/main/java/org/apache/ignite/internal/index/IndexManager.java b/modules/index/src/main/java/org/apache/ignite/internal/index/IndexManager.java
index 0fc33db90c..e24da77759 100644
--- a/modules/index/src/main/java/org/apache/ignite/internal/index/IndexManager.java
+++ b/modules/index/src/main/java/org/apache/ignite/internal/index/IndexManager.java
@@ -23,8 +23,6 @@ import static java.util.concurrent.CompletableFuture.failedFuture;
import static java.util.stream.Collectors.toMap;
import static org.apache.ignite.internal.catalog.events.CatalogEvent.INDEX_CREATE;
import static org.apache.ignite.internal.catalog.events.CatalogEvent.INDEX_REMOVED;
-import static org.apache.ignite.internal.catalog.events.CatalogEvent.INDEX_STOPPING;
-import static org.apache.ignite.internal.util.CompletableFutures.falseCompletedFuture;
import static org.apache.ignite.internal.util.CompletableFutures.nullCompletedFuture;
import static org.apache.ignite.internal.util.IgniteUtils.inBusyLock;
import static org.apache.ignite.internal.util.IgniteUtils.inBusyLockAsync;
@@ -52,7 +50,6 @@ import org.apache.ignite.internal.catalog.descriptors.CatalogTableDescriptor;
import org.apache.ignite.internal.catalog.events.CatalogEvent;
import org.apache.ignite.internal.catalog.events.CreateIndexEventParameters;
import org.apache.ignite.internal.catalog.events.RemoveIndexEventParameters;
-import org.apache.ignite.internal.catalog.events.StoppingIndexEventParameters;
import org.apache.ignite.internal.causality.IncrementalVersionedValue;
import org.apache.ignite.internal.logger.IgniteLogger;
import org.apache.ignite.internal.logger.Loggers;
@@ -148,17 +145,6 @@ public class IndexManager implements IgniteComponent {
return onIndexCreate((CreateIndexEventParameters) parameters);
});
- // TODO: IGNITE-21117 - remove this.
- catalogManager.listen(INDEX_STOPPING, (parameters, exception) -> {
- if (exception != null) {
- return failedFuture(exception);
- }
-
- removeIndex(((StoppingIndexEventParameters) parameters).indexId());
-
- return falseCompletedFuture();
- });
-
catalogManager.listen(INDEX_REMOVED, (parameters, exception) -> {
if (exception != null) {
return failedFuture(exception);
@@ -366,7 +352,7 @@ public class IndexManager implements IgniteComponent {
// TODO: IGNITE-21117 - remove this.
if (index.status() == CatalogIndexStatus.STOPPING
&& catalogManager.index(index.id(), catalogManager.latestCatalogVersion()) != null) {
- startIndexFutures.add(removeIndex(index.id()));
+ // startIndexFutures.add(removeIndex(index.id()));
}
startIndexFutures.add(startIndexAsync(table, index, causalityToken));
diff --git a/modules/index/src/test/java/org/apache/ignite/internal/index/IndexManagerTest.java b/modules/index/src/test/java/org/apache/ignite/internal/index/IndexManagerTest.java
index 435f5ca7cf..2c4f9e132c 100644
--- a/modules/index/src/test/java/org/apache/ignite/internal/index/IndexManagerTest.java
+++ b/modules/index/src/test/java/org/apache/ignite/internal/index/IndexManagerTest.java
@@ -212,12 +212,35 @@ public class IndexManagerTest extends BaseIgniteAbstractTest {
}
@Test
- void testDontUnregisterIndexOnCatalogEventIndexDrop() {
+ void testUnregisterNonReadyIndexOnCatalogEventIndexDrop() {
createIndex(TABLE_NAME, INDEX_NAME);
dropIndex(INDEX_NAME);
TableViewInternal tableViewInternal = tableViewInternalByTableId.get(tableId());
+ verify(tableViewInternal).unregisterIndex(anyInt());
+ }
+
+ @Test
+ void testUnregisterBuildingIndexOnCatalogEventIndexDrop() {
+ createIndex(TABLE_NAME, INDEX_NAME);
+ startBuildingIndex(INDEX_NAME);
+ dropIndex(INDEX_NAME);
+
+ TableViewInternal tableViewInternal = tableViewInternalByTableId.get(tableId());
+
+ verify(tableViewInternal).unregisterIndex(anyInt());
+ }
+
+ @Test
+ void testDontUnregisterAvailableIndexOnCatalogEventIndexDrop() {
+ createIndex(TABLE_NAME, INDEX_NAME);
+ startBuildingIndex(INDEX_NAME);
+ makeIndexAvailable(INDEX_NAME);
+ dropIndex(INDEX_NAME);
+
+ TableViewInternal tableViewInternal = tableViewInternalByTableId.get(tableId());
+
verify(tableViewInternal, never()).unregisterIndex(anyInt());
}