sashapolo commented on code in PR #1559:
URL: https://github.com/apache/ignite-3/pull/1559#discussion_r1084914659
##########
modules/storage-page-memory/src/test/java/org/apache/ignite/internal/storage/pagememory/VolatilePageMemoryMvTableStorageTest.java:
##########
@@ -57,12 +70,18 @@ void setUp(
"mock.tables.foo{ partitions = 512, dataStorage.name = " +
VolatilePageMemoryStorageEngine.ENGINE_NAME + "}"
)
TablesConfiguration tablesConfig
- ) {
+ ) throws Exception {
var ioRegistry = new PageIoRegistry();
ioRegistry.loadFromServiceLoader();
initialize(new VolatilePageMemoryStorageEngine("node", engineConfig,
ioRegistry, pageEvictionTracker), tablesConfig);
+
+ // Track how many times a page was forgotten (when emptying a Data
Page). We need it to be able to poll while
+ // awaiting till a page finally gets freed (as MV and index data
destruction is async). We don't use verify()
+ // for this end because it throws an AssertionError if the expectation
is not satisfied, which is not convenient.
Review Comment:
Why is it "verify" not convenient?
##########
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/mv/AbstractPageMemoryMvPartitionStorage.java:
##########
@@ -1000,16 +1007,18 @@ public void close() {
busyLock.block();
try {
- IgniteUtils.closeAll(getResourcesToClose());
+ IgniteUtils.closeAll(getResourcesToClose(goingToDestroy));
} catch (Exception e) {
throw new StorageException(e);
}
}
/**
* Returns resources that should be closed on {@link #close()}.
+ *
+ * @param goingToDestroy If the closure is in preparation for destruction.
*/
- protected List<AutoCloseable> getResourcesToClose() {
+ protected List<AutoCloseable> getResourcesToClose(boolean goingToDestroy) {
Review Comment:
Why do you need the boolean flag here?
##########
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/mv/VolatilePageMemoryMvPartitionStorage.java:
##########
@@ -149,17 +153,32 @@ public void lastAppliedOnRebalance(long lastAppliedIndex,
long lastAppliedTerm)
}
/**
- * Destroys internal structures backing this partition.
+ * Destroys internal structures (including indices) backing this partition.
*
- * @return future that completes when the destruction completes.
+ * @param removeIndexDescriptors Whether indices should be completely
removed, not just their contents destroyed.
*/
- public CompletableFuture<Void> destroyStructures() {
- // TODO: IGNITE-18531 - destroy indices.
+ public void destroyStructures(boolean removeIndexDescriptors) {
Review Comment:
I would propose to make this method "private" and introduce two public
methods instead
--
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]