Return-Path: X-Original-To: apmail-incubator-lucy-dev-archive@www.apache.org Delivered-To: apmail-incubator-lucy-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 475E82E6E for ; Sun, 1 May 2011 04:43:54 +0000 (UTC) Received: (qmail 97886 invoked by uid 500); 1 May 2011 04:43:52 -0000 Delivered-To: apmail-incubator-lucy-dev-archive@incubator.apache.org Received: (qmail 97814 invoked by uid 500); 1 May 2011 04:43:50 -0000 Mailing-List: contact lucy-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: lucy-dev@incubator.apache.org Delivered-To: mailing list lucy-dev@incubator.apache.org Received: (qmail 97805 invoked by uid 99); 1 May 2011 04:43:48 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 01 May 2011 04:43:48 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [68.116.39.62] (HELO rectangular.com) (68.116.39.62) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 01 May 2011 04:43:40 +0000 Received: from marvin by rectangular.com with local (Exim 4.69) (envelope-from ) id 1QGOPW-0002ge-5p; Sat, 30 Apr 2011 21:37:34 -0700 Date: Sat, 30 Apr 2011 21:37:34 -0700 From: Marvin Humphrey To: lucy-dev@incubator.apache.org, peter@peknet.com Message-ID: <20110501043734.GA9947@rectangular.com> References: <4DBCCCFC.9080200@peknet.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4DBCCCFC.9080200@peknet.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Virus-Checked: Checked by ClamAV on apache.org Subject: Re: [lucy-dev] FType_Equals On Sat, Apr 30, 2011 at 10:01:16PM -0500, Peter Karman wrote: > This change: > ================================ > r1085159 | marvin | 2011-03-24 17:02:51 -0500 (Thu, 24 Mar 2011) | 4 lines > > LUCY-138 ftype_equals.patch > Have FType_Equals() return false whenever classes for "self" and "other" don't > match. > ================================ > > is causing some of my existing code to break. Mmm, yes, I can see why this might be happening. Some of our backwards compatibility stubs are not providing enough backwards compatibility. That changeset implements an important bugfix, though. We discovered the problem it addresses after corrupting an index because we didn't detect that a field type had changed from one subclass to another and throw an error before the damage was unrecoverable. :( Without that patch, Lucy will let you change a field to a different type -- say one that uses a different posting format -- so long as the other tests within FType_Equals return true. That's bad, because as soon as the indexing session completes, you start trying to read from old segments using the wrong posting codec and Lucy crashes. > 'foo' cannot be Lucy::FieldType::FullTextType@0x000000010190d870 because already > assigned conflicting FieldType Lucy::Plan::FullTextType@0x000000010193bfe0 > > > > All of which makes me think that the comparison being done isn't really between > classes, as the commit message claims, because the objects compared are, in > fact, instances of the same class. > > What am I missing? They aren't quite the same -- they both start with "Lucy" and end with "FullTextType", but in between, one has "FieldType" and the other has "Plan". When we moved FullTextType from KinoSearch::FieldType::FullTextType to KinoSearch::Plan::FullTextType, we installed a compatibility stub subclass at the old location so that code like this would continue to work: my $type = KinoSearch::FieldType::FullTextType->new(%args); However, the classes aren't exactly the same -- the FieldType variant now subclasses the Plan variant -- and after the commit in question, FType_Equals() won't treat them as equivalent. Probably the best solution for Lucy is to rip out all the compatibility stub subclasses that were inherited from KinoSearch. You should make sure that all new code uses the Lucy::Plan::* variant. If you have conflicting field type classes in your active code, you should fix that and hopefully the problem will go away. If you don't, then you're hitting a problem that arises because within the schema file, the class name for stock FullTextType fields is not recorded -- they are just stored as "type":"fulltext". This is a little complicated to explain and it will go away if we remove the compat stubs, so I'll hold off on the long version until we see whether Plan A works for you. Marvin Humphrey