Cosmos Db change feed data duplicate issue

%3CLINGO-SUB%20id%3D%22lingo-sub-2451719%22%20slang%3D%22en-US%22%3ECosmos%20Db%20change%20feed%20data%20duplicate%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2451719%22%20slang%3D%22en-US%22%3E%3CP%3E%26nbsp%3BI%20am%20working%20with%20Azure%20function%20where%20cosmosdb%20trigger%20is%20being%20used%20to%20track%20changes%20against%20an%26nbsp%3B%20orderId.%20But%20i%20am%20seeing%20azure%20function%20is%20picking%20the%20same%20changeid(logging%20the%20changeid%20coming%20from%20changefeed%20in%20azure%20function)%20for%20the%20same%20order.%20It%20is%20creating%20duplicate%20data%20in%20downstream.%3C%2FP%3E%3CP%3ECan%20anyone%20help%20us%20to%20sort%20this%20out.%3C%2FP%3E%3CP%3EThe%20reason%20for%20invoking%20the%20same%20changeid%20for%20the%20same%20orderId%3C%2FP%3E%3CP%3Ein%20below%20link%20i%20am%20seeing%20there%20might%20be%20duplicate%20read%20for%20%22%3CSTRONG%3EEventual%20consistency%3C%2FSTRONG%3E%22%20level.%3C%2FP%3E%3CP%3EConsistency%20level%3C%2FP%3E%3CP%3EWhile%20consuming%20the%20change%20feed%20in%20an%20Eventual%20consistency%20level%2C%20there%20could%20be%20duplicate%20events%20in-between%20subsequent%20change%20feed%20read%20operations%20(%3CFONT%20color%3D%22%23FF0000%22%3E%3CSTRONG%3Ethe%20last%20event%20of%20one%20read%20operation%20appears%20as%20the%20first%20of%20the%20next%3C%2FSTRONG%3E%3C%2FFONT%3E).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fcosmos-db%2Fchange-feed%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fcosmos-db%2Fchange-feed%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Frequent Visitor

 I am working with Azure function where cosmosdb trigger is being used to track changes against an  orderId. But i am seeing azure function is picking the same changeid(logging the changeid coming from changefeed in azure function) for the same order. It is creating duplicate data in downstream.

Can anyone help us to sort this out.

The reason for invoking the same changeid for the same orderId

in below link i am seeing there might be duplicate read for "Eventual consistency" level.

Consistency level

While consuming the change feed in an Eventual consistency level, there could be duplicate events in-between subsequent change feed read operations (the last event of one read operation appears as the first of the next).

 

https://docs.microsoft.com/en-us/azure/cosmos-db/change-feed

0 Replies