You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ca...@apache.org on 2022/10/31 06:31:37 UTC

[iotdb] branch beyyes/master updated (f182b32e53 -> 067bafa820)

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

caogaofei pushed a change to branch beyyes/master
in repository https://gitbox.apache.org/repos/asf/iotdb.git


    from f182b32e53 fix problem in stop node shell
     add a78cd55c89 Update download doc (#7801)
     add 1e0f3300e0 Fix shell problem in start-confignode.sh/bat and start-datanode.sh/bat (#7811)
     add caca66ada7 [IOTDB-2884]Redo Log for SchemaFile (#7726)
     add 0e843a7614 Rename mpprest to rest (#7804)
     new ebcd784cc7 Merge branch 'master' into beyyes/master
     new 067bafa820 add init method for PartitionRegionStateMachine

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../confignode/conf/ConfigNodeDescriptor.java      |   1 -
 .../statemachine/PartitionRegionStateMachine.java  |  48 +++++-
 docs/Download/README.md                            | 148 ++++++++++++++++--
 docs/UserGuide/Reference/Syntax-Conventions.md     | 169 +++-----------------
 docs/zh/Download/README.md                         | 143 +++++++++++++++--
 docs/zh/UserGuide/Reference/Syntax-Conventions.md  | 172 +++------------------
 .../resources/conf/iotdb-common.properties         |  37 +++--
 openapi/pom.xml                                    |  26 ----
 .../resources/conf/iotdb-datanode.properties       |   2 +-
 .../java/org/apache/iotdb/db/conf/IoTDBConfig.java |  11 ++
 .../org/apache/iotdb/db/conf/IoTDBDescriptor.java  |   8 +-
 ...s.java => SchemaFileLogCorruptedException.java} |   8 +-
 .../mtree/store/disk/schemafile/ISchemaPage.java   |   3 +
 .../mtree/store/disk/schemafile/InternalPage.java  |   2 +-
 .../mtree/store/disk/schemafile/SchemaFile.java    |  49 +++---
 .../store/disk/schemafile/SchemaFileConfig.java    |  28 +++-
 .../mtree/store/disk/schemafile/SchemaPage.java    |  14 +-
 .../mtree/store/disk/schemafile/SegmentedPage.java |   7 +
 .../disk/schemafile/log/SchemaFileLogReader.java   | 112 ++++++++++++++
 .../schemafile/log/SchemaFileLogSerializer.java}   |  19 ++-
 .../disk/schemafile/log/SchemaFileLogWriter.java   |  68 ++++++++
 .../disk/schemafile/pagemgr/BTreePageManager.java  |   7 +-
 .../disk/schemafile/pagemgr/IPageManager.java      |   2 +
 .../store/disk/schemafile/pagemgr/PageManager.java | 146 +++++++++++++----
 .../MPPRestService.java => rest/RestService.java}  |  20 +--
 .../{mpprest => rest}/filter/ApiOriginFilter.java  |   2 +-
 .../filter/AuthorizationFilter.java                |   4 +-
 .../filter/BasicSecurityContext.java               |   2 +-
 .../db/protocol/{mpprest => rest}/filter/User.java |   2 +-
 .../{mpprest => rest}/filter/UserCache.java        |   2 +-
 .../handler/AuthorizationHandler.java              |   4 +-
 .../handler/ExceptionHandler.java                  |   4 +-
 .../handler/QueryDataSetHandler.java               |   4 +-
 .../handler/RequestValidationHandler.java          |   8 +-
 .../handler/StatementConstructionHandler.java      |   4 +-
 .../impl/GrafanaApiServiceImpl.java                |  20 +--
 .../{mpprest => rest}/impl/PingApiServiceImpl.java |   6 +-
 .../{mpprest => rest}/impl/RestApiServiceImpl.java |  20 +--
 .../java/org/apache/iotdb/db/service/DataNode.java |   4 +-
 .../java/org/apache/iotdb/db/service/NewIoTDB.java |   4 +-
 .../mtree/schemafile/SchemaFileLogTest.java        | 156 +++++++++++++++++++
 .../metadata/mtree/schemafile/SchemaFileTest.java  |  25 +--
 .../iotdb/db/tools/SchemaFileSketchTest.java       |   2 +-
 .../java/org/apache/iotdb/rpc/TSStatusCode.java    |   1 +
 44 files changed, 1008 insertions(+), 516 deletions(-)
 copy server/src/main/java/org/apache/iotdb/db/exception/metadata/schemafile/{SchemaFileNotExists.java => SchemaFileLogCorruptedException.java} (77%)
 create mode 100644 server/src/main/java/org/apache/iotdb/db/metadata/mtree/store/disk/schemafile/log/SchemaFileLogReader.java
 copy server/src/main/java/org/apache/iotdb/db/{qp/utils/EmptyOutputStream.java => metadata/mtree/store/disk/schemafile/log/SchemaFileLogSerializer.java} (68%)
 create mode 100644 server/src/main/java/org/apache/iotdb/db/metadata/mtree/store/disk/schemafile/log/SchemaFileLogWriter.java
 rename server/src/main/java/org/apache/iotdb/db/protocol/{mpprest/MPPRestService.java => rest/RestService.java} (90%)
 rename server/src/main/java/org/apache/iotdb/db/protocol/{mpprest => rest}/filter/ApiOriginFilter.java (96%)
 rename server/src/main/java/org/apache/iotdb/db/protocol/{mpprest => rest}/filter/AuthorizationFilter.java (97%)
 rename server/src/main/java/org/apache/iotdb/db/protocol/{mpprest => rest}/filter/BasicSecurityContext.java (96%)
 rename server/src/main/java/org/apache/iotdb/db/protocol/{mpprest => rest}/filter/User.java (95%)
 rename server/src/main/java/org/apache/iotdb/db/protocol/{mpprest => rest}/filter/UserCache.java (97%)
 rename server/src/main/java/org/apache/iotdb/db/protocol/{mpprest => rest}/handler/AuthorizationHandler.java (93%)
 rename server/src/main/java/org/apache/iotdb/db/protocol/{mpprest => rest}/handler/ExceptionHandler.java (97%)
 rename server/src/main/java/org/apache/iotdb/db/protocol/{mpprest => rest}/handler/QueryDataSetHandler.java (98%)
 rename server/src/main/java/org/apache/iotdb/db/protocol/{mpprest => rest}/handler/RequestValidationHandler.java (89%)
 rename server/src/main/java/org/apache/iotdb/db/protocol/{mpprest => rest}/handler/StatementConstructionHandler.java (98%)
 rename server/src/main/java/org/apache/iotdb/db/protocol/{mpprest => rest}/impl/GrafanaApiServiceImpl.java (93%)
 rename server/src/main/java/org/apache/iotdb/db/protocol/{mpprest => rest}/impl/PingApiServiceImpl.java (91%)
 rename server/src/main/java/org/apache/iotdb/db/protocol/{mpprest => rest}/impl/RestApiServiceImpl.java (91%)
 create mode 100644 server/src/test/java/org/apache/iotdb/db/metadata/mtree/schemafile/SchemaFileLogTest.java


[iotdb] 02/02: add init method for PartitionRegionStateMachine

Posted by ca...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

caogaofei pushed a commit to branch beyyes/master
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 067bafa820b9bedf42ccdea6b32c3597dfa33e81
Author: Beyyes <cg...@foxmail.com>
AuthorDate: Mon Oct 31 14:31:23 2022 +0800

    add init method for PartitionRegionStateMachine
---
 .../statemachine/PartitionRegionStateMachine.java  | 48 +++++++++++++++++++++-
 1 file changed, 47 insertions(+), 1 deletion(-)

diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/consensus/statemachine/PartitionRegionStateMachine.java b/confignode/src/main/java/org/apache/iotdb/confignode/consensus/statemachine/PartitionRegionStateMachine.java
index f6b940d548..f7c9a5b2ad 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/consensus/statemachine/PartitionRegionStateMachine.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/consensus/statemachine/PartitionRegionStateMachine.java
@@ -32,6 +32,7 @@ import org.apache.iotdb.confignode.exception.physical.UnknownPhysicalPlanTypeExc
 import org.apache.iotdb.confignode.manager.ConfigManager;
 import org.apache.iotdb.confignode.persistence.executor.ConfigPlanExecutor;
 import org.apache.iotdb.confignode.writelog.io.SingleFileLogReader;
+import org.apache.iotdb.consensus.ConsensusFactory;
 import org.apache.iotdb.consensus.IStateMachine;
 import org.apache.iotdb.consensus.common.DataSet;
 import org.apache.iotdb.consensus.common.request.ByteBufferConsensusRequest;
@@ -45,6 +46,7 @@ import org.slf4j.LoggerFactory;
 import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.IOException;
+import java.nio.ByteBuffer;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.TimeUnit;
 
@@ -120,6 +122,46 @@ public class PartitionRegionStateMachine
       result = new TSStatus(TSStatusCode.INTERNAL_SERVER_ERROR.getStatusCode());
     }
 
