Azure Function CosmosDB触发器未捕获一个分区中的更改。

huangapple go评论47阅读模式
英文:

Azure Function CosmosDB Trigger does not pick-up the changes in one partition

问题

我遇到了Azure Function v4与cosmos DB触发器的问题。函数无法捕捉特定分区值的更改,但在其他分区值上仍正常运行。在函数日志中找不到函数运行更改的迹象。

只有在重新启动函数后才解决了这个问题,然后才能捕捉到该分区的更改。有人知道这个问题的根本原因吗?我尝试搜索Microsoft文档,但迄今为止还没有找到任何信息。

英文:

I'm facing a problem with the Azure Function v4 with the cosmos DB trigger. The function doesn't pick up the changes on a specific Partition value, however still running properly in other partition value. There is no sign of function running that change in the function log.

It's only resolved after I restart the function, then the changes on that partition have been pick up. Does anyone know the root cause of this? I'm trying to search through Microsoft document but have not found anything so far.

答案1

得分: 2

参考链接:https://learn.microsoft.com/azure/cosmos-db/nosql/troubleshoot-changefeed-functions#some-changes-are-missing-in-your-trigger

首先启用 日志Debug 级别的日志包括哪个函数应用实例正在获取哪个租约。通常,这可能是另一个函数应用“窃取”租约(您部署了两个或更多函数应用,使用相同的租约配置运行),或者存在运行时问题,该分区/租约被获取、处理失败,然后被释放。

可以在日志中看到这一点,启用 Warning 级别即可。

英文:

Reference: https://learn.microsoft.com/azure/cosmos-db/nosql/troubleshoot-changefeed-functions#some-changes-are-missing-in-your-trigger

Start by enabling logs, Debug level logs include which Function App instance is acquiring which lease. Most commonly this is either due to another Function App "stealing" leases (you have 2 or more Function Apps deployed or running with the same Lease configuration) or there is a runtime problem and that partition/lease being acquired, failed processing, and being released.

That can be seen on the logs, with Warning level enabled.

huangapple
  • 本文由 发表于 2023年4月17日 21:59:14
  • 转载请务必保留本文链接:https://go.coder-hub.com/76035983.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定