System.Fabric.FabricNotPrimaryException 在 Actor 内部的 GetStateAsync 上
System.Fabric.FabricNotPrimaryException on GetStateAsync inside Actor
我也在 Github 上问过这个问题 - https://github.com/Azure/service-fabric-issues/issues/379
我有 (n) 个 actor 每秒都在执行连续提醒。
这些参与者在过去 4 天里一直 运行 正常,但在调用 StateManager.GetStateAsync 时每个实例都收到以下异常。随后,我看到所有的演员都被停用了。
我找不到与可靠参与者遇到的此异常相关的任何信息。
一旦发生此异常并且参与者被停用,它们就不会被重新激活。
出现此错误的条件是什么?我该如何进一步诊断问题?
"System.Fabric.FabricNotPrimaryException: Exception of type 'System.Fabric.FabricNotPrimaryException' was thrown. at Microsoft.ServiceFabric.Actors.Runtime.ActorStateProviderHelper.d__81.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.ServiceFabric.Actors.Runtime.ActorStateManager.d__181.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.ServiceFabric.Actors.Runtime.ActorStateManager.d__7`1.MoveNext()
查看集群资源管理器,我现在可以在该参与者服务的一个分区上看到以下警告:
Unhealthy event: SourceId='System.FM', Property='State', HealthState='Warning', ConsiderWarningAsError=false.
Partition reconfiguration is taking longer than expected.
fabric:/Ism.TvcRecognition.App/TvChannelMonitor 3 3 4dcca5ee-2297-44f9-b63e-76a60df3bc3d
S/S IB _Node1_4 Up 131456742276273986
S/P RD _Node1_2 Up 131456742361691499
P/S RD _Node1_0 Down 131457861497316547
(Showing 3 out of 4 replicas. Total available replicas: 1.)
在该分区的主副本中出现警告:
Unhealthy event: SourceId='System.RAP', Property='IReplicator.CatchupReplicaSetDuration', HealthState='Warning', ConsiderWarningAsError=false.
并且在 ActiveSecondary 中出现警告:
Unhealthy event: SourceId='System.RAP', Property='IStatefulServiceReplica.CloseDuration', HealthState='Warning', ConsiderWarningAsError=false. Start Time (UTC): 2017-08-01 04:51:39.740 _Node1_0
5 个节点中有 3 个显示以下错误:
Unhealthy event: SourceId='FabricDCA', Property='DataCollectionAgent.DiskSpaceAvailable', HealthState='Warning', ConsiderWarningAsError=false. The Data Collection Agent (DCA) does not have enough disk space to operate. Diagnostics information will be left uncollected if this continues to happen.
更多信息:
我的集群设置包含 5 个 D1 虚拟机节点。
Microsoft-Service Fabric 应用程序中的事件查看器错误:
我看到了很多
Failed to read some or all of the events from ETL file D:\SvcFab\Log\QueryTraces\query_traces_5.6.231.9494_131460372168133038_1.etl.
System.ComponentModel.Win32Exception (0x80004005): The handle is invalid
at Tools.EtlReader.TraceFileEventReader.ReadEvents(DateTime startTime, DateTime endTime)
at System.Fabric.Dca.Utility.PerformWithRetries[T](Action`1 worker, T context, RetriableOperationExceptionHandler exceptionHandler, Int32 initialRetryIntervalMs, Int32 maxRetryCount, Int32 maxRetryIntervalMs)
at FabricDCA.EtlProcessor.ProcessActiveEtlFile(FileInfo etlFile, DateTime lastEndTime, DateTime& newEndTime, CancellationToken cancellationToken)
和一堆警告,例如:
Api IStatefulServiceReplica.Close() slow on partition {4dcca5ee-2297-44f9-b63e-76a60df3bc3d} replica 131457861497316547, StartTimeUTC = 2017-08-01T04:51:39.789083900Z
最后我想我可能是这一切的根源。事件查看器应用程序日志有一大堆错误,例如:
Ism.TvcRecognition.TvChannelMonitor (3688) (4dcca5ee-2297-44f9-b63e-76a60df3bc3d:131457861497316547): An attempt to write to the file "D:\SvcFab_App\Ism.TvcRecognition.AppType_App1\work\P_4dcca5ee-2297-44f9-b63e-76a60df3bc3d\R_131457861497316547\edbres00002.jrs" at offset 5242880 (0x0000000000500000) for 0 (0x00000000) bytes failed after 0.000 seconds with system error 112 (0x00000070): "There is not enough space on the disk. ". The write operation will fail with error -1808 (0xfffff8f0). If this error persists then the file may be damaged and may need to be restored from a previous backup.
好的,那个错误是指向D盘,也就是临时存储。它有 549 MB 免费 50 GB。
Service fabric 真的应该持久保存到 Temporary Storage 吗?
回复:错误 - 是的,看起来磁盘已满导致故障。只是为了关闭这里的循环 - 看起来你发现你的状态实际上并没有分布在集群中,一旦你修复了你就不再看到磁盘已满。您的容量规划现在应该更有意义了。
关于安全: TLDR:使用临时驱动器没问题,因为您使用的是 Service Fabric。如果您不是,那么使用该驱动器存储真实数据将是一个非常糟糕的主意。
从 Azure 的角度来看,这些驱动器 "temporary" 是机器上的本地驱动器。 Azure 不知道你在用这些驱动器做什么,它不希望任何单个机器应用程序认为写入那里的数据是安全的,因为 Azure 可能 Service heal 虚拟机响应一堆不同的事物。
在SF中我们将数据复制到多台机器上,所以使用本地磁盘是fine/safe。 SF 还与 Azure 集成,因此许多会破坏该数据的管理操作都在集群中进行管理,以防止这种情况发生。当 Azure 宣布它将进行更新以破坏该节点上的数据时,我们会在允许这种情况发生之前将您的服务转移到其他地方,并同时尝试停止更新。关于此的更多信息是 here.
我也在 Github 上问过这个问题 - https://github.com/Azure/service-fabric-issues/issues/379
我有 (n) 个 actor 每秒都在执行连续提醒。
这些参与者在过去 4 天里一直 运行 正常,但在调用 StateManager.GetStateAsync 时每个实例都收到以下异常。随后,我看到所有的演员都被停用了。
我找不到与可靠参与者遇到的此异常相关的任何信息。
一旦发生此异常并且参与者被停用,它们就不会被重新激活。
出现此错误的条件是什么?我该如何进一步诊断问题?
"System.Fabric.FabricNotPrimaryException: Exception of type 'System.Fabric.FabricNotPrimaryException' was thrown. at Microsoft.ServiceFabric.Actors.Runtime.ActorStateProviderHelper.d__81.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.ServiceFabric.Actors.Runtime.ActorStateManager.d__181.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.ServiceFabric.Actors.Runtime.ActorStateManager.d__7`1.MoveNext()
查看集群资源管理器,我现在可以在该参与者服务的一个分区上看到以下警告:
Unhealthy event: SourceId='System.FM', Property='State', HealthState='Warning', ConsiderWarningAsError=false. Partition reconfiguration is taking longer than expected. fabric:/Ism.TvcRecognition.App/TvChannelMonitor 3 3 4dcca5ee-2297-44f9-b63e-76a60df3bc3d S/S IB _Node1_4 Up 131456742276273986 S/P RD _Node1_2 Up 131456742361691499 P/S RD _Node1_0 Down 131457861497316547 (Showing 3 out of 4 replicas. Total available replicas: 1.)
在该分区的主副本中出现警告:
Unhealthy event: SourceId='System.RAP', Property='IReplicator.CatchupReplicaSetDuration', HealthState='Warning', ConsiderWarningAsError=false.
并且在 ActiveSecondary 中出现警告:
Unhealthy event: SourceId='System.RAP', Property='IStatefulServiceReplica.CloseDuration', HealthState='Warning', ConsiderWarningAsError=false. Start Time (UTC): 2017-08-01 04:51:39.740 _Node1_0
5 个节点中有 3 个显示以下错误:
Unhealthy event: SourceId='FabricDCA', Property='DataCollectionAgent.DiskSpaceAvailable', HealthState='Warning', ConsiderWarningAsError=false. The Data Collection Agent (DCA) does not have enough disk space to operate. Diagnostics information will be left uncollected if this continues to happen.
更多信息:
我的集群设置包含 5 个 D1 虚拟机节点。
Microsoft-Service Fabric 应用程序中的事件查看器错误:
我看到了很多
Failed to read some or all of the events from ETL file D:\SvcFab\Log\QueryTraces\query_traces_5.6.231.9494_131460372168133038_1.etl. System.ComponentModel.Win32Exception (0x80004005): The handle is invalid at Tools.EtlReader.TraceFileEventReader.ReadEvents(DateTime startTime, DateTime endTime) at System.Fabric.Dca.Utility.PerformWithRetries[T](Action`1 worker, T context, RetriableOperationExceptionHandler exceptionHandler, Int32 initialRetryIntervalMs, Int32 maxRetryCount, Int32 maxRetryIntervalMs) at FabricDCA.EtlProcessor.ProcessActiveEtlFile(FileInfo etlFile, DateTime lastEndTime, DateTime& newEndTime, CancellationToken cancellationToken)
和一堆警告,例如:
Api IStatefulServiceReplica.Close() slow on partition {4dcca5ee-2297-44f9-b63e-76a60df3bc3d} replica 131457861497316547, StartTimeUTC = 2017-08-01T04:51:39.789083900Z
最后我想我可能是这一切的根源。事件查看器应用程序日志有一大堆错误,例如:
Ism.TvcRecognition.TvChannelMonitor (3688) (4dcca5ee-2297-44f9-b63e-76a60df3bc3d:131457861497316547): An attempt to write to the file "D:\SvcFab_App\Ism.TvcRecognition.AppType_App1\work\P_4dcca5ee-2297-44f9-b63e-76a60df3bc3d\R_131457861497316547\edbres00002.jrs" at offset 5242880 (0x0000000000500000) for 0 (0x00000000) bytes failed after 0.000 seconds with system error 112 (0x00000070): "There is not enough space on the disk. ". The write operation will fail with error -1808 (0xfffff8f0). If this error persists then the file may be damaged and may need to be restored from a previous backup.
好的,那个错误是指向D盘,也就是临时存储。它有 549 MB 免费 50 GB。 Service fabric 真的应该持久保存到 Temporary Storage 吗?
回复:错误 - 是的,看起来磁盘已满导致故障。只是为了关闭这里的循环 - 看起来你发现你的状态实际上并没有分布在集群中,一旦你修复了你就不再看到磁盘已满。您的容量规划现在应该更有意义了。
关于安全: TLDR:使用临时驱动器没问题,因为您使用的是 Service Fabric。如果您不是,那么使用该驱动器存储真实数据将是一个非常糟糕的主意。
从 Azure 的角度来看,这些驱动器 "temporary" 是机器上的本地驱动器。 Azure 不知道你在用这些驱动器做什么,它不希望任何单个机器应用程序认为写入那里的数据是安全的,因为 Azure 可能 Service heal 虚拟机响应一堆不同的事物。
在SF中我们将数据复制到多台机器上,所以使用本地磁盘是fine/safe。 SF 还与 Azure 集成,因此许多会破坏该数据的管理操作都在集群中进行管理,以防止这种情况发生。当 Azure 宣布它将进行更新以破坏该节点上的数据时,我们会在允许这种情况发生之前将您的服务转移到其他地方,并同时尝试停止更新。关于此的更多信息是 here.