From issues-return-149055-archive-asf-public=cust-asf.ponee.io@flink.apache.org Tue Jan 23 13:41:07 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id CE36E180621 for ; Tue, 23 Jan 2018 13:41:07 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id BE2F9160C39; Tue, 23 Jan 2018 12:41:07 +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 102D3160C17 for ; Tue, 23 Jan 2018 13:41:06 +0100 (CET) Received: (qmail 79944 invoked by uid 500); 23 Jan 2018 12:41:06 -0000 Mailing-List: contact issues-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flink.apache.org Delivered-To: mailing list issues@flink.apache.org Received: (qmail 79935 invoked by uid 99); 23 Jan 2018 12:41:06 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Jan 2018 12:41:06 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id ABD65C29D9 for ; Tue, 23 Jan 2018 12:41:05 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -108.711 X-Spam-Level: X-Spam-Status: No, score=-108.711 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id rBOIIxwcAkhw for ; Tue, 23 Jan 2018 12:41:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id CE51C60D71 for ; Tue, 23 Jan 2018 12:41:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id E4075E0F9C for ; Tue, 23 Jan 2018 12:41:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 5256B25C6E for ; Tue, 23 Jan 2018 12:41:00 +0000 (UTC) Date: Tue, 23 Jan 2018 12:41:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@flink.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (FLINK-8484) Kinesis consumer re-reads closed shards on job restart MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/FLINK-8484?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1633= 5726#comment-16335726 ]=20 ASF GitHub Bot commented on FLINK-8484: --------------------------------------- Github user pluppens commented on the issue: https://github.com/apache/flink/pull/5337 =20 Ok, that makes sense to me. Give me a bit to cook up both the new test = and the new approach, and I'll update the PR. Thank you very much for the c= omments! > Kinesis consumer re-reads closed shards on job restart > ------------------------------------------------------ > > Key: FLINK-8484 > URL: https://issues.apache.org/jira/browse/FLINK-8484 > Project: Flink > Issue Type: Bug > Components: Kinesis Connector > Affects Versions: 1.4.0, 1.3.2 > Reporter: Philip Luppens > Assignee: Philip Luppens > Priority: Blocker > Labels: bug, flink, kinesis > Fix For: 1.3.3, 1.5.0, 1.4.1 > > > We=E2=80=99re using the connector to subscribe to streams varying from 1 = to a 100 shards, and used the kinesis-scaling-utils to dynamically scale th= e Kinesis stream up and down during peak times. What we=E2=80=99ve noticed = is that, while we were having closed shards, any Flink job restart with che= ck- or save-point would result in shards being re-read from the event horiz= on, duplicating our events. > =C2=A0 > We started checking the checkpoint state, and found that the shards were = stored correctly with the proper sequence number (including for closed shar= ds), but that upon restarts, the older closed shards would be read from the= event horizon, as if their restored state would be ignored. > =C2=A0 > In the end, we believe that we found the problem: in the FlinkKinesisCons= umer=E2=80=99s run() method, we=E2=80=99re trying to find the shard returne= d from the KinesisDataFetcher against the shards=E2=80=99 metadata from the= restoration point, but we do this via a containsKey() call, which means we= =E2=80=99ll use the StreamShardMetadata=E2=80=99s equals() method. However,= this checks for all properties, including the endingSequenceNumber, which = might have changed between the restored state=E2=80=99s checkpoint and our = data fetch, thus failing the equality check, failing the containsKey() chec= k, and resulting in the shard being re-read from the event horizon, even th= ough it was present in the restored state. > =C2=A0 > We=E2=80=99ve created a workaround where we only check for the shardId an= d stream name to restore the state of the shards we=E2=80=99ve already seen= , and this seems to work correctly.=C2=A0 -- This message was sent by Atlassian JIRA (v7.6.3#76005)