【问题标题】:RavenDb: Document Refresh feature does not run at nor after the specified time by @refresh flagRavenDb:文档刷新功能不会在@refresh 标志指定的时间或之后运行
【发布时间】:2021-04-30 07:58:17
【问题描述】:

我需要在一段时间后将文档标记为过期,因此我尝试使用 @refresh 功能重新运行订阅并计算我的“过期”标志。我知道有“文档过期”功能,但这个功能会删除我不想要的数据。

我在设置中启用了刷新功能,并在所需文档的元数据中添加了@refresh UTC 日期时间。例如我手动添加了这个文档:

{
    "Name": "My data",
    "@metadata": {
        "@collection": "Testing",
        "@refresh": "2021-04-30T07:41:35.4845961Z"
    }
}

看起来我正面临不确定的行为 - 有时刷新有时不处理。我尝试了不同的时间组合,并通过代码或 Raven Studio 进行设置。

Refresh interval is set to refresh but still says "in less than a minute"

我正在使用

  • 社区许可证(此处未提及文档刷新,但我没有看到任何其他许可证也提及) community license extensions
  • 尝试了更多版本的 RavenDB,结果相同(5.1.7. 看起来更有希望,因为它工作了一段时间,但一段时间后停止了):
    • Windows 10 上 Docker 中的 4.2.111 服务器/工作室版本
    • 5.1.7 服务器/工作室版
  • C# RavenDB.Client 5.1.6

未在错误跟踪器中找到相关问题 https://issues.hibernatingrhinos.com/issues/RavenDB?q=document%20refresh

任何想法要检查什么或可能是什么情况?


编辑:登录到控制台后,我发现了一些错误日志。好像

 RavendbProject, Raven.Server.Documents.Expiration.ExpiredDocumentsCleaner, Failed to refresh documents on RavendbProject which are older than 05/17/2021 09:48:47, EXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object.

RavendbProject |    at Sparrow.Server.ByteStringContext`1.From(String value, ByteStringType type, ByteString& str) in C:\Builds\RavenDB-Stable-5.1\51024\src\Sparrow.Server\ByteString.cs:line 1297

RavendbProject |    at Raven.Server.Documents.DocumentPutAction.PutDocument(DocumentsOperationContext context, String id, String expectedChangeVector, BlittableJsonReaderObject document, Nullable`1 lastModifiedTicks, String changeVector, DocumentFlags flags, NonPersistentDocumentFlags nonPersistentFlags) in C:\Builds\RavenDB-Stable-5.1\51024\src\Raven.Server\Documents\DocumentPutAction.cs:line 190

另外值得一提的是,我的文档存储在 ClusterWide 事务中,因此我可以在我的一个文档中看到相应的标志:

"@flags": "FromClusterTransaction",

我目前的怀疑是其中一个文档可能会阻止其他文档被刷新。删除集群事务文档后,集合中的其他文档被刷新

【问题讨论】:

    标签: ravendb ravendb-studio


    【解决方案1】:

    与通过集群事务添加的文档相关的错误,目前的解决方法是不使用集群事务。

    我在错误跟踪器上打开了一个问题, https://issues.hibernatingrhinos.com/issue/RavenDB-16710

    【讨论】:

      猜你喜欢
      • 2023-04-05
      • 2013-05-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多