K2.NET 2003 processes start on random versions
When using K2.NET 2003 in a load balanced environment, you may notice that new processes start on versions other than the latest to be exported using K2 Studio.
K2.NET 2003, Load Balancing, NLB, Process Version. Little admission; I think this is on K2.NET 2003 SP1a, but I'm not sure... and I don't know if it's resolved yet, but I doubt it.
It seems that there is an issue in the K2 application server, in that the definition of the latest process version is cached on each server in the load balanced set. Then, when a process instance is created on each server, the latest cached version on that server is used to define it. The problem appears to be that when you export to K2 using K2 Studio, only a single member server of the load balanced set receives the export. This server correctly stashes the definition in the database, but the other member servers fail to notice that a new version is available, and continue with the previous definition. Left unchecked this could go on for a while, and all sorts of odd combinations of running instances can spread throughout your application.
The simplest way to spot this is to write your own tool to interrogate K2. I wrote a utility using the K2ROM to list all Process Sets, all Process Versions under each set, and all running Process Instances on each version. This is actually quite trivial to do with the K2ROM. What you will notice is that some instances will have a Start Date that is later than the Exported Date of the latest Process Version for that Process Set. Obviously if you are using K2 in the normal manner (i.e. you haven't set an alternative default version) then this makes no sense - once an updated version has been exported all process instances started afterwards should be running on it.
* if some of these phrases (Process Set, Version, etc) are not familiar to you, they will be by the time you've mucked around in the K2ROM a little, so have a dig and all will become clear.
Nice and simple (although by no means ideal) - after every export to K2, restart the K2Server service on each load balanced server. You can of course take each of them out of the balanced set, cycle the service, and put it back in before moving onto the next server to minimise disruption if you cannot have any downtime.Enjoy!