You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by ya...@apache.org on 2021/03/05 02:57:07 UTC

[incubator-doris] branch branch-0.14 updated (9cc12be -> 48444ae)

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

yangzhg pushed a change to branch branch-0.14
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git.


    from 9cc12be  [Enhancement] move FeMetaVersion.java from fe-common to fe-core #5426 (#5427)
     new 2b43e4e  0.14.0-release-rc02
     new 48444ae  [Bug] Fix bug that the image cannot be pulled after the new fe nodes added (#5418)

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:
 .../java/org/apache/doris/catalog/Catalog.java     | 26 ++++++++++++++++++++--
 .../StorageInfoV2.java}                            | 23 +++++++++----------
 gensrc/script/gen_build_version.sh                 |  2 +-
 3 files changed, 35 insertions(+), 16 deletions(-)
 copy fe/fe-core/src/main/java/org/apache/doris/{httpv2/rest/RestApiStatusCode.java => persist/StorageInfoV2.java} (69%)


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[incubator-doris] 02/02: [Bug] Fix bug that the image cannot be pulled after the new fe nodes added (#5418)

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

yangzhg pushed a commit to branch branch-0.14
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git

commit 48444ae9fcdcc1981a8ae0a34d6d241e9a7822a9
Author: Mingyu Chen <mo...@gmail.com>
AuthorDate: Fri Mar 5 10:50:54 2021 +0800

    [Bug] Fix bug that the image cannot be pulled after the new fe nodes added (#5418)
    
    * [Bug] Fix bug that the image cannot be pulled after the new fe node is added
    
    This is because httpv2 modified the response body of the "/info" api,
    causing FE to fail to obtain info from this api.
    And the system did not exit correctly.
    
    This will also cause issues in issue #5292
    
    (cherry picked from commit c95f00d5081082d328fa857b49a8bd0b58404611)
---
 .../java/org/apache/doris/catalog/Catalog.java     | 26 +++++++++++++++++--
 .../org/apache/doris/persist/StorageInfoV2.java    | 30 ++++++++++++++++++++++
 2 files changed, 54 insertions(+), 2 deletions(-)

diff --git a/fe/fe-core/src/main/java/org/apache/doris/catalog/Catalog.java b/fe/fe-core/src/main/java/org/apache/doris/catalog/Catalog.java
index 7ea431f..200f9d3 100755
--- a/fe/fe-core/src/main/java/org/apache/doris/catalog/Catalog.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/Catalog.java
@@ -185,6 +185,7 @@ import org.apache.doris.persist.ReplicaPersistInfo;
 import org.apache.doris.persist.SetReplicaStatusOperationLog;
 import org.apache.doris.persist.Storage;
 import org.apache.doris.persist.StorageInfo;
+import org.apache.doris.persist.StorageInfoV2;
 import org.apache.doris.persist.TableInfo;
 import org.apache.doris.persist.TablePropertyInfo;
 import org.apache.doris.persist.TruncateTableInfo;
@@ -236,12 +237,14 @@ import org.apache.logging.log4j.Logger;
 import org.codehaus.jackson.map.ObjectMapper;
 
 import java.io.BufferedInputStream;
+import java.io.BufferedReader;
 import java.io.DataInputStream;
 import java.io.DataOutputStream;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
 import java.io.IOException;
+import java.io.InputStreamReader;
 import java.net.HttpURLConnection;
 import java.net.URL;
 import java.util.ArrayList;
@@ -1394,7 +1397,7 @@ public class Catalog {
                 MetaHelper.complete(filename, dir);
             }
         } catch (Exception e) {
-            return;
+            throw new IOException(e);
         }
     }
 
@@ -1425,7 +1428,26 @@ public class Catalog {
             connection = (HttpURLConnection) url.openConnection();
             connection.setConnectTimeout(HTTP_TIMEOUT_SECOND * 1000);
             connection.setReadTimeout(HTTP_TIMEOUT_SECOND * 1000);
-            return mapper.readValue(connection.getInputStream(), StorageInfo.class);
+
+            String response;
+            try (BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(connection.getInputStream()))) {
+                String line;
+                StringBuilder sb = new StringBuilder();
+                while ((line = bufferedReader.readLine()) != null) {
+                    sb.append(line);
+                }
+                response = sb.toString();
+            }
+
+            // For http v2, the response body for "/info" api changed from
+            // StorageInfo to StorageInfoV2.
+            // So we need to make it compatible with old api.
+            try {
+                return mapper.readValue(response, StorageInfo.class);
+            } catch (Exception e) {
+                // try new response body
+                return mapper.readValue(response, StorageInfoV2.class).data;
+            }
         } finally {
             if (connection != null) {
                 connection.disconnect();
diff --git a/fe/fe-core/src/main/java/org/apache/doris/persist/StorageInfoV2.java b/fe/fe-core/src/main/java/org/apache/doris/persist/StorageInfoV2.java
new file mode 100644
index 0000000..8f1bba7
--- /dev/null
+++ b/fe/fe-core/src/main/java/org/apache/doris/persist/StorageInfoV2.java
@@ -0,0 +1,30 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.persist;
+
+/**
+ * This class is wrapper of StorageInfo.
+ * Because for http v2, the response body of "/info" api changed to:
+ * {"msg":"success","code":0,"data":{"clusterID":1464655034,"imageSeq":809779,"editsSeq":0},"count":0}
+ */
+public class StorageInfoV2 {
+    public String msg;
+    public int code;
+    public StorageInfo data;
+    public int count;
+}


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[incubator-doris] 01/02: 0.14.0-release-rc02

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

yangzhg pushed a commit to branch branch-0.14
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git

commit 2b43e4ef053ea065d87715c9747db0c99f36eb7f
Author: yangzhg <ya...@gmail.com>
AuthorDate: Fri Mar 5 09:49:44 2021 +0800

    0.14.0-release-rc02
---
 gensrc/script/gen_build_version.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gensrc/script/gen_build_version.sh b/gensrc/script/gen_build_version.sh
index 0b39001..5dab2ab 100755
--- a/gensrc/script/gen_build_version.sh
+++ b/gensrc/script/gen_build_version.sh
@@ -25,7 +25,7 @@
 # contains the build version based on the git hash or svn revision.
 ##############################################################
 
-build_version="trunk"
+build_version="0.14.0-release"
 
 unset LANG
 unset LC_CTYPE


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org