microsoft / service-fabric

Service Fabric is a distributed systems platform for packaging, deploying, and managing stateless and stateful distributed applications and containers at large scale.
https://docs.microsoft.com/en-us/azure/service-fabric/
MIT License
3.02k stars 399 forks source link

Service Fabric Stateful application crash - Current and the version acquired must be same. #813

Closed somesh84 closed 4 years ago

somesh84 commented 6 years ago

Errormsg=Current and the version acquired must be same. Assert=System.Exception: at System.Environment.GetStackTrace(Exception e, Boolean needFileInfo) at System.Environment.get_StackTrace() at System.Fabric.Store.Diagnostics.InternalAssert(Boolean condition, String traceTypeSuffix, String message) at System.Fabric.Store.ConsolidationManager5.<ConsolidateAsync>d__15.MoveNext() at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.Start[TStateMachine](TStateMachine& stateMachine) at System.Fabric.Store.ConsolidationManager5.ConsolidateAsync(String traceType, MetadataTable metadataTable, CancellationToken cancellationToken) at System.Fabric.Store.TStore5.d281.MoveNext() at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine) at System.Fabric.Store.TStore5.ConsolidateAndSetNextMetadataTable(MetadataTable tempMetadataTable, Boolean consolidate) at System.Fabric.Store.TStore5.d280.MoveNext() at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.Run() at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(Action action, Boolean allowInlining, Task& currentTask) at System.Threading.Tasks.Task.FinishContinuations() at System.Threading.Tasks.Task1.TrySetResult(TResult result) at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.SetResult(TResult result) at System.Fabric.Store.CheckpointFile.d242.MoveNext() at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.Run() at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(Action action, Boolean allowInlining, Task& currentTask) at System.Threading.Tasks.Task.FinishContinuations() at System.Threading.Tasks.Task1.TrySetResult(TResult result) at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.SetResult(TResult result) at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.SetResult(Task1 completedTask) at System.Fabric.Store.BlockAlignedWriter2.d17.MoveNext() at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.Run() at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(Action action, Boolean allowInlining, Task& currentTask) at System.Threading.Tasks.Task.FinishContinuations() at System.Threading.Tasks.Task1.TrySetResult(TResult result) at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.SetResult(TResult result) at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.SetResult(Task1 completedTask) at System.Fabric.Store.ValueBlockAlignedWriter2.<FlushAsync>d__9.MoveNext() at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.Run() at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(Action action, Boolean allowInlining, Task& currentTask) at System.Threading.Tasks.Task.FinishContinuations() at System.Threading.Tasks.Task1.TrySetResult(TResult result) at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.SetResult(TResult result) at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.SetResult(Task`1 completedTask) at System.Fabric.Store.ValueCheckpointFile.d__22.MoveNext() at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.Run() at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(Action action, Boolean allowInlining, Task& currentTask) at System.Threading.Tasks.Task.FinishContinuations() at System.Threading.Tasks.Task.Finish(Boolean bUserDelegateExecuted) at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot) at System.Threading.Tasks.Task.ExecuteEntry(Boolean bPreventDoubleExecution) at System.Threading.ThreadPoolWorkQueue.Dispatch() at Time=‎2018‎-‎03‎-‎02T03:45:09.320833300Z

somesh84 commented 6 years ago

Please refer to issue https://github.com/Azure/service-fabric-issues/issues/894 for code

mcoskun commented 6 years ago

Hi @somesh84 . Are you using primitive type TKey or a custom class type TKey in your IReliableDictionary<TKey, TValue>?

If you are using your custom class, a reason why you may run into this is, IComperable is not correctly implemented for your TKey. Specifically, if the CompareTo returns 0 (or Equals returns true) for two keys that are not logically same.

For example, if you have key of type "class MyKey { int a; int b;}" and the CompareTo function only compares a or b or compares both but not in a consistent order.

If you have verified that you are not using a custom type or your IComparable implementation is correct, you can create a support ticket using the following link: https://azure.microsoft.com/en-us/support/options/. This will allow us to take a look at the memory dump.

zuhairp commented 4 years ago

Closing due to inactivity