You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ha...@apache.org on 2022/05/27 01:10:41 UTC

[iotdb] branch rel/0.13 updated: [To rel/0.13] [IOTDB-3171] Fix NPE when getting modification file (#6034)

This is an automated email from the ASF dual-hosted git repository.

haonan pushed a commit to branch rel/0.13
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/rel/0.13 by this push:
     new 3a6831fdfd [To rel/0.13] [IOTDB-3171] Fix NPE when getting modification file (#6034)
3a6831fdfd is described below

commit 3a6831fdfd62e8a9f607544a36dd99472821b477
Author: Jackie Tien <ja...@gmail.com>
AuthorDate: Fri May 27 09:10:37 2022 +0800

    [To rel/0.13] [IOTDB-3171] Fix NPE when getting modification file (#6034)
---
 .gitignore                                                          | 1 +
 .../org/apache/iotdb/db/engine/storagegroup/TsFileResource.java     | 6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/.gitignore b/.gitignore
index 68d7afef18..6b90b2f1f5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -40,6 +40,7 @@ tsfile-jdbc/src/main/resources/output/queryRes.csv
 *.gz
 *.tar.gz
 *.tar
+*.tokens
 #src/test/resources/logback.xml
 
 ### CSV ###
diff --git a/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileResource.java b/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileResource.java
index cd61cd0640..14f21df950 100644
--- a/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileResource.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileResource.java
@@ -95,9 +95,9 @@ public class TsFileResource {
   /** time index type, V012FileTimeIndex = 0, deviceTimeIndex = 1, fileTimeIndex = 2 */
   private byte timeIndexType;
 
-  private ModificationFile modFile;
+  private volatile ModificationFile modFile;
 
-  private ModificationFile compactionModFile;
+  private volatile ModificationFile compactionModFile;
 
   protected volatile TsFileResourceStatus status = TsFileResourceStatus.UNCLOSED;
 
@@ -130,7 +130,7 @@ public class TsFileResource {
 
   private long ramSize;
 
-  private long tsFileSize = -1L;
+  private volatile long tsFileSize = -1L;
 
   private TsFileProcessor processor;