mychaow commented on a change in pull request #1474:
URL: https://github.com/apache/incubator-iotdb/pull/1474#discussion_r453413928
##########
File path: server/src/main/java/org/apache/iotdb/db/engine/StorageEngine.java
##########
@@ -252,18 +267,24 @@ public StorageGroupProcessor getProcessor(String path)
throws StorageEngineExcep
StorageGroupProcessor processor;
processor = processorMap.get(storageGroupName);
if (processor == null) {
- storageGroupName = storageGroupName.intern();
- synchronized (storageGroupName) {
- processor = processorMap.get(storageGroupName);
- if (processor == null) {
- logger.info("construct a processor instance, the storage group is
{}, Thread is {}",
+ // if finish recover
+ if (isAllSgReady.get()) {
+ storageGroupName = storageGroupName.intern();
+ synchronized (storageGroupName) {
+ processor = processorMap.get(storageGroupName);
+ if (processor == null) {
+ logger.info("construct a processor instance, the storage group
is {}, Thread is {}",
storageGroupName, Thread.currentThread().getId());
- processor = new StorageGroupProcessor(systemDir, storageGroupName,
fileFlushPolicy);
- StorageGroupMNode storageGroup = IoTDB.metaManager
+ processor = new StorageGroupProcessor(systemDir,
storageGroupName, fileFlushPolicy);
+ StorageGroupMNode storageGroup = IoTDB.metaManager
.getStorageGroupNode(storageGroupName);
- processor.setDataTTL(storageGroup.getDataTTL());
- processorMap.put(storageGroupName, processor);
+ processor.setDataTTL(storageGroup.getDataTTL());
+ processorMap.put(storageGroupName, processor);
+ }
}
+ } else {
+ // not finished recover, refuse the request
+ throw new StorageEngineException("the sg " + storageGroupName + "
may not ready now, please wait and retry later");
Review comment:
yes, some wait will be friendly, I will add it.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]