Return-Path: X-Original-To: apmail-lucene-dev-archive@www.apache.org Delivered-To: apmail-lucene-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 6A1D110E43 for ; Sat, 28 Dec 2013 23:17:51 +0000 (UTC) Received: (qmail 97534 invoked by uid 500); 28 Dec 2013 23:17:50 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 97479 invoked by uid 500); 28 Dec 2013 23:17:50 -0000 Mailing-List: contact dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list dev@lucene.apache.org Received: (qmail 97471 invoked by uid 99); 28 Dec 2013 23:17:50 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 28 Dec 2013 23:17:50 +0000 Date: Sat, 28 Dec 2013 23:17:50 +0000 (UTC) From: "Mark Miller (JIRA)" To: dev@lucene.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (SOLR-5580) NPE when create a core with both explicite shard and coreNodeName 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/SOLR-5580?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13858163#comment-13858163 ] Mark Miller commented on SOLR-5580: ----------------------------------- That whole bit looks silly and dangerous to me. I'm not sure this is the right way to do this check and it seems we should just remove that whole attempt to skip publishing. I don't think it's well tested. > NPE when create a core with both explicite shard and coreNodeName > ------------------------------------------------------------------ > > Key: SOLR-5580 > URL: https://issues.apache.org/jira/browse/SOLR-5580 > Project: Solr > Issue Type: Bug > Affects Versions: 4.6 > Environment: OS:Red Hat Enterprise Linux Server release 6.4 (Santiago) > Software:solr 4.6, > jdk:OpenJDK Runtime Environment (rhel-2.3.4.1.el6_3-x86_64) > OpenJDK 64-Bit Server VM (build 23.2-b09, mixed mode) > Reporter: YouPeng Yang > Assignee: Mark Miller > Labels: core > Fix For: 5.0, 4.7, 4.6.1 > > Original Estimate: 0.5h > Remaining Estimate: 0.5h > > In class org.apache.solr.cloud.Overseer the Line 360: > --------------------------------------------------------------------- > if (sliceName !=null && collectionExists && !"true".equals(state.getCollection(collection).getStr("autoCreated"))) { > Slice slice = state.getSlice(collection, sliceName); > if (slice.getReplica(coreNodeName) == null) { > log.info("core_deleted . Just return"); > return state; > } > } > --------------------------------------------------------------------- > the slice needs to be checked null .because when create a new core with both explicite shard and coreNodeName, the state.getSlice(collection, sliceName) may return a null.So it needs to be checked ,or there will be an NullpointException > --------------------------------------------------------------------- > if (sliceName !=null && collectionExists && !"true".equals(state.getCollection(collection).getStr("autoCreated"))) { > Slice slice = state.getSlice(collection, sliceName); > if (slice != null && slice.getReplica(coreNodeName) == null) { > log.info("core_deleted . Just return"); > return state; > } > } > --------------------------------------------------------------------- -- This message was sent by Atlassian JIRA (v6.1.5#6160) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional commands, e-mail: dev-help@lucene.apache.org