rpuch commented on code in PR #1545:
URL: https://github.com/apache/ignite-3/pull/1545#discussion_r1073545913
##########
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/AbstractPageMemoryTableStorage.java:
##########
@@ -167,86 +180,94 @@ public CompletableFuture<Void> destroy() {
@Override
public AbstractPageMemoryMvPartitionStorage getOrCreateMvPartition(int
partitionId) throws StorageException {
- AbstractPageMemoryMvPartitionStorage partition =
getMvPartition(partitionId);
+ return inBusyLock(busyLock, () -> {
+ AbstractPageMemoryMvPartitionStorage partition =
getMvPartitionBusy(partitionId);
- if (partition != null) {
- return partition;
- }
+ if (partition != null) {
+ return partition;
+ }
- partition = createMvPartitionStorage(partitionId);
+ partition = createMvPartitionStorage(partitionId);
- partition.start();
+ partition.start();
- mvPartitions.set(partitionId, partition);
+ mvPartitions.set(partitionId, partition);
- return partition;
+ return partition;
+ });
}
@Override
public @Nullable AbstractPageMemoryMvPartitionStorage getMvPartition(int
partitionId) {
- assert started : "Storage has not started yet";
Review Comment:
Why don't we check whether the storage has been started anymore?
--
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]