You try to install cumulative updates for SharePoint 2010 and 2013, and you encounter this error:
An exception of type Microsoft.SharePoint.Administration.SPUpdatedConcurrencyException was thrown. Additional exception information: An update conflict has occurred, and you must re-try this action. The object SPUpgradeSession Name=Upgrade-DATE-TIME-RAND was updated by DOMAIN\user, in the PSCONFIG (PID) process, on machine MACHINENAME. View the tracing log for more information about the conflict.
This exception can be caused by a race condition (at least two threads access shared data and try to change it concurrently) when Psconfig tries to update sites, tables, or databases. This scenario is a rare occurrence during a SharePoint upgrade.
Use the following PowerShell script to open Psconfig with single processor affinity to force the utility to run one update at a time:
$cmd="start "+""""" /affinity 1 "+"""C:\Program Files\Common Files\microsoft shared\Web Server Extensions\14\BIN\Psconfig.exe""" + " -cmd" + " upgrade" + " -inplace" + " b2b" + " -wait"
cmd.exe /c $cmd
$cmd="start "+""""" /affinity 1 "+"""C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\BIN\Psconfig.exe""" + " -cmd" + " upgrade" + " -inplace" + " b2b" + " -wait"
cmd.exe /c $cmd
To verify that this process opened by using single core affinity only, follow these steps:
1. Open the Task Manager
2. See details
3. Locate the running process for Psconfig
4. Right-click the process and select Set Affinity: you should see only CPU 0 selected
5. Let the Psconfig process complete
The workaround script configures single core affinity without using the -force parameter. This -force parameter ignores errors or skips steps that are required for SharePoint upgrades to be installed. In this scenario, two processes try to use the same resources while they are running on different server cores. Configuring for single core affinity prevents these processes from using mutual resources.