Return-Path: X-Original-To: apmail-cassandra-user-archive@www.apache.org Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 598F97534 for ; Wed, 5 Oct 2011 02:13:44 +0000 (UTC) Received: (qmail 61737 invoked by uid 500); 5 Oct 2011 02:13:42 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 61706 invoked by uid 500); 5 Oct 2011 02:13:42 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 61698 invoked by uid 99); 5 Oct 2011 02:13:42 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Oct 2011 02:13:42 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of JEREMIAH.JORDAN@morningstar.com designates 216.228.224.34 as permitted sender) Received: from [216.228.224.34] (HELO mx89.morningstar.com) (216.228.224.34) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 05 Oct 2011 02:13:37 +0000 Received: from MSMAILC.morningstar.com ([172.28.6.23]) by mx89.morningstar.com with Microsoft SMTPSVC(6.0.3790.4675); Tue, 4 Oct 2011 21:13:14 -0500 Received: from [192.168.2.3] ([71.201.190.179]) by MSMAILC.morningstar.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Tue, 4 Oct 2011 21:13:06 -0500 Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Apple Message framework v1244.3) Subject: Re: How to speed up "Waiting for schema agreement" for a single node Cassandra cluster? From: Jeremiah Jordan In-Reply-To: Date: Tue, 4 Oct 2011 21:12:56 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: <674DAAE2-F944-4C4A-84D5-E08E0068BB7B@morningstar.com> References: To: user@cassandra.apache.org X-Mailer: Apple Mail (2.1244.3) X-OriginalArrivalTime: 05 Oct 2011 02:13:06.0652 (UTC) FILETIME=[520BE1C0:01CC8304] But truncate is still slow, especially if it can't use JNA (windows) as = it snapshots. Depending on how much data you are inserting during your = unit tests, just paging through all the keys and then deleting them is = the fastest way, though if you use timestamps besides "now" this won't = work, as the timestamps need to be increasing between test runs. On Oct 4, 2011, at 9:33 AM, Joseph Norton wrote: >=20 > I didn't consider using truncate because a set of potentially random = Column Families are created dynamically during the test. >=20 > Are there any configuration knobs that could be adjusted for drop + = recreate? >=20 > thanks in advance, >=20 > - Joe N >=20 >=20 > Joseph Norton > norton@alum.mit.edu >=20 >=20 >=20 > On Oct 4, 2011, at 11:19 PM, Jonathan Ellis wrote: >=20 >> Truncate is faster than drop + recreate. >>=20 >> On Tue, Oct 4, 2011 at 9:15 AM, Joseph Norton = wrote: >>>=20 >>> Hello. >>>=20 >>> For unit test purposes, I have a single node Cassandra cluster. I = need to drop and re-create several keyspaces between each test = iteration. This process takes approximately 10 seconds for a single = node installation. >>>=20 >>> Can you recommend any tricks or recipes to reduce the time required = for such operations and/or for "Waiting for schema agreement" to = complete? >>>=20 >>> regards, >>>=20 >>> - Joe N. >>>=20 >>>=20 >>>=20 >>>=20 >>> $ time ./setupDB.sh >>> Deleteing cassandra keyspaces >>> Connected to: "Foo" on 127.0.0.1/9160 >>> ed9c7fc0-ee91-11e0-0000-534d24a6e7f7 >>> Waiting for schema agreement... >>> ... schemas agree across the cluster >>> ee8c36f0-ee91-11e0-0000-534d24a6e7f7 >>> Waiting for schema agreement... >>> ... schemas agree across the cluster >>> eeb14b20-ee91-11e0-0000-534d24a6e7f7 >>> Waiting for schema agreement... >>> ... schemas agree across the cluster >>> Insert data >>> Creating cassandra keyspaces >>> Connected to: "Foo" on 127.0.0.1/9160 >>> ef1a6d30-ee91-11e0-0000-534d24a6e7f7 >>> Waiting for schema agreement... >>> ... schemas agree across the cluster >>> Authenticated to keyspace: Bars >>> ef4af310-ee91-11e0-0000-534d24a6e7f7 >>> Waiting for schema agreement... >>> ... schemas agree across the cluster >>> ef9bab20-ee91-11e0-0000-534d24a6e7f7 >>> Waiting for schema agreement... >>> ... schemas agree across the cluster >>> efbceec0-ee91-11e0-0000-534d24a6e7f7 >>> Waiting for schema agreement... >>> ... schemas agree across the cluster >>> f00e4310-ee91-11e0-0000-534d24a6e7f7 >>> Waiting for schema agreement... >>> ... schemas agree across the cluster >>> f0589280-ee91-11e0-0000-534d24a6e7f7 >>> Waiting for schema agreement... >>> ... schemas agree across the cluster >>> f0821380-ee91-11e0-0000-534d24a6e7f7 >>> Waiting for schema agreement... >>> ... schemas agree across the cluster >>> f0c44ca0-ee91-11e0-0000-534d24a6e7f7 >>> Waiting for schema agreement... >>> ... schemas agree across the cluster >>> Authenticated to keyspace: Baz >>> f121d5f0-ee91-11e0-0000-534d24a6e7f7 >>> Waiting for schema agreement... >>> ... schemas agree across the cluster >>> f1619e10-ee91-11e0-0000-534d24a6e7f7 >>> Waiting for schema agreement... >>> ... schemas agree across the cluster >>> f18b4620-ee91-11e0-0000-534d24a6e7f7 >>> Waiting for schema agreement... >>> ... schemas agree across the cluster >>> Authenticated to keyspace: Buz >>> f1debd50-ee91-11e0-0000-534d24a6e7f7 >>> Waiting for schema agreement... >>> ... schemas agree across the cluster >>> f20690a0-ee91-11e0-0000-534d24a6e7f7 >>> Waiting for schema agreement... >>> ... schemas agree across the cluster >>> f25043d0-ee91-11e0-0000-534d24a6e7f7 >>> Waiting for schema agreement... >>> ... schemas agree across the cluster >>> f29a1e10-ee91-11e0-0000-534d24a6e7f7 >>> Waiting for schema agreement... >>> ... schemas agree across the cluster >>> Inserting data in cassandra >>> Connected to: "Foo" on 127.0.0.1/9160 >>> Authenticated to keyspace: Boo >>> Value inserted. >>> Value inserted. >>> Value inserted. >>> Value inserted. >>> Value inserted. >>> Value inserted. >>> Value inserted. >>> Value inserted. >>> Value inserted. >>> Value inserted. >>> Value inserted. >>> Value inserted. >>> Value inserted. >>> Value inserted. >>> Value inserted. >>> Value inserted. >>> Value inserted. >>> Value inserted. >>> Value inserted. >>>=20 >>> real 0m9.554s >>> user 0m2.729s >>> sys 0m0.194s >>>=20 >>>=20 >>> Joseph Norton >>> norton@alum.mit.edu >>>=20 >>>=20 >>>=20 >>>=20 >>=20 >>=20 >>=20 >> --=20 >> Jonathan Ellis >> Project Chair, Apache Cassandra >> co-founder of DataStax, the source for professional Cassandra support >> http://www.datastax.com >=20