[accumulo] 01/01: Merge branch '1.9' into 2.0

2019-10-10 Thread ctubbsii
This is an automated email from the ASF dual-hosted git repository.

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

commit 433e71703f660360c5ec17d9af7ccadf270bccd9
Merge: aabe05c 328ffa0
Author: Christopher Tubbs 
AuthorDate: Thu Oct 10 16:07:09 2019 -0400

Merge branch '1.9' into 2.0




[accumulo] branch master updated (ee24511 -> 62702de)

2019-10-10 Thread ctubbsii
This is an automated email from the ASF dual-hosted git repository.

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


from ee24511  Merge branch '2.0'
 add 328ffa0  Improved metadata table consitency checking and testing 
(#1379)
 new 433e717  Merge branch '1.9' into 2.0
 new 62702de  Merge branch '2.0'

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:



[accumulo] 01/01: Merge branch '2.0'

2019-10-10 Thread ctubbsii
This is an automated email from the ASF dual-hosted git repository.

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

commit 62702deb7c8a54750c59279eb201e2681b5d7181
Merge: ee24511 433e717
Author: Christopher Tubbs 
AuthorDate: Thu Oct 10 16:07:16 2019 -0400

Merge branch '2.0'




[accumulo] branch 2.0 updated (aabe05c -> 433e717)

2019-10-10 Thread ctubbsii
This is an automated email from the ASF dual-hosted git repository.

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


from aabe05c  Retry new Bulk import on merge. Fixes #471 (#1367)
 add 328ffa0  Improved metadata table consitency checking and testing 
(#1379)
 new 433e717  Merge branch '1.9' into 2.0

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:



[accumulo] branch master updated (85e818d -> ee24511)

2019-10-10 Thread mmiller
This is an automated email from the ASF dual-hosted git repository.

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


from 85e818d  Fix classpath for metrics configuration for ITs (#1387)
 add aabe05c  Retry new Bulk import on merge. Fixes #471 (#1367)
 new ee24511  Merge branch '2.0'

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:
 ...eption.java => AccumuloBulkMergeException.java} | 19 +++
 .../core/clientImpl/TableOperationsImpl.java   |  2 +
 .../accumulo/core/clientImpl/bulk/BulkImport.java  | 64 ++
 .../thrift/TableOperationExceptionType.java|  5 +-
 core/src/main/thrift/client.thrift |  1 +
 .../master/tableOps/bulkVer2/PrepBulkImport.java   |  7 +--
 .../tableOps/bulkVer2/PrepBulkImportTest.java  |  6 +-
 7 files changed, 74 insertions(+), 30 deletions(-)
 copy 
core/src/main/java/org/apache/accumulo/core/clientImpl/{IsolationException.java 
=> AccumuloBulkMergeException.java} (69%)



[accumulo] 01/01: Merge branch '2.0'

2019-10-10 Thread mmiller
This is an automated email from the ASF dual-hosted git repository.

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

commit ee24511d5b7811b0aa048a9048f62a6a1ccd2f93
Merge: 85e818d aabe05c
Author: Mike Miller 
AuthorDate: Thu Oct 10 15:00:51 2019 -0400

Merge branch '2.0'

 .../clientImpl/AccumuloBulkMergeException.java | 32 +++
 .../core/clientImpl/TableOperationsImpl.java   |  2 +
 .../accumulo/core/clientImpl/bulk/BulkImport.java  | 64 ++
 .../thrift/TableOperationExceptionType.java|  5 +-
 core/src/main/thrift/client.thrift |  1 +
 .../master/tableOps/bulkVer2/PrepBulkImport.java   |  7 +--
 .../tableOps/bulkVer2/PrepBulkImportTest.java  |  6 +-
 7 files changed, 97 insertions(+), 20 deletions(-)




[accumulo] branch 2.0 updated: Retry new Bulk import on merge. Fixes #471 (#1367)

2019-10-10 Thread mmiller
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/2.0 by this push:
 new aabe05c  Retry new Bulk import on merge. Fixes #471 (#1367)
aabe05c is described below

commit aabe05c19ec39b30908a9093a1f5090c01cf3fc1
Author: Mike Miller 
AuthorDate: Thu Oct 10 14:55:14 2019 -0400

Retry new Bulk import on merge. Fixes #471 (#1367)

* Created AccumuloBulkMergeException for handling merges with Retry maxWait 
up to 2 Minutes
---
 .../clientImpl/AccumuloBulkMergeException.java | 32 +++
 .../core/clientImpl/TableOperationsImpl.java   |  2 +
 .../accumulo/core/clientImpl/bulk/BulkImport.java  | 64 ++
 .../thrift/TableOperationExceptionType.java|  5 +-
 core/src/main/thrift/client.thrift |  1 +
 .../master/tableOps/bulkVer2/PrepBulkImport.java   |  7 +--
 .../tableOps/bulkVer2/PrepBulkImportTest.java  |  6 +-
 7 files changed, 97 insertions(+), 20 deletions(-)

diff --git 
a/core/src/main/java/org/apache/accumulo/core/clientImpl/AccumuloBulkMergeException.java
 
b/core/src/main/java/org/apache/accumulo/core/clientImpl/AccumuloBulkMergeException.java
new file mode 100644
index 000..2a7527e
--- /dev/null
+++ 
b/core/src/main/java/org/apache/accumulo/core/clientImpl/AccumuloBulkMergeException.java
@@ -0,0 +1,32 @@
+/*
+ * 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.accumulo.core.clientImpl;
+
+import org.apache.accumulo.core.client.AccumuloException;
+
+/**
+ * Internal class indicating a concurrent merge occurred during the new bulk 
import.
+ */
+public class AccumuloBulkMergeException extends AccumuloException {
+
+  private static final String MSG = "Concurrent merge happened";
+
+  public AccumuloBulkMergeException(final Throwable cause) {
+super(MSG, cause);
+  }
+
+}
diff --git 
a/core/src/main/java/org/apache/accumulo/core/clientImpl/TableOperationsImpl.java
 
b/core/src/main/java/org/apache/accumulo/core/clientImpl/TableOperationsImpl.java
index fbd5f74..762b85c 100644
--- 
a/core/src/main/java/org/apache/accumulo/core/clientImpl/TableOperationsImpl.java
+++ 
b/core/src/main/java/org/apache/accumulo/core/clientImpl/TableOperationsImpl.java
@@ -382,6 +382,8 @@ public class TableOperationsImpl extends 
TableOperationsHelper {
 case OFFLINE:
   throw new TableOfflineException(
   Tables.getTableOfflineMsg(context, Tables.getTableId(context, 
tableOrNamespaceName)));
+case BULK_CONCURRENT_MERGE:
+  throw new AccumuloBulkMergeException(e);
 default:
   throw new AccumuloException(e.description, e);
   }
diff --git 
a/core/src/main/java/org/apache/accumulo/core/clientImpl/bulk/BulkImport.java 
b/core/src/main/java/org/apache/accumulo/core/clientImpl/bulk/BulkImport.java
index 48a7f93..52860b7 100644
--- 
a/core/src/main/java/org/apache/accumulo/core/clientImpl/bulk/BulkImport.java
+++ 
b/core/src/main/java/org/apache/accumulo/core/clientImpl/bulk/BulkImport.java
@@ -17,6 +17,8 @@
 package org.apache.accumulo.core.clientImpl.bulk;
 
 import static java.nio.charset.StandardCharsets.UTF_8;
+import static java.util.concurrent.TimeUnit.MILLISECONDS;
+import static java.util.concurrent.TimeUnit.MINUTES;
 import static java.util.stream.Collectors.groupingBy;
 
 import java.io.FileNotFoundException;
@@ -41,6 +43,7 @@ import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Executor;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
 import java.util.stream.Stream;
 
 import org.apache.accumulo.core.Constants;
@@ -49,6 +52,7 @@ import 
org.apache.accumulo.core.client.AccumuloSecurityException;
 import org.apache.accumulo.core.client.TableNotFoundException;
 import 
org.apache.accumulo.core.client.admin.TableOperations.ImportDestinationArguments;
 import 
org.apache.accumulo.core.client.admin.TableOperations.ImportMappingOptions;
+import org.apache.accumulo.core.clientImpl.AccumuloBulkMergeException;
 import 

[accumulo] branch 1.9 updated: Improved metadata table consitency checking and testing (#1379)

2019-10-10 Thread kturner
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/1.9 by this push:
 new 328ffa0  Improved metadata table consitency checking and testing 
(#1379)
328ffa0 is described below

commit 328ffa0849981e0f113dfbf539c832b447e06902
Author: Keith Turner 
AuthorDate: Thu Oct 10 10:55:08 2019 -0400

Improved metadata table consitency checking and testing (#1379)

Added unit test to exercise the code that checks the consistency of the
metadata table during GC scans.  Also added a check to ensure the last
tablet was seen.  This should cause an error to be thrown if the scanner
stops returning data for any reason.  These changes were already made in
2.0 in #1266.  However the code in 1.9 is so different that they could
not be back-ported, but had to be re-implemented.
---
 .../accumulo/server/util/TabletIterator.java   |  23 +-
 .../accumulo/server/util/TabletIteratorTest.java   | 258 +
 2 files changed, 277 insertions(+), 4 deletions(-)

diff --git 
a/server/base/src/main/java/org/apache/accumulo/server/util/TabletIterator.java 
b/server/base/src/main/java/org/apache/accumulo/server/util/TabletIterator.java
index b6fed26..83ec344 100644
--- 
a/server/base/src/main/java/org/apache/accumulo/server/util/TabletIterator.java
+++ 
b/server/base/src/main/java/org/apache/accumulo/server/util/TabletIterator.java
@@ -22,6 +22,7 @@ import java.util.Iterator;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.NoSuchElementException;
+import java.util.Objects;
 import java.util.Set;
 import java.util.SortedMap;
 import java.util.TreeMap;
@@ -101,6 +102,23 @@ public class TabletIterator implements 
Iterator> {
 
   currentTabletKeys = scanToPrevEndRow();
   if (currentTabletKeys.size() == 0) {
+// Always expect the default tablet to exist for a table. The 
following checks for the case when
+// the default tablet was not seen when it should have been seen.
+if (lastTablet != null) {
+  KeyExtent lastExtent = new KeyExtent(lastTablet, (Text) null);
+
+  // if lastTablet was not the default tablet
+  if (lastExtent.getEndRow() != null) {
+
+Text defaultTabletRow = 
TabletsSection.getRow(lastExtent.getTableId(), null);
+if (range.contains(new Key(defaultTabletRow))) {
+  throw new IllegalStateException(
+  "Scan range included default tablet, but did not see default 
tablet.  Last tablet seen : "
+  + lastTablet);
+}
+  }
+}
+
 break;
   }
 
@@ -137,10 +155,7 @@ public class TabletIterator implements 
Iterator> {
 }
   }
 
-  boolean perEqual = (per == null && lastEndRow == null)
-  || (per != null && lastEndRow != null && per.equals(lastEndRow));
-
-  if (!perEqual) {
+  if (!Objects.equals(per, lastEndRow)) {
 
 log.info("Metadata inconsistency : " + per + " != " + lastEndRow + " 
metadataKey = "
 + prevEndRowKey);
diff --git 
a/server/base/src/test/java/org/apache/accumulo/server/util/TabletIteratorTest.java
 
b/server/base/src/test/java/org/apache/accumulo/server/util/TabletIteratorTest.java
new file mode 100644
index 000..233c87a
--- /dev/null
+++ 
b/server/base/src/test/java/org/apache/accumulo/server/util/TabletIteratorTest.java
@@ -0,0 +1,258 @@
+/*
+ * 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.accumulo.server.util;
+
+import static org.easymock.EasyMock.anyObject;
+import static org.easymock.EasyMock.capture;
+import static org.easymock.EasyMock.createMock;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.expectLastCall;
+import static org.easymock.EasyMock.replay;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.TreeMap;
+
+import