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 EAA6D103D for ; Wed, 20 Apr 2011 01:26:19 +0000 (UTC) Received: (qmail 83651 invoked by uid 500); 20 Apr 2011 01:26:18 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 83625 invoked by uid 500); 20 Apr 2011 01:26:18 -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 83617 invoked by uid 99); 20 Apr 2011 01:26:18 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Apr 2011 01:26:18 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: 209.85.214.44 is neither permitted nor denied by domain of oberman@civicscience.com) Received: from [209.85.214.44] (HELO mail-bw0-f44.google.com) (209.85.214.44) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Apr 2011 01:26:13 +0000 Received: by bwz13 with SMTP id 13so264771bwz.31 for ; Tue, 19 Apr 2011 18:25:51 -0700 (PDT) Received: by 10.204.84.142 with SMTP id j14mr1628437bkl.20.1303262750851; Tue, 19 Apr 2011 18:25:50 -0700 (PDT) References: From: William Oberman In-Reply-To: Mime-Version: 1.0 (iPhone Mail 8C148) Date: Tue, 19 Apr 2011 21:25:44 -0400 Message-ID: <-3233914404432019140@unknownmsgid> Subject: Re: Cassandra 0.7.4 and LOCAL_QUORUM Consistency level To: "user@cassandra.apache.org" Content-Type: text/plain; charset=ISO-8859-1 Good point, should have read your message (and the code) more closely! Sent from my iPhone On Apr 19, 2011, at 9:16 PM, Oleg Tsvinev wrote: > I'm puzzled because code does not even check for LOCAL_QUORUM before > throwing exception. > Indeed I did not configure NetworkTopologyStrategy. Are you saying > that it works after configuring it? > > On Tue, Apr 19, 2011 at 6:04 PM, William Oberman > wrote: >> I had a similar error today when I tried using LOCAL_QUORUM without having a >> properly configured NetworkTopologyStrategy. QUORUM worked fine however. >> will >> >> On Tue, Apr 19, 2011 at 8:52 PM, Oleg Tsvinev >> wrote: >>> >>> Earlier I've posted the same message to a hector-users list. >>> >>> Guys, >>> >>> I'm a bit puzzled today. I'm using just released Hector 0.7.0-29 >>> (thank you, Nate!) and Cassandra 0.7.4 and getting the exception >>> below, marked as (1) Exception. When I dig to Cassandra source code >>> below, marked as (2) Cassandra source, I see that there's no check for >>> LOCAL_QUORUM. I also see that (3) cassandra.thrift defines >>> LOCAL_QUORUM as enum value 3 and in debugger, I see that LOCAL_QUORUM >>> is a valid enum value. >>> >>> My question is, how is it possible to use LOCAL_QUORUM if Cassandra >>> code throws exception when it sees it? Is it a bad merge or something? >>> I know it worked before, from looking at >>> https://issues.apache.org/jira/browse/CASSANDRA-2254 >>> >>> :-\ >>> >>> (1) Exception: >>> >>> 2011-04-19 14:57:33,550 [pool-2-thread-49] ERROR >>> org.apache.cassandra.thrift.Cassandra$Processor - Internal error >>> processing batch_mutate >>> java.lang.UnsupportedOperationException: invalid consistency level: >>> LOCAL_QUORUM >>> at >>> org.apache.cassandra.service.WriteResponseHandler.determineBlockFor(WriteResponseHandler.java:99) >>> at >>> org.apache.cassandra.service.WriteResponseHandler.(WriteResponseHandler.java:48) >>> at >>> org.apache.cassandra.service.WriteResponseHandler.create(WriteResponseHandler.java:61) >>> at >>> org.apache.cassandra.locator.AbstractReplicationStrategy.getWriteResponseHandler(AbstractReplicationStrategy.java:127) >>> at >>> org.apache.cassandra.service.StorageProxy.mutate(StorageProxy.java:115) >>> at >>> org.apache.cassandra.thrift.CassandraServer.doInsert(CassandraServer.java:415) >>> at >>> org.apache.cassandra.thrift.CassandraServer.batch_mutate(CassandraServer.java:388) >>> at >>> org.apache.cassandra.thrift.Cassandra$Processor$batch_mutate.process(Cassandra.java:3036) >>> at >>> org.apache.cassandra.thrift.Cassandra$Processor.process(Cassandra.java:2555) >>> at >>> org.apache.cassandra.thrift.CustomTThreadPoolServer$WorkerProcess.run(CustomTThreadPoolServer.java:206) >>> at >>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) >>> at >>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) >>> at java.lang.Thread.run(Thread.java:662) >>> >>> (2) Cassandra source (line 99 is throw statement) >>> >>> protected int determineBlockFor(String table) >>> { >>> int blockFor = 0; >>> switch (consistencyLevel) >>> { >>> case ONE: >>> blockFor = 1; >>> break; >>> case ANY: >>> blockFor = 1; >>> break; >>> case TWO: >>> blockFor = 2; >>> break; >>> case THREE: >>> blockFor = 3; >>> break; >>> case QUORUM: >>> blockFor = (writeEndpoints.size() / 2) + 1; >>> break; >>> case ALL: >>> blockFor = writeEndpoints.size(); >>> break; >>> default: >>> throw new UnsupportedOperationException("invalid >>> consistency level: " + consistencyLevel.toString()); >>> } >>> // at most one node per range can bootstrap at a time, and >>> these will be added to the write until >>> // bootstrap finishes (at which point we no longer need to >>> write to the old ones). >>> assert 1 <= blockFor && blockFor <= 2 * >>> Table.open(table).getReplicationStrategy().getReplicationFactor() >>> : String.format("invalid response count %d for replication >>> factor %d", >>> blockFor, >>> Table.open(table).getReplicationStrategy().getReplicationFactor()); >>> return blockFor; >>> } >>> >>> (3) cassandra.thrift: >>> >>> enum ConsistencyLevel { >>> ONE = 1, >>> QUORUM = 2, >>> LOCAL_QUORUM = 3, >>> EACH_QUORUM = 4, >>> ALL = 5, >>> ANY = 6, >>> TWO = 7, >>> THREE = 8, >>> } >> >> >> >> -- >> Will Oberman >> Civic Science, Inc. >> 3030 Penn Avenue., First Floor >> Pittsburgh, PA 15201 >> (M) 412-480-7835 >> (E) oberman@civicscience.com >>