Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 009E7200D50 for ; Mon, 4 Dec 2017 10:57:42 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id F1BFE160C05; Mon, 4 Dec 2017 09:57:42 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 24F85160BF9 for ; Mon, 4 Dec 2017 10:57:41 +0100 (CET) Received: (qmail 10049 invoked by uid 500); 4 Dec 2017 09:57:41 -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 10038 invoked by uid 99); 4 Dec 2017 09:57:40 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Dec 2017 09:57:40 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id E37F91806E2 for ; Mon, 4 Dec 2017 09:57:39 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.879 X-Spam-Level: * X-Spam-Status: No, score=1.879 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id zTqoV570-OHR for ; Mon, 4 Dec 2017 09:57:38 +0000 (UTC) Received: from mail-wm0-f49.google.com (mail-wm0-f49.google.com [74.125.82.49]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 79AED5F3FF for ; Mon, 4 Dec 2017 09:57:38 +0000 (UTC) Received: by mail-wm0-f49.google.com with SMTP id b76so13152880wmg.1 for ; Mon, 04 Dec 2017 01:57:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=72QUNYfcyutA7GwasFkz3oaWXl5UNqX23QOrwhcZNRo=; b=j6LWIGMpKdvEuQpfayS1i1lm7p3Zx3bY6ovXX0L/+GuI+wtsvPqU8Dpn9NIYYhr1Tq dxAefo0NQ6KT6KV2fZcSmUoR/EoqyRbk7nng44fwwIAj0DtTrUaOxk1vKt6IiSzXFcbA zLlq/bu+zE8cz0KQQzks1vnzc2FXSRPB+eYMiddQryXFFF9DAyYTtwj26ng3pbmUPin5 zup6Vwli9WGp7CeKC0dctTZOaGj++Uk4ng/+C/L4hFWMb+7/WbwIncaIDxmL0l6qq3Bs xmNgXv4YVsxCegFN4XVe2WgEVTbv/7xVMZaDIf/nBiMe3mgFhrPPkAnJ4rBf4x+1c6d4 9TDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=72QUNYfcyutA7GwasFkz3oaWXl5UNqX23QOrwhcZNRo=; b=DhqldJcNWuZk1JP0qN+TSy6w9C/hnLnARYIVFmk8hvQWRa/ElkfbUDO/Kg1TpShyOI b/e8aYOHAThBRvXZyHFrHDZS76/iO/fLjk5Hn3CPuhE7BTK2V4r8/gXzggPlHpVJuxCf cTyThPej1uCI4IVyGMKslNUGeFIHYiw9yDBaE3A/pQ0kwfpxQA1K8XnsEGHwwFlpGWUz uo0+ydQgR8LTFvSrDwar/9GNoTWwWenz7myRZ7+WJwoiMG+9XBpirk79KhBk3J7DA51r XbupC9nJCKbkA8yFGfn/NU/ckF++k3zMQ3ADnf48W1BR+ZFSznZ/X+y/G9kIt6iQk5yz Vylw== X-Gm-Message-State: AKGB3mJjhSkMYZ64mb1r/4U/Gu3s50SYcj6ghkOPzYHbtQ8jvNML8uZC Mt1ya+PMsis0Uk1UFy535ikZ9wzikZFkFA5sOP0= X-Google-Smtp-Source: AGs4zMbsiUBjPvVFUVAOGlSh9R1aOyzlN0L7E9uZAHgF8NcPmcHeAHHrRdsnChx7/iL/DkMO4srIUdITzAtFrJwqWzM= X-Received: by 10.28.68.194 with SMTP id r185mr2351897wma.73.1512381452232; Mon, 04 Dec 2017 01:57:32 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Adrien Grand Date: Mon, 04 Dec 2017 09:57:21 +0000 Message-ID: Subject: Re: Potential bug in UsageTrackingQueryCachingPolicy To: dev@lucene.apache.org Content-Type: multipart/alternative; boundary="001a114a448839ae09055f80bf21" archived-at: Mon, 04 Dec 2017 09:57:43 -0000 --001a114a448839ae09055f80bf21 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hey Jon, FYI I fixed this bug you reported at https://issues.apache.org/jira/browse/LUCENE-8078. Thanks again for reporting it. Le lun. 20 nov. 2017 =C3=A0 16:11, Adrien Grand a =C3= =A9crit : > Hi Jon, > > Sorry for the late reply. You are right that it should return true rather > than false. Would you like to submit a patch? > > Le ven. 3 nov. 2017 =C3=A0 19:04, Jon Harper a = =C3=A9crit : > >> Hi, >> >> I'm looking at lucene-core UsageTrackingQueryCachingPolicy.java (caching >> policy for the LRUCache), one line of code looks dubious in the >> shouldNeverCache method >> >> The comment says "For the below queries, it's cheap to notice they canno= t >> match any docs so we do not bother caching them. " but then returns >> false to shouldnevercache for MatchNoDocsQuery >> >> Note that empty BooleanQuery and empty DisjunctionMaxQuery return true >> and hence are never cached >> >> Here's a github link to the line in question for easy and quick access. >> >> >> https://github.com/apache/lucene-solr/blob/1d2787464f4709f4960716dd3314c= 7123324b15b/lucene/core/src/java/org/apache/lucene/search/UsageTrackingQuer= yCachingPolicy.java#L71 >> >> >> Regards, >> Jon >> > --001a114a448839ae09055f80bf21 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hey Jon,

FYI I fixed this bug you report= ed at https:/= /issues.apache.org/jira/browse/LUCENE-8078. Thanks again for reporting = it.

Le=C2=A0lun. 2= 0 nov. 2017 =C3=A0=C2=A016:11, Adrien Grand <jpountz@gmail.com> a =C3=A9crit=C2=A0:
Hi Jon,

Sorry for t= he late reply. You are right that it should return true rather than false. = Would you like to submit a patch?

<= div dir=3D"ltr">Le=C2=A0ven. 3 nov. 2017 =C3=A0=C2=A019:04, Jon Harper <= jon.harper87@gm= ail.com> a =C3=A9crit=C2=A0:
Hi,

I'm looking at lucene-core= =20 UsageTrackingQueryCachingPolicy.java (caching policy for the LRUCache),=20 one line of code looks dubious in the shouldNeverCache method
<= br>The comment says "For the below queries, it's cheap to no= tice they cannot match any docs so=C2=A0=C2=A0=C2=A0=C2= =A0 we do not bother caching them. "=C2=A0=C2=A0bu= t then returns false to shouldnevercache for MatchNoDocsQuery

Note that empty BooleanQuery and empty DisjunctionMaxQu= ery return true and hence are never cached

--001a114a448839ae09055f80bf21--