You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by Phil Stavridis <ph...@gmail.com> on 2024/05/17 18:37:42 UTC

Restore from checkpoint

Hi,

I am trying to test how the checkpoints work for restoring state, but not sure how to run a new instance of a flink job, after I have cancelled it, using the checkpoints which I store in the filesystem of the job manager, e.g. /opt/flink/checkpoints.

I have tried passing the checkpoint as an argument in the function and use it while setting the checkpoint but it looks like the way it is done is something like below:


docker-compose exec jobmanager flink run -s :/opt/flink/checkpoints/1875588e19b1d8709ee62be1cdcc -py /opt/app/flink_job.py

But I am getting error:
Caused by: java.io.IOException: Checkpoint/savepoint path ':/opt/flink/checkpoints/1875588e19b1d8709ee62be1cdcc' is not a valid file URI. Either the pointer path is invalid, or the checkpoint was created by a different state backend.

What is wrong with the  way the job is re-submitted to the cluster? 

Kind regards
Phil

Re: Restore from checkpoint

Posted by Jinzhong Li <li...@gmail.com>.
Hi Phil,

I think you can use the "-s :checkpointMetaDataPath" arg  to resume the job
from a retained checkpoint[1].

[1]
https://nightlies.apache.org/flink/flink-docs-master/docs/ops/state/checkpoints/#resuming-from-a-retained-checkpoint

Best,
Jinzhong Li


On Mon, May 20, 2024 at 2:29 AM Phil Stavridis <ph...@gmail.com> wrote:

> Hi Lu,
>
> Thanks for your reply. In what way are the paths to get passed to the job
> that needs to used the checkpoint? Is the standard way, using -s :/<path>
> or by passing the path in the module as a Python arg?
>
> Kind regards
> Phil
>
> > On 18 May 2024, at 03:19, jiadong.lu <ar...@gmail.com> wrote:
> >
> > Hi Phil,
> >
> > AFAIK, the error indicated your path was incorrect.
> > your should use '/opt/flink/checkpoints/1875588e19b1d8709ee62be1cdcc' or
> 'file:///opt/flink/checkpoints/1875588e19b1d8709ee62be1cdcc' instead.
> >
> > Best.
> > Jiadong.Lu
> >
> > On 5/18/24 2:37 AM, Phil Stavridis wrote:
> >> Hi,
> >> I am trying to test how the checkpoints work for restoring state, but
> not sure how to run a new instance of a flink job, after I have cancelled
> it, using the checkpoints which I store in the filesystem of the job
> manager, e.g. /opt/flink/checkpoints.
> >> I have tried passing the checkpoint as an argument in the function and
> use it while setting the checkpoint but it looks like the way it is done is
> something like below:
> >> docker-compose exec jobmanager flink run -s
> :/opt/flink/checkpoints/1875588e19b1d8709ee62be1cdcc -py
> /opt/app/flink_job.py
> >> But I am getting error:
> >> Caused by: java.io.IOException: Checkpoint/savepoint path
> ':/opt/flink/checkpoints/1875588e19b1d8709ee62be1cdcc' is not a valid file
> URI. Either the pointer path is invalid, or the checkpoint was created by a
> different state backend.
> >> What is wrong with the  way the job is re-submitted to the cluster?
> >> Kind regards
> >> Phil
>
>

Re: Restore from checkpoint

Posted by archzi lu <ar...@gmail.com>.
Hi Phil,
correction: But the error
you have is a familiar error if you have written some code to handle
directory path.  --> But the error
you have is a familiar error if you have written some code to handle
directory path with Java.

No offence.

Best regards.
Jiadong. Lu

Jiadong Lu <ar...@gmail.com> 于2024年5月20日周一 14:42写道:
>
> Hi, Phil
>
> I don't have more expertise about the flink-python module. But the error
> you have is a familiar error if you have written some code to handle
> directory path.
>
> The correct form of Path/URI will be :
> 1. "/home/foo"
> 2. "file:///home/foo/boo"
> 3. "hdfs:///home/foo/boo"
> 4. or Win32 directory form
>
> Best regards,
> Jiadong Lu
>
> On 2024/5/20 02:28, Phil Stavridis wrote:
> > Hi Lu,
> >
> > Thanks for your reply. In what way are the paths to get passed to the job that needs to used the checkpoint? Is the standard way, using -s :/<path> or by passing the path in the module as a Python arg?
> >
> > Kind regards
> > Phil
> >
> >> On 18 May 2024, at 03:19, jiadong.lu <ar...@gmail.com> wrote:
> >>
> >> Hi Phil,
> >>
> >> AFAIK, the error indicated your path was incorrect.
> >> your should use '/opt/flink/checkpoints/1875588e19b1d8709ee62be1cdcc' or 'file:///opt/flink/checkpoints/1875588e19b1d8709ee62be1cdcc' instead.
> >>
> >> Best.
> >> Jiadong.Lu
> >>
> >> On 5/18/24 2:37 AM, Phil Stavridis wrote:
> >>> Hi,
> >>> I am trying to test how the checkpoints work for restoring state, but not sure how to run a new instance of a flink job, after I have cancelled it, using the checkpoints which I store in the filesystem of the job manager, e.g. /opt/flink/checkpoints.
> >>> I have tried passing the checkpoint as an argument in the function and use it while setting the checkpoint but it looks like the way it is done is something like below:
> >>> docker-compose exec jobmanager flink run -s :/opt/flink/checkpoints/1875588e19b1d8709ee62be1cdcc -py /opt/app/flink_job.py
> >>> But I am getting error:
> >>> Caused by: java.io.IOException: Checkpoint/savepoint path ':/opt/flink/checkpoints/1875588e19b1d8709ee62be1cdcc' is not a valid file URI. Either the pointer path is invalid, or the checkpoint was created by a different state backend.
> >>> What is wrong with the  way the job is re-submitted to the cluster?
> >>> Kind regards
> >>> Phil
> >

