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 2022/12/14 03:29:37 UTC

[GitHub] [iotdb] MarcosZyk opened a new pull request, #8447: [IOTDB-5061] Add initialize state check when create snapshot

MarcosZyk opened a new pull request, #8447:
URL: https://github.com/apache/iotdb/pull/8447

   ## Description
   
   When the schemaRegion is not initialized or has been cleared, the create snapshot operation may result in NPE.
   


-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [iotdb] MarcosZyk commented on a diff in pull request #8447: [IOTDB-5061] Add initialize state check when create snapshot

Posted by GitBox <gi...@apache.org>.
MarcosZyk commented on code in PR #8447:
URL: https://github.com/apache/iotdb/pull/8447#discussion_r1048052728


##########
server/src/main/java/org/apache/iotdb/db/metadata/schemaregion/SchemaRegionMemoryImpl.java:
##########
@@ -437,6 +437,12 @@ public synchronized void deleteSchemaRegion() throws MetadataException {
   // currently, this method is only used for cluster-ratis mode
   @Override
   public synchronized boolean createSnapshot(File snapshotDir) {
+    if (!initialized) {
+      logger.warn(
+          "Failed to create snapshot of schemaRegion {}, because thi schemaRegion has not been initialized.",

Review Comment:
   Fixed.



##########
server/src/main/java/org/apache/iotdb/db/metadata/schemaregion/SchemaRegionSchemaFileImpl.java:
##########
@@ -424,6 +424,12 @@ public synchronized void deleteSchemaRegion() throws MetadataException {
 
   @Override
   public boolean createSnapshot(File snapshotDir) {
+    if (!initialized) {
+      logger.warn(
+          "Failed to create snapshot of schemaRegion {}, because thi schemaRegion has not been initialized.",

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.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [iotdb] MarcosZyk merged pull request #8447: [IOTDB-5061] Add initialize state check when create snapshot

Posted by GitBox <gi...@apache.org>.
MarcosZyk merged PR #8447:
URL: https://github.com/apache/iotdb/pull/8447


-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [iotdb] SzyWilliam commented on a diff in pull request #8447: [IOTDB-5061] Add initialize state check when create snapshot

Posted by GitBox <gi...@apache.org>.
SzyWilliam commented on code in PR #8447:
URL: https://github.com/apache/iotdb/pull/8447#discussion_r1048023830


##########
server/src/main/java/org/apache/iotdb/db/metadata/schemaregion/SchemaRegionMemoryImpl.java:
##########
@@ -437,6 +437,12 @@ public synchronized void deleteSchemaRegion() throws MetadataException {
   // currently, this method is only used for cluster-ratis mode
   @Override
   public synchronized boolean createSnapshot(File snapshotDir) {
+    if (!initialized) {
+      logger.warn(
+          "Failed to create snapshot of schemaRegion {}, because thi schemaRegion has not been initialized.",

Review Comment:
   thi



##########
server/src/main/java/org/apache/iotdb/db/metadata/schemaregion/SchemaRegionSchemaFileImpl.java:
##########
@@ -424,6 +424,12 @@ public synchronized void deleteSchemaRegion() throws MetadataException {
 
   @Override
   public boolean createSnapshot(File snapshotDir) {
+    if (!initialized) {
+      logger.warn(
+          "Failed to create snapshot of schemaRegion {}, because thi schemaRegion has not been initialized.",

Review Comment:
   thi



-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org