HTHou commented on a change in pull request #983: URL: https://github.com/apache/incubator-iotdb/pull/983#discussion_r426117309
########## File path: server/src/main/java/org/apache/iotdb/db/query/control/FileReaderManager.java ########## @@ -158,9 +160,21 @@ public synchronized TsFileSequenceReader get(String filePath, boolean isClosed) logger.warn("Query has opened {} files !", readerMap.size()); } - TsFileSequenceReader tsFileReader = !isClosed ? new UnClosedTsFileReader(filePath) - : new TsFileSequenceReader(filePath); - + TsFileSequenceReader tsFileReader = null; + // check if the file is old version + if (!isClosed) { + tsFileReader = new UnClosedTsFileReader(filePath); + } + else { + try (TsFileSequenceReader reader = new TsFileSequenceReader(filePath)) { + if (reader.readVersionNumber().equals(TSFileConfig.OLD_VERSION)) { + tsFileReader = new TsFileSequenceReaderForOldFile(filePath); + } + else { + tsFileReader = new TsFileSequenceReader(filePath); + } + } Review comment: Fixed ---------------------------------------------------------------- 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: us...@infra.apache.org