You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ji...@apache.org on 2019/04/12 10:04:54 UTC

[incubator-iotdb] branch refactor_mem_control updated: complete undo logic

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

jiangtian pushed a commit to branch refactor_mem_control
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git


The following commit(s) were added to refs/heads/refactor_mem_control by this push:
     new f8e4858  complete undo logic
f8e4858 is described below

commit f8e48585c3c815ef2f2725b69b16f9af55add4d0
Author: 江天 <jt...@163.com>
AuthorDate: Fri Apr 12 18:03:41 2019 +0800

    complete undo logic
---
 .../java/org/apache/iotdb/db/engine/filenode/FileNodeManager.java   | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/iotdb/src/main/java/org/apache/iotdb/db/engine/filenode/FileNodeManager.java b/iotdb/src/main/java/org/apache/iotdb/db/engine/filenode/FileNodeManager.java
index 12264f4..63ab5f1 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/engine/filenode/FileNodeManager.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/engine/filenode/FileNodeManager.java
@@ -426,7 +426,11 @@ public class FileNodeManager implements IStatistic, IService {
     fileNodeProcessor.setIntervalFileNodeStartTime(deviceId);
     fileNodeProcessor.setLastUpdateTime(deviceId, timestamp);
     try {
-      bufferWriteProcessor.write(tsRecord);
+      if(!bufferWriteProcessor.write(tsRecord)) {
+        // undo time update
+        fileNodeProcessor.setIntervalFileNodeStartTime(deviceId, prevStartTime);
+        fileNodeProcessor.setLastUpdateTime(deviceId, prevUpdateTime);
+      }
     } catch (BufferWriteProcessorException e) {
       if (!isMonitor) {
         updateStatHashMapWhenFail(tsRecord);