+    if (ConsensusFactory.StandAloneConsensus.equals(CONF.getConfigNodeConsensusProtocolClass())) {
+      if (logFile.length() > FILE_MAX_SIZE) {
+        try {
+          logWriter.force();
+        } catch (IOException e) {
+          LOGGER.error("Can't force logWrite for ConfigNode Standalone mode", e);
+        }
+        for (int retry = 0; retry < 5; retry++) {
+          try {
+            logWriter.close();
+          } catch (IOException e) {
+            LOGGER.warn(
+                "Can't close StandAloneLog for ConfigNode Standalone mode, filePath: {}, retry: {}",
+                logFile.getAbsolutePath(),
+                retry);
+            try {
+              // Sleep 1s and retry
+              TimeUnit.SECONDS.sleep(1);
+            } catch (InterruptedException e2) {
+              Thread.currentThread().interrupt();
+              LOGGER.warn("Unexpected interruption during the close method of logWriter");
+            }
+            continue;
+          }
+          break;
+        }
+        createLogFile(logFileId + 1);
+      }
+
+      try {
+        ByteBuffer buffer = plan.serializeToByteBuffer();
+        // The method logWriter.write will execute flip() firstly, so we must make position==limit
+        buffer.position(buffer.limit());
+        logWriter.write(buffer);
+      } catch (IOException e) {
+        LOGGER.error(
+            "can't serialize current ConfigPhysicalPlan for ConfigNode Standalone mode", e);
+      }
+    }
+
     return result;
   }
 
