yuqi1129 commented on a change in pull request #2353:
URL: https://github.com/apache/iotdb/pull/2353#discussion_r549975890
##########
File path:
server/src/main/java/org/apache/iotdb/db/engine/storagegroup/StorageGroupProcessor.java
##########
@@ -969,35 +969,35 @@ private TsFileProcessor
getOrCreateTsFileProcessorIntern(long timeRangeId,
boolean sequence)
throws IOException, DiskSpaceInsufficientException {
- TsFileProcessor res;
- // we have to ensure only one thread can change
workSequenceTsFileProcessors
- writeLock();
- try {
- res = tsFileProcessorTreeMap.get(timeRangeId);
- if (res == null) {
- // we have to remove oldest processor to control the num of the
memtables
- // TODO: use a method to control the number of memtables
- if (tsFileProcessorTreeMap.size()
- >=
IoTDBDescriptor.getInstance().getConfig().getConcurrentWritingTimePartition()) {
- Map.Entry<Long, TsFileProcessor> processorEntry =
tsFileProcessorTreeMap.firstEntry();
- logger.info(
- "will close a {} TsFile because too many active partitions ({} >
{}) in the storage group {},",
- sequence, tsFileProcessorTreeMap.size(),
-
IoTDBDescriptor.getInstance().getConfig().getConcurrentWritingTimePartition(),
- storageGroupName);
- asyncCloseOneTsFileProcessor(sequence, processorEntry.getValue());
- }
+ TsFileProcessor res = tsFileProcessorTreeMap.get(timeRangeId);
Review comment:
Method `getOrCreateTsFileProcessorIntern` is called by
`getOrCreateTsFileProcessor` which ready guard by lock in
`StorageGroupProcessor`, this method in fact is trying to get the same lock
again
----------------------------------------------------------------
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]