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 EE2241022E for ; Tue, 3 Dec 2013 05:07:18 +0000 (UTC) Received: (qmail 66294 invoked by uid 500); 3 Dec 2013 05:07:16 -0000 Delivered-To: apmail-hbase-dev-archive@hbase.apache.org Received: (qmail 66225 invoked by uid 500); 3 Dec 2013 05:07:15 -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 66217 invoked by uid 99); 3 Dec 2013 05:07:14 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Dec 2013 05:07:14 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jon@cloudera.com designates 209.85.220.177 as permitted sender) Received: from [209.85.220.177] (HELO mail-vc0-f177.google.com) (209.85.220.177) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Dec 2013 05:07:10 +0000 Received: by mail-vc0-f177.google.com with SMTP id hv10so9129102vcb.36 for ; Mon, 02 Dec 2013 21:06:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type; bh=ya0UUPhWiKiO+gNuRKMgseRBvWT48tz2ARQkJPodPY8=; b=m5iWHVlBduyJAQmkWigUoM4jo3sHRMHA+pFhz1CI0SYTVEoCcdVpJgNbLmTz3NoIhE tqBNWfGnq3TbfzbMLi3gUYfv32DM0RABTSkv5yO8rnhsb8nOfmCoisJUkHcP19UOlhJd 4d/r9O5nW34mblKXFnV7qDyTIfW9KQrVT3mk2I+dKabw1IxRLA9ok6rCSfbDtCdYtt2J JP2W0LWBTmctuXf7ijcvtfVZSKCIawPX6gxOmJTZNkePJpufUB/WC+IRcIN4vZ61kC92 vWn31chWh1L9/geU/panm5D90TytpofEyN3w/fBsy9EIDF0kU+T7zG0tVdYPwSvwp/RW GmKQ== X-Gm-Message-State: ALoCoQm/sHt9VrEwuZSQq3AC72cBrNqfG9A9BoxfWb23p+elM6rwI+OKo+hM2pHizNz2Pr4vYAiq X-Received: by 10.58.207.15 with SMTP id ls15mr54930313vec.17.1386047207914; Mon, 02 Dec 2013 21:06:47 -0800 (PST) MIME-Version: 1.0 Received: by 10.58.77.6 with HTTP; Mon, 2 Dec 2013 21:06:27 -0800 (PST) In-Reply-To: References: From: Jonathan Hsieh Date: Mon, 2 Dec 2013 21:06:27 -0800 Message-ID: Subject: Re: Testing the fix for race condition between Compaction and StoreScanner.init To: "dev@hbase.apache.org" Content-Type: multipart/alternative; boundary=047d7b6dc6ee786e5104ec9a43aa X-Virus-Checked: Checked by ClamAV on apache.org --047d7b6dc6ee786e5104ec9a43aa Content-Type: text/plain; charset=ISO-8859-1 On Mon, Dec 2, 2013 at 7:34 PM, Ted Yu wrote: > bq. The lastest submitted trunk patch > > The proposal here wouldn't use minicluster. > > Great! > Cheers > > > On Mon, Dec 2, 2013 at 7:31 PM, Jonathan Hsieh wrote: > > > On Mon, Dec 2, 2013 at 1:13 PM, Ted Yu wrote: > > > > > bq. Would it be possible just to have it focus on just a region/store > > > level instead? > > > > > > TestStoreScanner doesn't start minicluster. > > > > > > > > The lastest submitted trunk patch most certainly did. > > > > I think you can just create a standalone region with data with hooks for > > testing when creating the store scanner > > > > + /* > > + * Verifies that there is no race condition between StoreScanner > > construction and compaction. > > + * This is done through 3 injection points: > > + * 1. before seek operation in StoreScanner ctor > > + * 2. after seek operation in StoreScanner ctor > > + * 3. after compaction completion > > + */ > > + public void testCompactionRaceCondition() throws Exception { > > + HBaseTestingUtility util = new HBaseTestingUtility(); > > + util.startMiniCluster(1); > > + byte[] t = Bytes.toBytes("tbl"), cf = Bytes.toBytes("cf"); > > + > > > > 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. > > > > > Looking forwards to it. > > > > > > > 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 > > > > > > > > > > > > > > > -- > > // Jonathan Hsieh (shay) > > // Software Engineer, Cloudera > > // jon@cloudera.com > > > -- // Jonathan Hsieh (shay) // Software Engineer, Cloudera // jon@cloudera.com --047d7b6dc6ee786e5104ec9a43aa--