Return-Path: X-Original-To: apmail-hbase-dev-archive@www.apache.org Delivered-To: apmail-hbase-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6CA6910560 for ; Mon, 2 Dec 2013 21:13:37 +0000 (UTC) Received: (qmail 15130 invoked by uid 500); 2 Dec 2013 21:13:36 -0000 Delivered-To: apmail-hbase-dev-archive@hbase.apache.org Received: (qmail 15072 invoked by uid 500); 2 Dec 2013 21:13:36 -0000 Mailing-List: contact dev-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list dev@hbase.apache.org Received: (qmail 15064 invoked by uid 99); 2 Dec 2013 21:13:36 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Dec 2013 21:13:36 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of yuzhihong@gmail.com designates 209.85.192.172 as permitted sender) Received: from [209.85.192.172] (HELO mail-pd0-f172.google.com) (209.85.192.172) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Dec 2013 21:13:32 +0000 Received: by mail-pd0-f172.google.com with SMTP id g10so18956506pdj.17 for ; Mon, 02 Dec 2013 13:13:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=WL2aENi+q3h7O7vtVn1BbxkaDcjKliFVTPp6RGf1Tmk=; b=VQpde9+mCp/egQ7bvA3wQEjb7n4Eg4SSpf/mCqRLRestn/EPnMKp9DJZfa+KoKJl8s wNRpgNg0N8hgklMYR6QLHb/EMz9vZrl0Ie+7MZfL8Wk5dDCz1IafPtcO91Tq7BGeTnQo hPwxoVKjfhlH55D5fH7vZ6VjtCa/UrHGtoIfFkwlYZW03695bizpV4roMlmUb1LMm2Ct J1cJ23+yPUq64gt0vRdsP1sbeABRlic5LAd194mfbXch5cFbyGKL07fJit6sG8DfbAPt Lrbx+pWhncRp6B0XwlQ19UImXAvGm4tRkAvP/JwF60BacWxzgfAW1ZZax47lZR4xxWTu ivIg== MIME-Version: 1.0 X-Received: by 10.66.150.69 with SMTP id ug5mr70920448pab.55.1386018790782; Mon, 02 Dec 2013 13:13:10 -0800 (PST) Received: by 10.70.16.226 with HTTP; Mon, 2 Dec 2013 13:13:10 -0800 (PST) In-Reply-To: References: Date: Mon, 2 Dec 2013 13:13:10 -0800 Message-ID: Subject: Re: Testing the fix for race condition between Compaction and StoreScanner.init From: Ted Yu To: "dev@hbase.apache.org" Content-Type: multipart/alternative; boundary=047d7b6dc31ead3c6404ec93a599 X-Virus-Checked: Checked by ClamAV on apache.org --047d7b6dc31ead3c6404ec93a599 Content-Type: text/plain; charset=ISO-8859-1 bq. Would it be possible just to have it focus on just a region/store level instead? TestStoreScanner doesn't start minicluster. bq. Can you add enough info so that we don't need to consult the jira to figure out what the unit test is testing? Sure. I will add comments to the new test. Cheers On Mon, Dec 2, 2013 at 11:06 AM, Jonathan Hsieh wrote: > Part of the reason the injection stuff was "needed" was because the test > crafted data using the higher level minicluster. Would it be possible just > to have it focus on just a region/store level instead? Along with the > focused unit test could a separate easy-to-read easy-to-maintain system > test be written as as well that compacts and starts scanners and verifies > correctness. > > At this level, the code does not explain what the potential race we are > checking against is (other than something between storescanner construction > and compaction). Can you add enough info so that we don't need to consult > the jira to figure out what the unit test is testing? > > Part of the issue is that the current patch and code attached doesn't make > it clear what is being verified. There are no obvious assertions about > what is being checked (its tucked away in the > StoreScannercompactionRaceCondition InjectionHandler, at the least the > assertion should be at the testXxx method level.) > > I think the current test has hygiene issues as well (if the assert fails, I > think we leave a minicluster up?) > > Jon. > > > > > > On Mon, Dec 2, 2013 at 9:54 AM, Ted Yu wrote: > > > Is the proposed approach below acceptable ? > > > > Cheers > > > > > > On Wed, Nov 20, 2013 at 9:48 AM, Ted Yu wrote: > > > > > As requested by Jonathan, I am posting the following approach for > testing > > > fix of HBASE-9949 : > > > > > > > > > 1. Introduce config parameter for StoreScanner implementation which > would > > > be used by HStore for creating scanner > > > 2. In TestStoreScanner, add StoreScanner implementation which extends > > > StoreScanner and set the above config parameter to this class. > > > 3. Register custom ChangedReadersObserver through the following API of > > > HStore : > > > > > > public void addChangedReaderObserver(ChangedReadersObserver o) { > > > > > > The BEFORE_SEEK hook would be activated before Store.getScanner() is > > > called. > > > The AFTER_SEEK hook can be activated at the end of ctor of StoreScanner > > > wrapper created in #2 > > > The custom ChangedReadersObserver would activate the COMPACT_COMPLETE > > hook. > > > > > > Comments are welcome. > > > > > > > > > -- > // Jonathan Hsieh (shay) > // Software Engineer, Cloudera > // jon@cloudera.com > --047d7b6dc31ead3c6404ec93a599--