Skip to content

fix heartbeating in fakeProgress activity  #366

@ssrohit

Description

@ssrohit

What are you really trying to do?

When heartbeating after some task (that may be writing data in DB) in fakeProgress activity when there is a failure the activity retries from a previous successful progress which may lead to data inconsistency(when dealing with data insertion in DB).

Describe the bug

With the existing heartbeat in the fakeProgress activity it whem retried it have to perform an extra iteration, which when the heartbeat is sent immediately after entering the loop saves this extra iteration. When some data insertion is a step in this loop, this may lead to data duplication.

Minimal Reproduction

I have identified this issue on my personal project and this is quite self explanatory.
Example case:
when progress = 4
heartbeat details -> 3 (previous progress)
if activity fails at this progress it will be retried from the point where progress == 3, and the iteration with progress == 3 is a successful iteration which should not be the retrying point.
PR - #363

Environment/Versions

temporal sdk version - 1.9.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions