You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by ha...@apache.org on 2020/04/15 04:45:26 UTC

[skywalking] branch es/ttl updated (25ca2dd -> e8a1edf)

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

hanahmily pushed a change to branch es/ttl
in repository https://gitbox.apache.org/repos/asf/skywalking.git.


 discard 25ca2dd  Keep today's index always present.   * Avoid TTL timer to remove today's index   * Create a today's index even without any data.
     new e8a1edf  Keep latest index always present.   * Avoid TTL timer to remove latest index   * Create a latest index even without any data.

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   (25ca2dd)
            \
             N -- N -- N   refs/heads/es/ttl (e8a1edf)

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:
 .../server/storage/plugin/elasticsearch/base/HistoryDeleteEsDAO.java  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)


[skywalking] 01/01: Keep latest index always present. * Avoid TTL timer to remove latest index * Create a latest index even without any data.

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

hanahmily pushed a commit to branch es/ttl
in repository https://gitbox.apache.org/repos/asf/skywalking.git

commit e8a1edf94ad17ee5a912861b9fffe4109b870a4a
Author: Gao Hongtao <ha...@gmail.com>
AuthorDate: Wed Apr 15 12:42:23 2020 +0800

    Keep latest index always present.
      * Avoid TTL timer to remove latest index
      * Create a latest index even without any data.
    
    Signed-off-by: Gao Hongtao <ha...@gmail.com>
---
 .../plugin/elasticsearch/base/HistoryDeleteEsDAO.java        | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/base/HistoryDeleteEsDAO.java b/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/base/HistoryDeleteEsDAO.java
index d86bb43..a38c8fa 100644
--- a/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/base/HistoryDeleteEsDAO.java
+++ b/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/base/HistoryDeleteEsDAO.java
@@ -54,19 +54,21 @@ public class HistoryDeleteEsDAO extends EsDAO implements IHistoryDeleteDAO {
         List<String> indexes = client.retrievalIndexByAliases(model.getName());
 
         List<String> prepareDeleteIndexes = new ArrayList<>();
+        List<String> leftIndices = new ArrayList<>();
         for (String index : indexes) {
             long timeSeries = TimeSeriesUtils.isolateTimeFromIndexName(index);
             if (deadline >= timeSeries) {
                 prepareDeleteIndexes.add(index);
+            } else {
+                leftIndices.add(index);
             }
         }
-
-        if (indexes.size() == prepareDeleteIndexes.size()) {
-            client.createIndex(TimeSeriesUtils.latestWriteIndexName(model));
-        }
-
         for (String prepareDeleteIndex : prepareDeleteIndexes) {
             client.deleteByIndexName(prepareDeleteIndex);
         }
+        String latestIndex = TimeSeriesUtils.latestWriteIndexName(model);
+        if (!leftIndices.contains(latestIndex)) {
+            client.createIndex(TimeSeriesUtils.timeSeries(model));
+        }
     }
 }