You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ct...@apache.org on 2020/11/26 19:15:26 UTC

[accumulo] branch 1.10 updated (64e01c8 -> 7e2e09e)

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

ctubbsii pushed a change to branch 1.10
in repository https://gitbox.apache.org/repos/asf/accumulo.git.


    from 64e01c8  Make skipQA profile more human-proof (#1807)
     new 6184058  Minor fixup of build
     new 7e2e09e  Backport some GcMetricsIT test stability to 1.10

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:
 pom.xml                                            |  5 ++-
 .../accumulo/test/functional/GcMetricsIT.java      | 45 +++++++++++++++++-----
 2 files changed, 38 insertions(+), 12 deletions(-)


[accumulo] 02/02: Backport some GcMetricsIT test stability to 1.10

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

ctubbsii pushed a commit to branch 1.10
in repository https://gitbox.apache.org/repos/asf/accumulo.git

commit 7e2e09e0656d40adce178420be8e66cffee0a4f2
Author: Christopher Tubbs <ct...@apache.org>
AuthorDate: Thu Nov 26 13:04:01 2020 -0500

    Backport some GcMetricsIT test stability to 1.10
    
    Backport some test stability fixes to GcMetricsIT implemented in #1745
    to Accumulo 1.10.1
---
 .../accumulo/test/functional/GcMetricsIT.java      | 45 +++++++++++++++++-----
 1 file changed, 35 insertions(+), 10 deletions(-)

diff --git a/test/src/main/java/org/apache/accumulo/test/functional/GcMetricsIT.java b/test/src/main/java/org/apache/accumulo/test/functional/GcMetricsIT.java
index 04100a1..51a4136 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/GcMetricsIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/GcMetricsIT.java
@@ -20,8 +20,11 @@ import static org.junit.Assert.assertTrue;
 
 import java.util.Collections;
 import java.util.Map;
+import java.util.Objects;
 import java.util.TreeMap;
 import java.util.concurrent.TimeUnit;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
 import org.apache.accumulo.core.conf.Property;
 import org.apache.accumulo.gc.metrics.GcMetrics;
@@ -85,12 +88,10 @@ public class GcMetricsIT extends AccumuloClusterHarness {
 
     try {
 
-      long testStart = System.currentTimeMillis();
+      long updateTimestamp = System.currentTimeMillis();
 
-      // Read two updates, throw away the first snapshot - it could have been from a previous run
-      // or another test (the file appends.)
-      LineUpdate firstUpdate = waitForUpdate(-1, gcTail);
-      firstUpdate = waitForUpdate(firstUpdate.getLastUpdate(), gcTail);
+      // Get next update after current time
+      LineUpdate firstUpdate = waitForUpdate(updateTimestamp, gcTail);
 
       Map<String,Long> firstSeenMap = parseLine(firstUpdate.getLine());
 
@@ -98,9 +99,11 @@ public class GcMetricsIT extends AccumuloClusterHarness {
       log.trace("M:{}", firstSeenMap);
 
       assertTrue(lookForExpectedKeys(firstSeenMap));
-      sanity(testStart, firstSeenMap);
+      sanity(updateTimestamp, firstSeenMap);
 
-      LineUpdate nextUpdate = waitForUpdate(firstUpdate.getLastUpdate(), gcTail);
+      // Get next update after the first one
+      updateTimestamp = firstUpdate.getLastUpdate();
+      LineUpdate nextUpdate = waitForUpdate(updateTimestamp, gcTail);
 
       Map<String,Long> updateSeenMap = parseLine(nextUpdate.getLine());
 
@@ -108,7 +111,7 @@ public class GcMetricsIT extends AccumuloClusterHarness {
       log.trace("Mapped values:{}", updateSeenMap);
 
       assertTrue(lookForExpectedKeys(updateSeenMap));
-      sanity(testStart, updateSeenMap);
+      sanity(updateTimestamp, updateSeenMap);
 
       validate(firstSeenMap, updateSeenMap);
 
@@ -150,7 +153,7 @@ public class GcMetricsIT extends AccumuloClusterHarness {
     start = values.get("AccGcWalStarted");
     finished = values.get("AccGcWalFinished");
 
-    log.debug("test start: {}, gc start: {}, gc finished: {}", testStart, start, finished);
+    log.debug("test start: {}, walgc start: {}, walgc finished: {}", testStart, start, finished);
 
     assertTrue(start >= testStart);
     assertTrue(finished >= start);
@@ -236,7 +239,7 @@ public class GcMetricsIT extends AccumuloClusterHarness {
       String line = tail.getLast();
       long currUpdate = tail.getLastUpdate();
 
-      if (line != null && (currUpdate != prevUpdate)) {
+      if (line != null && (currUpdate != prevUpdate) && isValidTimestamp(line, prevUpdate)) {
         return new LineUpdate(tail.getLastUpdate(), line);
       }
 
@@ -253,6 +256,28 @@ public class GcMetricsIT extends AccumuloClusterHarness {
             TimeUnit.MILLISECONDS.toSeconds(TAIL_DELAY * NUM_TAIL_ATTEMPTS)));
   }
 
+  private static final Pattern timestampPattern = Pattern.compile("^\\s*(?<timestamp>\\d+).*");
+
+  private boolean isValidTimestamp(final String line, final long prevTimestamp) {
+
+    if (Objects.isNull(line)) {
+      return false;
+    }
+
+    Matcher m = timestampPattern.matcher(line);
+
+    if (m.matches()) {
+      try {
+        long timestamp = Long.parseLong(m.group("timestamp"));
+        return timestamp > prevTimestamp;
+      } catch (NumberFormatException ex) {
+        log.trace("Could not parse timestamp from line '{}", line);
+        return false;
+      }
+    }
+    return false;
+  }
+
   private boolean lookForExpectedKeys(final Map<String,Long> received) {
 
     for (String e : EXPECTED_METRIC_KEYS) {


[accumulo] 01/02: Minor fixup of build

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

ctubbsii pushed a commit to branch 1.10
in repository https://gitbox.apache.org/repos/asf/accumulo.git

commit 61840580b448b68d7af67bfb8440db00cedebd0e
Author: Christopher Tubbs <ct...@apache.org>
AuthorDate: Thu Nov 26 12:58:28 2020 -0500

    Minor fixup of build
    
    * Show rat output in console (partial backport to 1.x from #1767)
    * Don't skip enforcer when skipQA profile is active, because it is
      necessary for enforcing build requirements (and isn't costly to run)
    * Enforce the JDK version to less than 15 for Accumulo 1.x, because
      Concurrent Mark and Sweep garbage collector options were removed from
      JDK 15, which Accumulo 1.x uses in its scripts and in Mini. While
      Accumulo 1.x can still compile and build in JDK 15, it will not be
      able to run as-is, including running tests, resulting in hard-to-track
      and confusing errors for developers. It is easier to enforce the JDK
      version to being at least 11, and strictly less than 15, during
      development.
---
 pom.xml | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index 0aa8095..6606c0f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -141,6 +141,7 @@
     <powermock.version>2.0.7</powermock.version>
     <!-- timestamp for reproducible outputs, updated on release by the release plugin -->
     <project.build.outputTimestamp>2020-08-27T15:56:15Z</project.build.outputTimestamp>
+    <rat.consoleOutput>true</rat.consoleOutput>
     <!-- surefire/failsafe plugin option -->
     <reuseForks>false</reuseForks>
     <slf4j.version>1.7.25</slf4j.version>
@@ -850,7 +851,8 @@
                   <version>[3.5.0,)</version>
                 </requireMavenVersion>
                 <requireJavaVersion>
-                  <version>[11,)</version>
+                  <!-- 15 dropped support for UseConcMarkSweepGC flag that Accumulo 1.x uses -->
+                  <version>[11,15)</version>
                 </requireJavaVersion>
               </rules>
             </configuration>
@@ -1064,7 +1066,6 @@
         <accumulo.skip>true</accumulo.skip>
         <apilyzer.skip>true</apilyzer.skip>
         <checkstyle.skip>true</checkstyle.skip>
-        <enforcer.skip>true</enforcer.skip>
         <formatter.skip>true</formatter.skip>
         <impsort.skip>true</impsort.skip>
         <maven.plugin.skip>true</maven.plugin.skip>