Return-Path: X-Original-To: apmail-falcon-dev-archive@minotaur.apache.org Delivered-To: apmail-falcon-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 169BC18BD1 for ; Tue, 10 Nov 2015 01:18:14 +0000 (UTC) Received: (qmail 61219 invoked by uid 500); 10 Nov 2015 01:18:14 -0000 Delivered-To: apmail-falcon-dev-archive@falcon.apache.org Received: (qmail 61172 invoked by uid 500); 10 Nov 2015 01:18:13 -0000 Mailing-List: contact dev-help@falcon.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@falcon.apache.org Delivered-To: mailing list dev@falcon.apache.org Received: (qmail 61160 invoked by uid 99); 10 Nov 2015 01:18:13 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Nov 2015 01:18:13 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 628ED1A0ADB for ; Tue, 10 Nov 2015 01:18:13 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.97 X-Spam-Level: X-Spam-Status: No, score=0.97 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id 9BW6cuLFNqkO for ; Tue, 10 Nov 2015 01:18:12 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with SMTP id 11B6E44177 for ; Tue, 10 Nov 2015 01:18:11 +0000 (UTC) Received: (qmail 60197 invoked by uid 99); 10 Nov 2015 01:18:11 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Nov 2015 01:18:11 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 0CA9B2C1F5A for ; Tue, 10 Nov 2015 01:18:11 +0000 (UTC) Date: Tue, 10 Nov 2015 01:18:11 +0000 (UTC) From: "Balu Vellanki (JIRA)" To: dev@falcon.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (FALCON-1372) Retention does not work in corner cases 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/FALCON-1372?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14997781#comment-14997781 ] Balu Vellanki commented on FALCON-1372: --------------------------------------- The bug is caused due to the way java.util.Calendar handles DAY_OF_MONTH. In FeedHelper, the getDate(...) method sets DAY_OF_MONTH to 0 for date patterns like ${YEAR}/${MONTH}. This causes the month to be setback by 1. So "2015/11" will be treated as Oct 31st, 2015. Hence this instance will be evicted. For a date like "2015/11" , Calender should be set to cal.set(2015, 10, 1, 0, 0, 0); The MONTH should be "value - 1" and The DAY_OF_MONTH begins with a 1 instead of 0. > Retention does not work in corner cases > ---------------------------------------- > > Key: FALCON-1372 > URL: https://issues.apache.org/jira/browse/FALCON-1372 > Project: Falcon > Issue Type: Bug > Affects Versions: 0.6.1 > Reporter: Balu Vellanki > Assignee: Balu Vellanki > > Originally reported by [~rostafiychuk]. > RetentionTest#testRetention (24, DAYS, true, MONTHLY, true) > Uploaded feed: > {code:xml} > > hours(1) > UTC > > > > > > > > > > > > > > > > > {code} > Created dirs: > {code} > dataDates = [2012/06, 2012/07, 2012/08, 2012/09, 2012/10, 2012/11, 2012/12, 2013/01, 2013/02, 2013/03, 2013/04, 2013/05, 2013/06, 2013/07, 2013/08, 2013/09, 2013/10, 2013/11, 2013/12, 2014/01, 2014/02, 2014/03, 2014/04, 2014/05, 2014/06, 2014/07, 2014/08, 2014/09, 2014/10, 2014/11, 2014/12, 2015/01, 2015/02, 2015/03, 2015/04, 2015/05, 2015/06, 2015/07, 2015/08, 2015/09, 2015/10, 2015/11, 2015/12, 2016/01, 2016/02, 2016/03, 2016/04, 2016/05, 2016/06, 2016/07, 2016/08, 2016/09, 2016/10, 2016/11, 2016/12, 2017/01, 2017/02, 2017/03, 2017/04, 2017/05, 2017/06, 2017/07, 2017/08, 2017/09, 2017/10, 2017/11, 2017/12, 2018/01, 2018/02, 2018/03, 2018/04, 2018/05, 2018/06, 2018/07] {code} > expected for deletion: > {code} [2012/06, 2012/07, 2012/08, 2012/09, 2012/10, 2012/11, 2012/12, 2013/01, 2013/02, 2013/03, 2013/04, 2013/05, 2013/06, 2013/07, 2013/08, 2013/09, 2013/10, 2013/11, 2013/12, 2014/01, 2014/02, 2014/03, 2014/04, 2014/05, 2014/06, 2014/07, 2014/08, 2014/09, 2014/10, 2014/11, 2014/12, 2015/01, 2015/02, 2015/03, 2015/04, 2015/05] > {code} > deleted: > {code:javascript}[2012/06, 2012/07, 2012/08, 2012/09, 2012/10, 2012/11, 2012/12, 2013/01, 2013/02, 2013/03, 2013/04, 2013/05, 2013/06, 2013/07, 2013/08, 2013/09, 2013/10, 2013/11, 2013/12, 2014/01, 2014/02, 2014/03, 2014/04, 2014/05, 2014/06, 2014/07, 2014/08, 2014/09, 2014/10, 2014/11, 2014/12, 2015/01, 2015/02, 2015/03, 2015/04, 2015/05, 2015/06] > {code} > 24 days ago was 31th of May, but *2015/06* was deleted too. > Another case: > RetentionTest#testRetention (10080, HOURS, false, MONTHLY, true) > {code:xml} > > {code} > 10080 hours ago was 30th of April, but dir *"2014/05"* was deleted. -- This message was sent by Atlassian JIRA (v6.3.4#6332)