wilson_smyth
wilson_smyth

Reputation: 1516

azure durable function saving the same data multiple times/duplicating data

Im converting a long running azure function to durable functions. The workflow is as follows:

We have 40,000 users, but when the process completes, there are 70,000+ records saved, many of which are duplicates.

Questions

Update: I can see in the output that one of the durable functions is being executed 5 times, even though i only call it once. i have no idea why this is.

Update2:

Ive stepped through saving the first page of data. the code only executes once, but the data is stored twice!

Does azure functions spin up multiple instances or have some scaling that could cause this to happen?

enter image description here

Upvotes: 1

Views: 1137

Answers (1)

Marc
Marc

Reputation: 1898

Hard to tell without seeing the orchestrator function code.

The orchestrator function code should be deterministic as explained in these docs. Perhaps this is not the case and the GetUsersFromAD activity gets called with different input arguments each time the orchestrator function replays?

Debugging an orchestrator function can be confusing due to the replay nature. If you want more info on how Durable Functions work (incl the checkpointing & replay) this video can help.

Upvotes: 0

Related Questions