From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 10.90.117.16 with SMTP id p16cs424785agc; Sun, 1 Nov 2009 15:09:25 -0800 (PST) Received: by 10.224.41.135 with SMTP id o7mr2501024qae.29.1257116964401; Sun, 01 Nov 2009 15:09:24 -0800 (PST) Return-Path: Received: from rubyforge.org (rubyforge.org [205.234.109.19]) by mx.google.com with ESMTP id 38si6729609qyk.119.2009.11.01.15.09.24; Sun, 01 Nov 2009 15:09:24 -0800 (PST) Received-SPF: pass (google.com: domain of sup-talk-bounces@rubyforge.org designates 205.234.109.19 as permitted sender) client-ip=205.234.109.19; Authentication-Results: mx.google.com; spf=pass (google.com: domain of sup-talk-bounces@rubyforge.org designates 205.234.109.19 as permitted sender) smtp.mail=sup-talk-bounces@rubyforge.org Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id AD6AE1D78834; Sun, 1 Nov 2009 18:09:23 -0500 (EST) Received: from entry.masanjin.net (masanjin.net [209.20.72.13]) by rubyforge.org (Postfix) with ESMTP id 648D018582C2 for ; Sun, 1 Nov 2009 17:57:45 -0500 (EST) Received: from w by entry.masanjin.net with local (Exim 4.69) (envelope-from ) id 1N4jMm-0002on-6U for sup-talk@rubyforge.org; Sun, 01 Nov 2009 14:57:45 -0800 From: William Morgan To: sup-talk In-reply-to: <1256297205-sup-683@sam.mediasupervision.de> References: <1256297205-sup-683@sam.mediasupervision.de> Date: Sun, 01 Nov 2009 14:57:44 -0800 Message-Id: <1257115167-sup-6013@masanjin.net> User-Agent: Sup/git Subject: Re: [sup-talk] A fix for the joining threads bug with Ferret X-BeenThere: sup-talk@rubyforge.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: User & developer discussion of Sup List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: sup-talk-bounces@rubyforge.org Errors-To: sup-talk-bounces@rubyforge.org Reformatted excerpts from Gregor Hoffleit's message of 2009-10-23: > I managed to track down the problem until the following line in > FerretIndex#sync_message in lib/sup/ferret_index.rb. > > d = { ... :refs => (entry[:refs] || (m.refs + m.replytos).uniq.join(" ")) } Great catch. Thank you! > For me, it always evaluates to "entry[:refs]" (even if that's an empty > string!), losing the reference in the modified message m, which was > added by add_ref. Therefore the manual join is always lost. Yep, that's the problem. In general all those fields are ||= in order to save the work of computing them again when we're updating a message (because the way Ferret works is we have to rewrite the entire record every time we change the labels, so we want that to be as fast as possible). But for certain fields, including refs, we should regenerate them because that data can change. > Btw, the code in xapian_index.rb looks much different. Still, I'd like > to see this fixed for Xapian. I believe that the fix for both is simply to set the entry[:refs] every time, and not bother with ||=. (In fact I think the empty string check won't work for threads that already have refs set, i.e. joining threads of size >1.) I've put this fix on branch thread-joining-fix and merged into next. Check it out. -- William _______________________________________________ sup-talk mailing list sup-talk@rubyforge.org http://rubyforge.org/mailman/listinfo/sup-talk