You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Joseph Norton <no...@lovely.email.ne.jp> on 2011/10/04 16:15:19 UTC

How to speed up "Waiting for schema agreement" for a single node Cassandra cluster?

Hello.

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.

Can you recommend any tricks or recipes to reduce the time required for such operations and/or for "Waiting for schema agreement" to complete?

regards,

- Joe N.




$ 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.

real	0m9.554s
user	0m2.729s
sys	0m0.194s


Joseph Norton
norton@alum.mit.edu




Re: How to speed up "Waiting for schema agreement" for a single node Cassandra cluster?

Posted by Roshan Dawrani <ro...@gmail.com>.
On Wed, Oct 5, 2011 at 7:42 AM, Jeremiah Jordan <
jeremiah.jordan@morningstar.com> wrote:

> 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


Exactly the thing we also found out (and hence ditched "truncate" for DB
cleanup between tests):
http://roshandawrani.wordpress.com/2011/09/30/grails-cassandra-giving-each-test-a-clean-db-to-work-with/
.
Worked much better for us this way.

-- 
Roshan
Blog: http://roshandawrani.wordpress.com/
Twitter: @roshandawrani <http://twitter.com/roshandawrani>
Skype: roshandawrani

Re: How to speed up "Waiting for schema agreement" for a single node Cassandra cluster?

Posted by Jeremiah Jordan <je...@morningstar.com>.
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:

> 
> I didn't consider using truncate because a set of potentially random Column Families are created dynamically during the test.
> 
> Are there any configuration knobs that could be adjusted for drop + recreate?
> 
> thanks in advance,
> 
> - Joe N
> 
> 
> Joseph Norton
> norton@alum.mit.edu
> 
> 
> 
> On Oct 4, 2011, at 11:19 PM, Jonathan Ellis wrote:
> 
>> Truncate is faster than drop + recreate.
>> 
>> On Tue, Oct 4, 2011 at 9:15 AM, Joseph Norton <no...@lovely.email.ne.jp> wrote:
>>> 
>>> Hello.
>>> 
>>> 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.
>>> 
>>> Can you recommend any tricks or recipes to reduce the time required for such operations and/or for "Waiting for schema agreement" to complete?
>>> 
>>> regards,
>>> 
>>> - Joe N.
>>> 
>>> 
>>> 
>>> 
>>> $ 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.
>>> 
>>> real    0m9.554s
>>> user    0m2.729s
>>> sys     0m0.194s
>>> 
>>> 
>>> Joseph Norton
>>> norton@alum.mit.edu
>>> 
>>> 
>>> 
>>> 
>> 
>> 
>> 
>> -- 
>> Jonathan Ellis
>> Project Chair, Apache Cassandra
>> co-founder of DataStax, the source for professional Cassandra support
>> http://www.datastax.com
> 


Re: How to speed up "Waiting for schema agreement" for a single node Cassandra cluster?

Posted by Joseph Norton <no...@lovely.email.ne.jp>.
Thanks for the pointers.  For this type of functional unit testing, I suppose what I really want is a mock Cassandra (or Thrift Server) node for quickly running lots of tests for an application's logic.

thanks,

- Joe N.


Joseph Norton
norton@alum.mit.edu



On Oct 5, 2011, at 12:01 AM, Jonathan Ellis wrote:

> Hmm...  Maybe disable compaction, since that can block schema changes.
> Otherwise the big win will be in
> https://issues.apache.org/jira/browse/CASSANDRA-1391.
> 
> On Tue, Oct 4, 2011 at 9:33 AM, Joseph Norton <no...@lovely.email.ne.jp> wrote:
>> 
>> I didn't consider using truncate because a set of potentially random Column Families are created dynamically during the test.
>> 
>> Are there any configuration knobs that could be adjusted for drop + recreate?
>> 
>> thanks in advance,
>> 
>> - Joe N
>> 
>> 
>> Joseph Norton
>> norton@alum.mit.edu
>> 
>> 
>> 
>> On Oct 4, 2011, at 11:19 PM, Jonathan Ellis wrote:
>> 
>>> Truncate is faster than drop + recreate.
>>> 
>>> On Tue, Oct 4, 2011 at 9:15 AM, Joseph Norton <no...@lovely.email.ne.jp> wrote:
>>>> 
>>>> Hello.
>>>> 
>>>> 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.
>>>> 
>>>> Can you recommend any tricks or recipes to reduce the time required for such operations and/or for "Waiting for schema agreement" to complete?
>>>> 
>>>> regards,
>>>> 
>>>> - Joe N.
>>>> 
>>>> 
>>>> 
>>>> 
>>>> $ 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.
>>>> 
>>>> real    0m9.554s
>>>> user    0m2.729s
>>>> sys     0m0.194s
>>>> 
>>>> 
>>>> Joseph Norton
>>>> norton@alum.mit.edu
>>>> 
>>>> 
>>>> 
>>>> 
>>> 
>>> 
>>> 
>>> --
>>> Jonathan Ellis
>>> Project Chair, Apache Cassandra
>>> co-founder of DataStax, the source for professional Cassandra support
>>> http://www.datastax.com
>> 
>> 
> 
> 
> 
> -- 
> Jonathan Ellis
> Project Chair, Apache Cassandra
> co-founder of DataStax, the source for professional Cassandra support
> http://www.datastax.com


