Return-Path: X-Original-To: apmail-accumulo-commits-archive@www.apache.org Delivered-To: apmail-accumulo-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6503B1782B for ; Fri, 22 May 2015 04:02:08 +0000 (UTC) Received: (qmail 88158 invoked by uid 500); 22 May 2015 04:02:08 -0000 Delivered-To: apmail-accumulo-commits-archive@accumulo.apache.org Received: (qmail 88125 invoked by uid 500); 22 May 2015 04:02:08 -0000 Mailing-List: contact commits-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list commits@accumulo.apache.org Received: (qmail 88101 invoked by uid 99); 22 May 2015 04:02:08 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 May 2015 04:02:08 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id E2804E51C9; Fri, 22 May 2015 04:02:07 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: elserj@apache.org To: commits@accumulo.apache.org Date: Fri, 22 May 2015 04:02:07 -0000 Message-Id: <1c264571a72b42799ee336ee211f97d9@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/3] accumulo git commit: ACCUMULO-3828 More attempted stabilization of ProxyITs Repository: accumulo Updated Branches: refs/heads/1.7 2eeaebb69 -> 76547d41e refs/heads/master 19bacd292 -> bf979109a ACCUMULO-3828 More attempted stabilization of ProxyITs Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/76547d41 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/76547d41 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/76547d41 Branch: refs/heads/1.7 Commit: 76547d41e930bbd6e56960707296b5dd708a55b1 Parents: 2eeaebb Author: Josh Elser Authored: Thu May 21 23:52:35 2015 -0400 Committer: Josh Elser Committed: Fri May 22 00:01:51 2015 -0400 ---------------------------------------------------------------------- .../apache/accumulo/proxy/SimpleProxyBase.java | 57 ++++++++++++++------ 1 file changed, 42 insertions(+), 15 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/76547d41/test/src/test/java/org/apache/accumulo/proxy/SimpleProxyBase.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/proxy/SimpleProxyBase.java b/test/src/test/java/org/apache/accumulo/proxy/SimpleProxyBase.java index cf2d3ab..efdc4f1 100644 --- a/test/src/test/java/org/apache/accumulo/proxy/SimpleProxyBase.java +++ b/test/src/test/java/org/apache/accumulo/proxy/SimpleProxyBase.java @@ -1121,17 +1121,30 @@ public abstract class SimpleProxyBase extends SharedMiniClusterIT { Thread.sleep(2000); } - String batchWriter = client.createWriter(creds, table, writerOptions); - client.update(batchWriter, mutation("row1", "cf", "cq", "x")); - client.update(batchWriter, mutation("row1", "cf", "cq", "x")); - try { - client.flush(batchWriter); - fail("constraint did not fire"); - } catch (MutationsRejectedException ex) {} - try { - client.closeWriter(batchWriter); + boolean success = false; + for (int i = 0; i < 5; i++) { + String batchWriter = client.createWriter(creds, table, writerOptions); + client.update(batchWriter, mutation("row1", "cf", "cq", "x")); + client.update(batchWriter, mutation("row1", "cf", "cq", "x")); + try { + client.flush(batchWriter); + log.debug("Constraint failed to fire. Waiting and retrying"); + Thread.sleep(5000); + continue; + } catch (MutationsRejectedException ex) {} + try { + client.closeWriter(batchWriter); + log.debug("Constraint failed to fire. Waiting and retrying"); + Thread.sleep(5000); + continue; + } catch (MutationsRejectedException e) {} + success = true; + break; + } + + if (!success) { fail("constraint did not fire"); - } catch (MutationsRejectedException e) {} + } client.removeConstraint(creds, table, 2); @@ -1143,7 +1156,7 @@ public abstract class SimpleProxyBase extends SharedMiniClusterIT { assertScan(new String[][] {}, table); - UtilWaitThread.sleep(2000); + UtilWaitThread.sleep(ZOOKEEPER_PROPAGATION_TIME); writerOptions = new WriterOptions(); writerOptions.setLatencyMs(10000); @@ -1151,11 +1164,25 @@ public abstract class SimpleProxyBase extends SharedMiniClusterIT { writerOptions.setThreads(1); writerOptions.setTimeoutMs(100000); - batchWriter = client.createWriter(creds, table, writerOptions); + success = false; + for (int i = 0; i < 5; i++) { + try { + String batchWriter = client.createWriter(creds, table, writerOptions); + + client.update(batchWriter, mutation("row1", "cf", "cq", "x")); + client.flush(batchWriter); + client.closeWriter(batchWriter); + success = true; + break; + } catch (MutationsRejectedException e) { + log.info("Mutations were rejected, assuming constraint is still active", e); + Thread.sleep(5000); + } + } - client.update(batchWriter, mutation("row1", "cf", "cq", "x")); - client.flush(batchWriter); - client.closeWriter(batchWriter); + if (!success) { + fail("Failed to successfully write data after constraint was removed"); + } assertScan(new String[][] {{"row1", "cf", "cq", "x"}}, table);