Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6F217DECE for ; Mon, 1 Oct 2012 22:13:08 +0000 (UTC) Received: (qmail 42558 invoked by uid 500); 1 Oct 2012 22:13:08 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 42497 invoked by uid 500); 1 Oct 2012 22:13:08 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 42487 invoked by uid 99); 1 Oct 2012 22:13:08 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Oct 2012 22:13:08 +0000 Date: Tue, 2 Oct 2012 09:13:08 +1100 (NCT) From: "Jackson Chung (JIRA)" To: commits@cassandra.apache.org Message-ID: <152728933.151228.1349129588225.JavaMail.jiratomcat@arcas> In-Reply-To: <339505412.90667.1347931507557.JavaMail.jiratomcat@arcas> Subject: [jira] [Commented] (CASSANDRA-4675) NPE in NTS when using LQ against a node (DC) that doesn't have replica MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CASSANDRA-4675?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13467247#comment-13467247 ] Jackson Chung commented on CASSANDRA-4675: ------------------------------------------ +1 thx > NPE in NTS when using LQ against a node (DC) that doesn't have replica > ---------------------------------------------------------------------- > > Key: CASSANDRA-4675 > URL: https://issues.apache.org/jira/browse/CASSANDRA-4675 > Project: Cassandra > Issue Type: Bug > Components: Core > Affects Versions: 0.7.0 > Reporter: Jackson Chung > Assignee: Jonathan Ellis > Priority: Minor > Fix For: 1.1.6 > > Attachments: 4675.txt > > > in a NetworkTopologyStrategy where there are 2 DC: > {panel} > Address DC Rack Status State Load Owns Token > 85070591730234615865843651857942052864 > 127.0.0.1 dc1 r1 Up Normal 115.78 KB 50.00% 0 > 127.0.0.2 dc2 r1 Up Normal 129.3 KB 50.00% 85070591730234615865843651857942052864 > {panel} > I have a KS that has replica is 1 of the dc (dc1): > {panel} > [default@unknown] describe Keyspace3; > Keyspace: Keyspace3: > Replication Strategy: org.apache.cassandra.locator.NetworkTopologyStrategy > Durable Writes: true > Options: [dc1:1] > Column Families: > ColumnFamily: testcf > {panel} > But if I connect to a node in dc2, using LOCAL_QUORUM, I get NPE in the Cassandra node's log: > {panel} > [default@unknown] consistencylevel as LOCAL_QUORUM; > Consistency level is set to 'LOCAL_QUORUM'. > [default@unknown] use Keyspace3; > Authenticated to keyspace: Keyspace3 > [default@Keyspace3] get testcf[utf8('k1')][utf8('c1')]; > Internal error processing get > org.apache.thrift.TApplicationException: Internal error processing get > at org.apache.thrift.TApplicationException.read(TApplicationException.java:108) > at org.apache.cassandra.thrift.Cassandra$Client.recv_get(Cassandra.java:511) > at org.apache.cassandra.thrift.Cassandra$Client.get(Cassandra.java:492) > at org.apache.cassandra.cli.CliClient.executeGet(CliClient.java:648) > at org.apache.cassandra.cli.CliClient.executeCLIStatement(CliClient.java:209) > at org.apache.cassandra.cli.CliMain.processStatementInteractive(CliMain.java:220) > at org.apache.cassandra.cli.CliMain.main(CliMain.java:348) > {panel} > node2's log: > {panel} > ERROR [Thrift:3] 2012-09-17 18:15:16,868 Cassandra.java (line 2999) Internal error processing get > java.lang.NullPointerException > at org.apache.cassandra.locator.NetworkTopologyStrategy.getReplicationFactor(NetworkTopologyStrategy.java:142) > at org.apache.cassandra.service.DatacenterReadCallback.determineBlockFor(DatacenterReadCallback.java:90) > at org.apache.cassandra.service.ReadCallback.(ReadCallback.java:67) > at org.apache.cassandra.service.DatacenterReadCallback.(DatacenterReadCallback.java:63) > at org.apache.cassandra.service.StorageProxy.getReadCallback(StorageProxy.java:775) > at org.apache.cassandra.service.StorageProxy.fetchRows(StorageProxy.java:609) > at org.apache.cassandra.service.StorageProxy.read(StorageProxy.java:564) > at org.apache.cassandra.thrift.CassandraServer.readColumnFamily(CassandraServer.java:128) > at org.apache.cassandra.thrift.CassandraServer.internal_get(CassandraServer.java:383) > at org.apache.cassandra.thrift.CassandraServer.get(CassandraServer.java:401) > at org.apache.cassandra.thrift.Cassandra$Processor$get.process(Cassandra.java:2989) > at org.apache.cassandra.thrift.Cassandra$Processor.process(Cassandra.java:2889) > at org.apache.cassandra.thrift.CustomTThreadPoolServer$WorkerProcess.run(CustomTThreadPoolServer.java:187) > at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) > at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) > {panel} > I could workaround it by adding dc2:0 to the option: > {panel} > [default@Keyspace3] describe Keyspace3; > Keyspace: Keyspace3: > Replication Strategy: org.apache.cassandra.locator.NetworkTopologyStrategy > Durable Writes: true > Options: [dc2:0, dc1:1] > Column Families: > ColumnFamily: testcf > {panel} > Now you get UA: > {panel} > [default@Keyspace3] get testcf[utf8('k1')][utf8('c1')]; > null > UnavailableException() > at org.apache.cassandra.thrift.Cassandra$get_result.read(Cassandra.java:6506) > at org.apache.cassandra.thrift.Cassandra$Client.recv_get(Cassandra.java:519) > at org.apache.cassandra.thrift.Cassandra$Client.get(Cassandra.java:492) > at org.apache.cassandra.cli.CliClient.executeGet(CliClient.java:648) > at org.apache.cassandra.cli.CliClient.executeCLIStatement(CliClient.java:209) > at org.apache.cassandra.cli.CliMain.processStatementInteractive(CliMain.java:220) > at org.apache.cassandra.cli.CliMain.main(CliMain.java:348) > {panel} > On a side note, is there a thought on having a CL.LOCAL_ONE? Ie if local node (wrt the dc) does not have replica, on a LOCAL_ONE, it won't try to go across DC to try to get it. It would be similar to LOCAL_QUORUM. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira