Recently, we have encountered with a deadlock issues regarding the GeoIp. Since this part wasn’t in use, it was decided that it needs to be shut down.
Exception: System.ExceptionMessage: Transaction (Process ID 56) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
at Sitecore.Data.DataProviders.Sql.DataProviderReader..ctor(DataProviderCommand command)
at Sitecore.Data.DataProviders.NullRetryer.Execute[T](Func`1 action, Action recover)
at Sitecore.Data.DataProviders.Sql.SqlDataApi.CreateReader(String sql, Object parameters)
at Sitecore.Analytics.Data.DataAccess.DataAdapters.SqlBase.ReadMany(DataSourceQuery query, Action1 handler)
at Sitecore.Support.Analytics.TunedVisitEndWorker.LightVisit.LoadExpiredVisits(String connection, List1 expiredVisits)
Exception: System.Data.DataException Message: Error executing SQL command: UPDATE TOP (@maxEntries) [Visits] SET [State] = 255, [StateChanged] = @now WHERE ([State] = 0 OR ([State] = 2 AND DateDiff(second, [StateChanged], @now) >= @completeTimeout)) AND DateDiff(second, [EndDateTime], @now) >= @sessionDurationWithDebt; SELECT [VisitId],[VisitorId] FROM [Visits] WHERE [STATE] = 255; UPDATE [Visits] SET [State] = 2 WHERE [State] = 255
In order to shut it down the following steps were provided:
<setting name=”Analytics.PerformLookup” value=”false” />
Removal of the following configs
but deadlocks continued to appear. Next step was to inspect Sitecore.Analytics.config. There were 2 processors which were triggering GeoIp:
<processor type=“Sitecore.Analytics.Pipelines.StartTracking.UpdateGeoIpData,Sitecore.Analytics” /> <processor type=“Sitecore.Analytics.Pipelines.CreateVisits.UpdateGeoIpData,Sitecore.Analytics” />
The solution was to remove them as well. After testing, the deadlocks were gone.