From notifications-return-49499-archive-asf-public=cust-asf.ponee.io@accumulo.apache.org Wed Apr 24 21:47:11 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id A80BD18076D for ; Wed, 24 Apr 2019 23:47:10 +0200 (CEST) Received: (qmail 9591 invoked by uid 500); 24 Apr 2019 21:47:10 -0000 Mailing-List: contact notifications-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jira@apache.org Delivered-To: mailing list notifications@accumulo.apache.org Received: (qmail 9580 invoked by uid 99); 24 Apr 2019 21:47:10 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Apr 2019 21:47:10 +0000 From: GitBox To: notifications@accumulo.apache.org Subject: [GitHub] [accumulo] ctubbsii commented on a change in pull request #1127: fixes #1111 support reading unencrypted WALs from 1.9 Message-ID: <155614242980.24099.9383424090882569765.gitbox@gitbox.apache.org> Date: Wed, 24 Apr 2019 21:47:09 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit ctubbsii commented on a change in pull request #1127: fixes #1111 support reading unencrypted WALs from 1.9 URL: https://github.com/apache/accumulo/pull/1127#discussion_r278331385 ########## File path: server/tserver/src/main/java/org/apache/accumulo/tserver/log/DfsLogger.java ########## @@ -375,10 +380,19 @@ public static DFSLoggerInputStreams readHeaderAndReturnStream(FSDataInputStream log.debug("Using {} for decrypting WAL", cryptoService.getClass().getSimpleName()); decryptingInput = cryptoService instanceof NoCryptoService ? input : new DataInputStream(decrypter.decryptStream(input)); - } else { - log.error("Unsupported WAL version."); - input.seek(0); + } else if (Arrays.equals(magicBuffer, magic3)) { + // Read logs files from Accumulo 1.9 + String cryptoModuleClassname = input.readUTF(); + if (!cryptoModuleClassname.equals("NullCryptoModule")) { + throw new IllegalArgumentException( + "Old encryption modules not supported at this time. Unsupported module : " + + cryptoModuleClassname); + } + decryptingInput = input; + } else { + throw new IllegalArgumentException( Review comment: I misunderstood that you were going to throw EOFException, not catch it. Catching the more specific error makes sense to me... but we should take care that the RTE that will now fall through is handled (or propagated) appropriately by the caller(s). From a quick examination, it looks like the callers are also logging... so you should probably just include whatever message stuff you want in the thrown exception, instead of logging first, and then throwing it, where it will be logged again, and then thrown again... etc. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: users@infra.apache.org With regards, Apache Git Services