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 4AC7A200D35 for ; Tue, 7 Nov 2017 12:30:19 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 49015160BED; Tue, 7 Nov 2017 11:30:19 +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 4000E1609C8 for ; Tue, 7 Nov 2017 12:30:18 +0100 (CET) Received: (qmail 13555 invoked by uid 500); 7 Nov 2017 11:30:17 -0000 Mailing-List: contact user-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list user@flink.apache.org Received: (qmail 13546 invoked by uid 99); 7 Nov 2017 11:30:17 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Nov 2017 11:30:17 +0000 Received: from [192.168.178.53] (ip-2-205-80-95.web.vodafone.de [2.205.80.95]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPSA id CDF211A0015 for ; Tue, 7 Nov 2017 11:30:15 +0000 (UTC) Subject: Re: Flink send checkpointing message in IT To: user@flink.apache.org References: <46D94167-0332-4924-A503-279019995CD2@cleverdata.ru> <79b8533f-848f-4e52-ff2a-2ef7b4fdc032@apache.org> <97C62E1A-32C5-46C8-9D89-1CFA19DD1231@cleverdata.ru> From: Chesnay Schepler Message-ID: <36e2b58c-7c3a-7cc8-2f7d-9e54c5e3c0c7@apache.org> Date: Tue, 7 Nov 2017 12:30:12 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <97C62E1A-32C5-46C8-9D89-1CFA19DD1231@cleverdata.ru> Content-Type: multipart/alternative; boundary="------------8F497BCF83B7B5231E49D67E" Content-Language: en-US archived-at: Tue, 07 Nov 2017 11:30:19 -0000 This is a multi-part message in MIME format. --------------8F497BCF83B7B5231E49D67E Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit hmm. While there is /technically/ no guarantee that notifyCheckpointComplete is called, it virtually always is, especially in local setups. Is it possible for you to share more code (or all of it)? (you can also send it to me directly) On 07.11.2017 11:58, Rinat wrote: > Yes, but *notifyCheckpointComplete *callback doesn’t called on await > completion, I do the same, as in specified test template : > > ActorGateway jobManager = (ActorGateway) > Await.result(cluster.leaderGateway().future(), DEADLINE.timeLeft()); > Future savepointResultFuture = jobManager.ask(new > JobManagerMessages.TriggerSavepoint( > jobId, Option.empty()), DEADLINE.timeLeft() > ); > while(!savepointResultFuture.isCompleted()) { > System.out.println(); > } > Object savepointResult = Await.result(savepointResultFuture, > DEADLINE.timeLeft()); > > if (savepointResult instanceof > JobManagerMessages.TriggerSavepointFailure) { > throw new RuntimeException(String.format("Something went > wrong while executing savepoint, [message=%s]", > ((JobManagerMessages.TriggerSavepointFailure) savepointResult).cause() > )); > } > > Thx > >> On 7 Nov 2017, at 13:54, Chesnay Schepler > > wrote: >> >> Do you verify that savepointResult is a >> JobManagerMessages.TriggerSavepointSuccess? It could also be >> JobManagerMessages.TriggerSavepointFailure. (instanceof check) >> >> On 02.11.2017 19:11, Rinat wrote: >>> Chesnay, thanks for your reply, it was very helpful, but I took >>> logic from this test template and tried to reuse it in my IT case, >>> but found one more issue. >>> I’ve registered an accumulator in my source function, and for it’s >>> value, as specified in the specified example. >>> When accumulator has an expected value, I perform a savepoint and >>> wait for it’s completion using the further code >>> >>> ActorGateway jobManager = (ActorGateway) Await.result(cluster.leaderGateway().future(),DEADLINE.timeLeft()); >>> Future savepointResultFuture = jobManager.ask(new JobManagerMessages.TriggerSavepoint( >>> jobId, Option.empty()),DEADLINE.timeLeft() >>> ); >>> Object savepointResult = Await.result(savepointResultFuture,DEADLINE.timeLeft()); >>> Afterwards, if failures haven’t been detected I cancels my job and >>> shutdowns cluster. >>> >>> I found, that checkpoint method *notifyCheckpointComplete* not >>> always called, before the *savepointResult* is ready. So the part of >>> my logic, that lives in implementation of this method doesn’t work >>> and test fails. >>> >>> So could you or someone explain, does *Flink* guaranties, that >>> *notifyCheckpointComplete* method will be called before >>> *savepointResult * will become accessable. >>> For me, it’s rather strange behaviour and I think that I’m doing >>> something wrong. >>> >>> Thx. >>> >>>> On 1 Nov 2017, at 14:26, Chesnay Schepler >>> > wrote: >>>> >>>> You could trigger a savepoint, which from the viewpoint of >>>> sources/operators/sinks is the same thing as a checkpoint. >>>> >>>> How to do this depends a bit on how your test case is written, but >>>> you can take a look at the >>>> SavepointMigrationTestBase#executeAndSavepoint which is all about >>>> running josb and triggering >>>> savepoints once certain conditions have been met. >>>> >>>> On 30.10.2017 16:01, Rinat wrote: >>>>> Hi guys, I’ve got a question about working with checkpointing. >>>>> I would like to implement IT test, where source is a fixed >>>>> collection of items and sink performs additional logic, when >>>>> checkpointing is completed. >>>>> >>>>> I would like to force executing checkpointing, when all messages >>>>> from my test source were sent and processed by sink. >>>>> Please tell me, whether such logic could be performed or not, and how. >>>>> >>>>> Thx ! >>>> >>>> >>> >> > --------------8F497BCF83B7B5231E49D67E Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit
hmm. While there is technically no guarantee that notifyCheckpointComplete is called, it virtually always is,
especially in local setups.

Is it possible for you to share more code (or all of it)? (you can also send it to me directly)

On 07.11.2017 11:58, Rinat wrote:
Yes, but  notifyCheckpointComplete callback doesn’t called on await completion, I do the same, as in specified test template :

        ActorGateway jobManager = (ActorGateway) Await.result(cluster.leaderGateway().future(), DEADLINE.timeLeft());
        Future<Object> savepointResultFuture = jobManager.ask(new JobManagerMessages.TriggerSavepoint(
            jobId, Option.<String>empty()), DEADLINE.timeLeft()
        );
        while(!savepointResultFuture.isCompleted()) {
            System.out.println();
        }
        Object savepointResult = Await.result(savepointResultFuture, DEADLINE.timeLeft());

        if (savepointResult instanceof JobManagerMessages.TriggerSavepointFailure) {
            throw new RuntimeException(String.format("Something went wrong while executing savepoint, [message=%s]",
                ((JobManagerMessages.TriggerSavepointFailure) savepointResult).cause()
            ));
        }

Thx

On 7 Nov 2017, at 13:54, Chesnay Schepler <chesnay@apache.org> wrote:

Do you verify that savepointResult is a JobManagerMessages.TriggerSavepointSuccess? It could also be JobManagerMessages.TriggerSavepointFailure. (instanceof check)

On 02.11.2017 19:11, Rinat wrote:
Chesnay, thanks for your reply, it was very helpful, but I took logic from this test template and tried to reuse it in my IT case, but found one more issue.
I’ve registered an accumulator in my source function, and for it’s value, as specified in the specified example.
When accumulator has an expected value, I perform a savepoint and wait for it’s completion using the further code

ActorGateway jobManager = (ActorGateway) Await.result(cluster.leaderGateway().future(), DEADLINE.timeLeft());
Future<Object> savepointResultFuture = jobManager.ask(new JobManagerMessages.TriggerSavepoint(
    jobId, Option.<String>empty()), DEADLINE.timeLeft()
);
Object savepointResult = Await.result(savepointResultFuture, DEADLINE.timeLeft());
Afterwards, if failures haven’t been detected I cancels my job and shutdowns cluster.

I found, that checkpoint method notifyCheckpointComplete not always called, before the savepointResult is ready. So the part of my logic, that lives in implementation of this method doesn’t work and test fails.

So could you or someone explain, does Flink guaranties, that notifyCheckpointComplete method will be called before savepointResult  will become accessable.
For me, it’s rather strange behaviour and I think that I’m doing something wrong.

Thx.

On 1 Nov 2017, at 14:26, Chesnay Schepler <chesnay@apache.org> wrote:

You could trigger a savepoint, which from the viewpoint of sources/operators/sinks is the same thing as a checkpoint.

How to do this depends a bit on how your test case is written, but you can take a look at the SavepointMigrationTestBase#executeAndSavepoint which is all about running josb and triggering
savepoints once certain conditions have been met.

On 30.10.2017 16:01, Rinat wrote:
Hi guys, I’ve got a question about working with checkpointing.
I would like to implement IT test, where source is a fixed collection of items and sink performs additional logic, when checkpointing is completed.

I would like to force executing checkpointing, when all messages from my test source were sent and processed by sink.
Please tell me, whether such logic could be performed or not, and how.

Thx !






--------------8F497BCF83B7B5231E49D67E--