Re: How to speed up "Waiting for schema agreement" for a single node Cassandra cluster?

Posted by Jonathan Ellis <jb...@gmail.com>.
Hmm...  Maybe disable compaction, since that can block schema changes.
 Otherwise the big win will be in
https://issues.apache.org/jira/browse/CASSANDRA-1391.

On Tue, Oct 4, 2011 at 9:33 AM, Joseph Norton <no...@lovely.email.ne.jp> wrote:
>
> I didn't consider using truncate because a set of potentially random Column Families are created dynamically during the test.
>
> Are there any configuration knobs that could be adjusted for drop + recreate?
>
> thanks in advance,
>
> - Joe N
>
>
> Joseph Norton
> norton@alum.mit.edu
>
>
>
> On Oct 4, 2011, at 11:19 PM, Jonathan Ellis wrote:
>
>> Truncate is faster than drop + recreate.
>>
>> On Tue, Oct 4, 2011 at 9:15 AM, Joseph Norton <no...@lovely.email.ne.jp> wrote:
>>>
>>> Hello.
>>>
>>> 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.
>>>
>>> Can you recommend any tricks or recipes to reduce the time required for such operations and/or for "Waiting for schema agreement" to complete?
>>>
>>> regards,
>>>
>>> - Joe N.
>>>
>>>
>>>
>>>
>>> $ 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.
>>>
>>> real    0m9.554s
>>> user    0m2.729s
>>> sys     0m0.194s
>>>
>>>
>>> Joseph Norton
>>> norton@alum.mit.edu
>>>
>>>
>>>
>>>
>>
>>
>>
>> --
>> Jonathan Ellis
>> Project Chair, Apache Cassandra
>> co-founder of DataStax, the source for professional Cassandra support
>> http://www.datastax.com
>
>



-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of DataStax, the source for professional Cassandra support
http://www.datastax.com

Re: How to speed up "Waiting for schema agreement" for a single node Cassandra cluster?

Posted by Joseph Norton <no...@lovely.email.ne.jp>.
I didn't consider using truncate because a set of potentially random Column Families are created dynamically during the test.

Are there any configuration knobs that could be adjusted for drop + recreate?

thanks in advance,

- Joe N


Joseph Norton
norton@alum.mit.edu



On Oct 4, 2011, at 11:19 PM, Jonathan Ellis wrote:

> Truncate is faster than drop + recreate.
> 
> On Tue, Oct 4, 2011 at 9:15 AM, Joseph Norton <no...@lovely.email.ne.jp> wrote:
>> 
>> Hello.
>> 
>> 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.
>> 
>> Can you recommend any tricks or recipes to reduce the time required for such operations and/or for "Waiting for schema agreement" to complete?
>> 
>> regards,
>> 
>> - Joe N.
>> 
>> 
>> 
>> 
>> $ 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.
>> 
>> real    0m9.554s
>> user    0m2.729s
>> sys     0m0.194s
>> 
>> 
>> Joseph Norton
>> norton@alum.mit.edu
>> 
>> 
>> 
>> 
> 
> 
> 
> -- 
> Jonathan Ellis
> Project Chair, Apache Cassandra
> co-founder of DataStax, the source for professional Cassandra support
> http://www.datastax.com


Re: How to speed up "Waiting for schema agreement" for a single node Cassandra cluster?

Posted by Jonathan Ellis <jb...@gmail.com>.
Truncate is faster than drop + recreate.

On Tue, Oct 4, 2011 at 9:15 AM, Joseph Norton <no...@lovely.email.ne.jp> wrote:
>
> Hello.
>
> 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.
>
> Can you recommend any tricks or recipes to reduce the time required for such operations and/or for "Waiting for schema agreement" to complete?
>
> regards,
>
> - Joe N.
>
>
>
>
> $ 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.
>
> real    0m9.554s
> user    0m2.729s
> sys     0m0.194s
>
>
> Joseph Norton
> norton@alum.mit.edu
>
>
>
>



-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of DataStax, the source for professional Cassandra support
http://www.datastax.com