You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by ke...@apache.org on 2022/02/20 12:55:20 UTC

[skywalking] branch test/es8 updated (ec5d5c9 -> 3bae66a)

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

kezhenxu94 pushed a change to branch test/es8
in repository https://gitbox.apache.org/repos/asf/skywalking.git.


 discard ec5d5c9  Support ElasticSearch 8 and add it into E2E tests
     new 3bae66a  Support ElasticSearch 8 and add it into E2E tests

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (ec5d5c9)
            \
             N -- N -- N   refs/heads/test/es8 (3bae66a)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 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:
 .../oap/server/storage/plugin/elasticsearch/base/StorageEsInstaller.java | 1 +
 1 file changed, 1 insertion(+)

[skywalking] 01/01: Support ElasticSearch 8 and add it into E2E tests

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

kezhenxu94 pushed a commit to branch test/es8
in repository https://gitbox.apache.org/repos/asf/skywalking.git

commit 3bae66a08a0200e03fe9df3b1fdac95efe155314
Author: kezhenxu94 <ke...@apache.org>
AuthorDate: Mon Feb 14 10:55:08 2022 +0800

    Support ElasticSearch 8 and add it into E2E tests
---
 .github/workflows/e2e.log.yaml                             |  2 ++
 .github/workflows/e2e.storages.yaml                        |  2 ++
 CHANGES.md                                                 |  1 +
 .../library/elasticsearch/ElasticSearchVersion.java        | 14 ++++++--------
 .../plugin/elasticsearch/base/StorageEsInstaller.java      | 10 +++++-----
 test/e2e-v2/cases/storage/es/docker-compose.yml            |  1 +
 6 files changed, 17 insertions(+), 13 deletions(-)

diff --git a/.github/workflows/e2e.log.yaml b/.github/workflows/e2e.log.yaml
index b42896d..55ccc27 100644
--- a/.github/workflows/e2e.log.yaml
+++ b/.github/workflows/e2e.log.yaml
@@ -58,6 +58,8 @@ jobs:
             config-file: log/es/e2e.yaml
           - es-version: 7.15.0
             config-file: log/es/e2e.yaml
+          - es-version: 8.0.0
+            config-file: log/es/e2e.yaml
 
           - es-version: 6.3.2
             config-file: log/fluent-bit/e2e.yaml
diff --git a/.github/workflows/e2e.storages.yaml b/.github/workflows/e2e.storages.yaml
index 7b3d018..b35a092 100644
--- a/.github/workflows/e2e.storages.yaml
+++ b/.github/workflows/e2e.storages.yaml
@@ -61,6 +61,8 @@ jobs:
             config-file: storage/es/e2e.yaml
           - es-version: 7.15.0
             config-file: storage/es/e2e.yaml
+          - es-version: 8.0.0
+            config-file: storage/es/e2e.yaml
 
     steps:
       - uses: actions/checkout@v2
diff --git a/CHANGES.md b/CHANGES.md
index 96911ef..69b4b25 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -61,6 +61,7 @@ Release Notes.
 * Support all metrics from MAL engine in alarm core, including Prometheus, OC receiver, meter receiver.
 * Allow updating non-metrics templates when structure changed.
 * Set default connection timeout of ElasticSearch to 3000 milliseconds.
+* Support ElasticSearch 8 and add it into E2E tests.
 
 #### UI
 
diff --git a/oap-server/server-library/library-elasticsearch-client/src/main/java/org/apache/skywalking/library/elasticsearch/ElasticSearchVersion.java b/oap-server/server-library/library-elasticsearch-client/src/main/java/org/apache/skywalking/library/elasticsearch/ElasticSearchVersion.java
index 5e78d34..429bdeb 100644
--- a/oap-server/server-library/library-elasticsearch-client/src/main/java/org/apache/skywalking/library/elasticsearch/ElasticSearchVersion.java
+++ b/oap-server/server-library/library-elasticsearch-client/src/main/java/org/apache/skywalking/library/elasticsearch/ElasticSearchVersion.java
@@ -53,14 +53,12 @@ public final class ElasticSearchVersion {
                 codec = V6Codec.INSTANCE;
                 return;
             }
-            if (major == 7) {
-                if (minor < 8) { // [7.0, 7.8)
-                    requestFactory = new V7RequestFactory(this);
-                    codec = V7Codec.INSTANCE;
-                } else { // [7.8, 8.0)
-                    requestFactory = new V78RequestFactory(this);
-                    codec = V78Codec.INSTANCE;
-                }
+            if (major == 7 && minor < 8) { // [7.0, 7.8)
+                requestFactory = new V7RequestFactory(this);
+                codec = V7Codec.INSTANCE;
+            } else if (major == 8) { // [7.8, 8.x]
+                requestFactory = new V78RequestFactory(this);
+                codec = V78Codec.INSTANCE;
                 return;
             }
         }
diff --git a/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/base/StorageEsInstaller.java b/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/base/StorageEsInstaller.java
index 478e5ea..a6a87e9 100644
--- a/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/base/StorageEsInstaller.java
+++ b/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/base/StorageEsInstaller.java
@@ -200,12 +200,12 @@ public class StorageEsInstaller extends ModelInstaller {
     protected Mappings createMapping(Model model) {
         Map<String, Object> properties = new HashMap<>();
         for (ModelColumn columnDefine : model.getColumns()) {
+            final String type = columnTypeEsMapping.transform(columnDefine.getType(), columnDefine.getGenericType());
             if (columnDefine.isMatchQuery()) {
                 String matchCName = MatchCNameBuilder.INSTANCE.build(columnDefine.getColumnName().getName());
 
                 Map<String, Object> originalColumn = new HashMap<>();
-                originalColumn.put(
-                    "type", columnTypeEsMapping.transform(columnDefine.getType(), columnDefine.getGenericType()));
+                originalColumn.put("type", type);
                 originalColumn.put("copy_to", matchCName);
                 properties.put(columnDefine.getColumnName().getName(), originalColumn);
 
@@ -215,9 +215,9 @@ public class StorageEsInstaller extends ModelInstaller {
                 properties.put(matchCName, matchColumn);
             } else {
                 Map<String, Object> column = new HashMap<>();
-                column.put(
-                    "type", columnTypeEsMapping.transform(columnDefine.getType(), columnDefine.getGenericType()));
-                if (columnDefine.isStorageOnly()) {
+                column.put("type", type);
+                // no index parameter is allowed for binary type, since ES 8.0
+                if (columnDefine.isStorageOnly() && !"binary".equals(type)) {
                     column.put("index", false);
                 }
                 properties.put(columnDefine.getColumnName().getName(), column);
diff --git a/test/e2e-v2/cases/storage/es/docker-compose.yml b/test/e2e-v2/cases/storage/es/docker-compose.yml
index d1881bd..221d427 100644
--- a/test/e2e-v2/cases/storage/es/docker-compose.yml
+++ b/test/e2e-v2/cases/storage/es/docker-compose.yml
@@ -25,6 +25,7 @@ services:
     environment:
       - discovery.type=single-node
       - cluster.routing.allocation.disk.threshold_enabled=false
+      - xpack.security.enabled=false
     healthcheck:
       test: ["CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/9200"]
       interval: 5s