@@ -212,7 +254,11 @@ public class PartitionRegionStateMachine
   }
 
   @Override
-  public void start() {}
+  public void start() {
+    if (ConsensusFactory.StandAloneConsensus.equals(CONF.getConfigNodeConsensusProtocolClass())) {
+      initStandAloneConfigNode();
+    }
+  }
 
   @Override
   public void stop() {


[iotdb] 01/02: Merge branch 'master' into beyyes/master

Posted by ca...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

caogaofei pushed a commit to branch beyyes/master
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit ebcd784cc7d3cbe3d8166525e84223377b17b943
Merge: f182b32e53 0e843a7614
Author: Beyyes <cg...@foxmail.com>
AuthorDate: Mon Oct 31 14:22:59 2022 +0800

    Merge branch 'master' into beyyes/master

 .../confignode/conf/ConfigNodeDescriptor.java      |   1 -
 docs/Download/README.md                            | 148 ++++++++++++++++--
 docs/UserGuide/Reference/Syntax-Conventions.md     | 169 +++-----------------
 docs/zh/Download/README.md                         | 143 +++++++++++++++--
 docs/zh/UserGuide/Reference/Syntax-Conventions.md  | 172 +++------------------
 .../resources/conf/iotdb-common.properties         |  37 +++--
 openapi/pom.xml                                    |  26 ----
 .../resources/conf/iotdb-datanode.properties       |   2 +-
 .../java/org/apache/iotdb/db/conf/IoTDBConfig.java |  11 ++
 .../org/apache/iotdb/db/conf/IoTDBDescriptor.java  |   8 +-
 .../SchemaFileLogCorruptedException.java           |  34 ++++
 .../mtree/store/disk/schemafile/ISchemaPage.java   |   3 +
 .../mtree/store/disk/schemafile/InternalPage.java  |   2 +-
 .../mtree/store/disk/schemafile/SchemaFile.java    |  49 +++---
 .../store/disk/schemafile/SchemaFileConfig.java    |  28 +++-
 .../mtree/store/disk/schemafile/SchemaPage.java    |  14 +-
 .../mtree/store/disk/schemafile/SegmentedPage.java |   7 +
 .../disk/schemafile/log/SchemaFileLogReader.java   | 112 ++++++++++++++
 .../schemafile/log/SchemaFileLogSerializer.java    |  34 ++++
 .../disk/schemafile/log/SchemaFileLogWriter.java   |  68 ++++++++
 .../disk/schemafile/pagemgr/BTreePageManager.java  |   7 +-
 .../disk/schemafile/pagemgr/IPageManager.java      |   2 +
 .../store/disk/schemafile/pagemgr/PageManager.java | 146 +++++++++++++----
 .../MPPRestService.java => rest/RestService.java}  |  20 +--
 .../{mpprest => rest}/filter/ApiOriginFilter.java  |   2 +-
 .../filter/AuthorizationFilter.java                |   4 +-
 .../filter/BasicSecurityContext.java               |   2 +-
 .../db/protocol/{mpprest => rest}/filter/User.java |   2 +-
 .../{mpprest => rest}/filter/UserCache.java        |   2 +-
 .../handler/AuthorizationHandler.java              |   4 +-
 .../handler/ExceptionHandler.java                  |   4 +-
 .../handler/QueryDataSetHandler.java               |   4 +-
 .../handler/RequestValidationHandler.java          |   8 +-
 .../handler/StatementConstructionHandler.java      |   4 +-
 .../impl/GrafanaApiServiceImpl.java                |  20 +--
 .../{mpprest => rest}/impl/PingApiServiceImpl.java |   6 +-
 .../{mpprest => rest}/impl/RestApiServiceImpl.java |  20 +--
 .../java/org/apache/iotdb/db/service/DataNode.java |   4 +-
 .../java/org/apache/iotdb/db/service/NewIoTDB.java |   4 +-
 .../mtree/schemafile/SchemaFileLogTest.java        | 156 +++++++++++++++++++
 .../metadata/mtree/schemafile/SchemaFileTest.java  |  25 +--
 .../iotdb/db/tools/SchemaFileSketchTest.java       |   2 +-
 .../java/org/apache/iotdb/rpc/TSStatusCode.java    |   1 +
 43 files changed, 1016 insertions(+), 501 deletions(-)