You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2020/05/08 15:07:06 UTC

[GitHub] [incubator-iotdb] qiaojialin commented on a change in pull request #1151: [IOTDB-643] Concurrent queries cause BufferUnderflowException when storage in HDFS

qiaojialin commented on a change in pull request #1151:
URL: https://github.com/apache/incubator-iotdb/pull/1151#discussion_r422196308



##########
File path: tsfile/src/main/java/org/apache/iotdb/tsfile/read/TsFileSequenceReader.java
##########
@@ -225,10 +226,13 @@ public String readHeadMagic() throws IOException {
    * to the end of the magic head string.
    */
   public String readHeadMagic(boolean movePosition) throws IOException {

Review comment:
       this parameter is no need ,  the tsfileInput is positioned in selfcheck already.

##########
File path: server/src/main/java/org/apache/iotdb/db/engine/cache/ChunkMetadataCache.java
##########
@@ -100,18 +100,24 @@ public static ChunkMetadataCache getInstance() {
   public List<ChunkMetadata> get(String filePath, Path seriesPath)
       throws IOException {
     if (!cacheEnable) {
-      // bloom filter part
-      TsFileSequenceReader tsFileReader = FileReaderManager.getInstance().get(filePath, true);
-      BloomFilter bloomFilter = tsFileReader.readBloomFilter();
-      if (bloomFilter != null && !bloomFilter.contains(seriesPath.getFullPath())) {
-        if (logger.isDebugEnabled()) {
-          logger.debug(String
-              .format("path not found by bloom filter, file is: %s, path is: %s", filePath, seriesPath));
+      lock.writeLock().lock();

Review comment:
       why add this lock?  the lock is for concurrently modify lruCache

##########
File path: hadoop/src/main/java/org/apache/iotdb/hadoop/fileSystem/HDFSInput.java
##########
@@ -68,26 +60,26 @@ public long position() throws IOException {
   }
 
   @Override
-  public TsFileInput position(long newPosition) throws IOException {
+  public synchronized TsFileInput position(long newPosition) throws IOException {

Review comment:
       this function should be used cautiously, it's better to use the read(position, length)




----------------------------------------------------------------
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:
users@infra.apache.org