Re: Restore from checkpoint

Posted by Jiadong Lu <ar...@gmail.com>.
Hi, Phil

I don't have more expertise about the flink-python module. But the error 
you have is a familiar error if you have written some code to handle 
directory path.

The correct form of Path/URI will be :
1. "/home/foo"
2. "file:///home/foo/boo"
3. "hdfs:///home/foo/boo"
4. or Win32 directory form

Best regards,
Jiadong Lu

On 2024/5/20 02:28, Phil Stavridis wrote:
> Hi Lu,
> 
> Thanks for your reply. In what way are the paths to get passed to the job that needs to used the checkpoint? Is the standard way, using -s :/<path> or by passing the path in the module as a Python arg?
> 
> Kind regards
> Phil
> 
>> On 18 May 2024, at 03:19, jiadong.lu <ar...@gmail.com> wrote:
>>
>> Hi Phil,
>>
>> AFAIK, the error indicated your path was incorrect.
>> your should use '/opt/flink/checkpoints/1875588e19b1d8709ee62be1cdcc' or 'file:///opt/flink/checkpoints/1875588e19b1d8709ee62be1cdcc' instead.
>>
>> Best.
>> Jiadong.Lu
>>
>> On 5/18/24 2:37 AM, Phil Stavridis wrote:
>>> Hi,
>>> I am trying to test how the checkpoints work for restoring state, but not sure how to run a new instance of a flink job, after I have cancelled it, using the checkpoints which I store in the filesystem of the job manager, e.g. /opt/flink/checkpoints.
>>> I have tried passing the checkpoint as an argument in the function and use it while setting the checkpoint but it looks like the way it is done is something like below:
>>> docker-compose exec jobmanager flink run -s :/opt/flink/checkpoints/1875588e19b1d8709ee62be1cdcc -py /opt/app/flink_job.py
>>> But I am getting error:
>>> Caused by: java.io.IOException: Checkpoint/savepoint path ':/opt/flink/checkpoints/1875588e19b1d8709ee62be1cdcc' is not a valid file URI. Either the pointer path is invalid, or the checkpoint was created by a different state backend.
>>> What is wrong with the  way the job is re-submitted to the cluster?
>>> Kind regards
>>> Phil
> 

Re: Restore from checkpoint

Posted by Phil Stavridis <ph...@gmail.com>.
Hi Lu,

Thanks for your reply. In what way are the paths to get passed to the job that needs to used the checkpoint? Is the standard way, using -s :/<path> or by passing the path in the module as a Python arg?

Kind regards
Phil

> On 18 May 2024, at 03:19, jiadong.lu <ar...@gmail.com> wrote:
> 
> Hi Phil,
> 
> AFAIK, the error indicated your path was incorrect.
> your should use '/opt/flink/checkpoints/1875588e19b1d8709ee62be1cdcc' or 'file:///opt/flink/checkpoints/1875588e19b1d8709ee62be1cdcc' instead.
> 
> Best.
> Jiadong.Lu
> 
> On 5/18/24 2:37 AM, Phil Stavridis wrote:
>> Hi,
>> I am trying to test how the checkpoints work for restoring state, but not sure how to run a new instance of a flink job, after I have cancelled it, using the checkpoints which I store in the filesystem of the job manager, e.g. /opt/flink/checkpoints.
>> I have tried passing the checkpoint as an argument in the function and use it while setting the checkpoint but it looks like the way it is done is something like below:
>> docker-compose exec jobmanager flink run -s :/opt/flink/checkpoints/1875588e19b1d8709ee62be1cdcc -py /opt/app/flink_job.py
>> But I am getting error:
>> Caused by: java.io.IOException: Checkpoint/savepoint path ':/opt/flink/checkpoints/1875588e19b1d8709ee62be1cdcc' is not a valid file URI. Either the pointer path is invalid, or the checkpoint was created by a different state backend.
>> What is wrong with the  way the job is re-submitted to the cluster?
>> Kind regards
>> Phil


Re: Restore from checkpoint

Posted by "jiadong.lu" <ar...@gmail.com>.
Hi Phil,

AFAIK, the error indicated your path was incorrect.
your should use '/opt/flink/checkpoints/1875588e19b1d8709ee62be1cdcc' or 
'file:///opt/flink/checkpoints/1875588e19b1d8709ee62be1cdcc' instead.

Best.
Jiadong.Lu

On 5/18/24 2:37 AM, Phil Stavridis wrote:
> Hi,
> 
> I am trying to test how the checkpoints work for restoring state, but not sure how to run a new instance of a flink job, after I have cancelled it, using the checkpoints which I store in the filesystem of the job manager, e.g. /opt/flink/checkpoints.
> 
> I have tried passing the checkpoint as an argument in the function and use it while setting the checkpoint but it looks like the way it is done is something like below:
> 
> 
> docker-compose exec jobmanager flink run -s :/opt/flink/checkpoints/1875588e19b1d8709ee62be1cdcc -py /opt/app/flink_job.py
> 
> But I am getting error:
> Caused by: java.io.IOException: Checkpoint/savepoint path ':/opt/flink/checkpoints/1875588e19b1d8709ee62be1cdcc' is not a valid file URI. Either the pointer path is invalid, or the checkpoint was created by a different state backend.
> 
> What is wrong with the  way the job is re-submitted to the cluster?
> 
> Kind regards
> Phil