From 12a289080042b765528d4932722eb1bd5cee5506 Mon Sep 17 00:00:00 2001 From: laa Date: Thu, 1 Aug 2019 13:12:40 +0300 Subject: [PATCH] Ridbags are not created together with clusters in distributed storage --- .../impl/local/OAbstractPaginatedStorage.java | 2 +- .../sbtree/OSBTreeCollectionManagerShared.java | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/OAbstractPaginatedStorage.java b/core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/OAbstractPaginatedStorage.java index 35f9866e1be..b0bd91baf3f 100755 --- a/core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/OAbstractPaginatedStorage.java +++ b/core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/OAbstractPaginatedStorage.java @@ -4969,7 +4969,7 @@ private int doAddCluster(String clusterName, final int clusterPos) throws IOExce ((OClusterBasedStorageConfiguration) configuration).updateCluster(cluster.generateClusterConfig()); - sbTreeCollectionManager.createComponent(createdClusterId); + sbTreeCollectionManager.createComponentIfPossible(createdClusterId); } return createdClusterId; diff --git a/core/src/main/java/com/orientechnologies/orient/core/storage/ridbag/sbtree/OSBTreeCollectionManagerShared.java b/core/src/main/java/com/orientechnologies/orient/core/storage/ridbag/sbtree/OSBTreeCollectionManagerShared.java index edba9582a62..2dcdba15d02 100755 --- a/core/src/main/java/com/orientechnologies/orient/core/storage/ridbag/sbtree/OSBTreeCollectionManagerShared.java +++ b/core/src/main/java/com/orientechnologies/orient/core/storage/ridbag/sbtree/OSBTreeCollectionManagerShared.java @@ -108,12 +108,13 @@ public void delete(OBonsaiCollectionPointer collectionPointer) { super.delete(collectionPointer); } - public void createComponent(final int clusterId) throws IOException { - checkAccess(); - - final OSBTreeBonsaiLocal tree = new OSBTreeBonsaiLocal<>(FILE_NAME_PREFIX + clusterId, - DEFAULT_EXTENSION, storage); - tree.createComponent(); + public void createComponentIfPossible(final int clusterId) throws IOException { + //ignore creation of ridbags in distributed storage + if (!prohibitAccess) { + final OSBTreeBonsaiLocal tree = new OSBTreeBonsaiLocal<>(FILE_NAME_PREFIX + clusterId, + DEFAULT_EXTENSION, storage); + tree.createComponent(); + } } public long createComponent(final String fileName) throws IOException {