Return-Path: X-Original-To: apmail-incubator-bloodhound-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-bloodhound-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9A7EBD3EF for ; Thu, 20 Dec 2012 13:08:40 +0000 (UTC) Received: (qmail 44457 invoked by uid 500); 20 Dec 2012 13:08:40 -0000 Delivered-To: apmail-incubator-bloodhound-dev-archive@incubator.apache.org Received: (qmail 44312 invoked by uid 500); 20 Dec 2012 13:08:36 -0000 Mailing-List: contact bloodhound-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: bloodhound-dev@incubator.apache.org Delivered-To: mailing list bloodhound-dev@incubator.apache.org Received: (qmail 44274 invoked by uid 99); 20 Dec 2012 13:08:34 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Dec 2012 13:08:34 +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 (nike.apache.org: local policy) Received: from [209.85.215.49] (HELO mail-la0-f49.google.com) (209.85.215.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Dec 2012 13:08:24 +0000 Received: by mail-la0-f49.google.com with SMTP id r15so2959459lag.36 for ; Thu, 20 Dec 2012 05:08:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-originating-ip:in-reply-to:references:date :message-id:subject:from:to:content-type:x-gm-message-state; bh=12ycNVGQ1R2a8nAUIL4d9LTeKG1C1Cljh5hHVWVXoQ0=; b=aVtGw0Nl5pnbtEM1mPXkeGgubHlcsRmzqWrLesRzWiRkzO0QcnMsSyZF9677nYHTgw Tp8rSvSaW3cqgNV9i7KHS+qJnnPXpDrXLYNN7zegxYnMAFv+Wzi5lAl/pBkLz8V8yvRM IwH674ihPtRBhKlY/Ldfv7Igi9V4I1EU33jKovsrLVwlttKTdrmf/6f2RF/sFCwdK7EQ 0j+nkj6zn2qhiUbZJx9i/7ihLKO3rMcshBEEEkXi7rMHygjdTR7kXNFAQyB4KNv9011e SjZOCw2gPVBPu8ZuwSa2A+MlSCGLWEoLhJmo15TtUj4bLW6F9H1CbhVphqSrTB2iMyak agcw== MIME-Version: 1.0 Received: by 10.152.147.103 with SMTP id tj7mr8846984lab.54.1356008884250; Thu, 20 Dec 2012 05:08:04 -0800 (PST) Received: by 10.112.117.106 with HTTP; Thu, 20 Dec 2012 05:08:04 -0800 (PST) X-Originating-IP: [77.234.149.122] In-Reply-To: References: <20121219150559.630A4803B1@bloodhound-vm> Date: Thu, 20 Dec 2012 14:08:04 +0100 Message-ID: Subject: Re: [Apache Bloodhound] BloodhoundSearch modified From: Andrej Golcov To: bloodhound-dev@incubator.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQm0dTIW0VocNxA0rGeOrw4VGx2pxocjTIHkOvCf2Z4rhXRJ0UyyaCStHSNmFmhVv3Bg3Ijv X-Virus-Checked: Checked by ClamAV on apache.org Thanks to Olemis to bring this subject into discussion. > + * Usage of DB triggers is another alternative > side note : for some reason Trac-dev are not very fond of triggers ... > maybe because each DB backend provider implements triggers in a > different manner I'm also not a big fan od DB level hooks but we have to take all possibilities in consideration :) Talking about index/DB consistency, we have a transactional DB and non-transactional index. And we need some mechanism to have index as much as possible consistent to DB in order to avoid often full re-indexes. Talking about ticket indexing, I see two problems so far: - Version, Component and Product updates are not reflected in events that can be hooked for index update - ITicketChangeListener events are triggered after DB transaction commit that can potentially cause index inconsistency in case of index backend is unavailable or process terminated unexpectedly. IMHO, the most clean solution is adding support for this in Trac core. The suggestion is to introduce new interfaces such as ITicketChangingListener, IVersionChangingListener, IComponentChangingListener etc. that are triggered within transactional scope. These interfaces are aimed for short running operations within transaction but not for long running tasks such as mail sending etc. The search plugin will hook on these events. When called within transaction (for example by ITicketChangingListener) the search plugin can insert a record into new table e.g. index_tasks with changed ticket id, action name (changed/new/deleted) etc. Another out-of-transaction task can SELECT FROM index_tasks and perform real indexing. The task can be executed by cron job or/and within the same request that changed the ticket. Uf, a bit complicated, isn't it? What do you think, does it make sense? Other possible solutions are collected here: https://issues.apache.org/bloodhound/wiki/BloodhoundSearch#consistency What do you think if we contact Trac community with suggestion (and code) of introducing new interfaces like ITicketChangingListener and others? Regards, Andrej