Thursday, July 5, 2012

Developers Do the Darndest Things - Episode 1

We had an issue today where some code went crazy and started slamming one of engines with new connection requests, which led to all kinds of fun problems with dynamically allocated shared memory segments, out of memory problems and eventually an engine reboot.

I was taking a look at the code for the application to try and figure out what went wrong and I saw something like the following. It wasn't the cause of the problem, but I don't think it helped.

   for i = 0; i < 5; i++:
      ret = connect_to_database();

      if ret = SUCCESS:

   if ret != SUCCESS:
      print "unable to connect to database"

Well, it was something like that. Basically try to connect to the database and retry a few times before giving up and throwing some kind of error.

So, what's the big deal? It looks reasonable enough. In my opinion there really isn't much use in retrying the connection attempt in a loop like this unless you're going to go to sleep in between attempts.

Look at what happens, you just got told your attempt to connect failed. What are the chances the problem is resolved a nanosecond later when you loop back and try to connect again? Almost zero. All you've done is throw an additional 4 connection requests at the engine while it is having some kind of a problem, possibly making the problem worse (especially if you have multiple apps/clients doing the same thing).

I realize you can't sleep forever, but sleeping here for even 1 second would have spread the 5 connection attempts over 5 seconds instead of 5 nanoseconds and has a much better chance of actually doing what it was intended to do by recovering gracefully from an intermittent DB problem rather than causing more problems.

Ugh. Thanks for the Bad News, Kernoal

Kernoal Stevens commented on another blog post that in the later versions of Innovator-C not only do we have the new 1 core limit, but Innovator-C will no longer support ER or HDR.

What a bummer, here is the README from the Innovator-C download page that confirms this new limitation:
Changes to Replication in Informix 11.70.xC5 Innovator-C edition

For 11.70.xC5, Informix Innovator-C edition no longer supports Enterprise Replication (ER) or High-availability data replication (HDR). If you were using replication in an older version of Innovator-C, you must disable replication after upgrading to 11.70.xC5.

If you want to continue using replication in Informix 11.70.xC5, you can purchase the Choice, Growth or Ultimate edition. 

Removing Enterprise Replication 

If Enterprise Replication was defined for the previous version of the server, remove replication by running the following command:  

cdr delete server  --force

Removing HDR

If  High-availability data replication was defined for the previous version of the server, convert the server to a standard server by running the following command:

onmode -d standard
This just makes me sad. I understand that IBM needs to make a profit and to do that they can't be giving away everything for free. I get that, I really do, but HDR was the kind of feature that made Innovator-C stand out when compared to other free RDBMS options and now it is gone. Oh well, thanks for the free parking while it lasted.

Ace Ventura - The Monopoly Guy
You must be the Monopoly Guy

Monday, July 2, 2012

IIUG Insider Issue #144 - June 2012

If you don't get the IIUG Insider delivered directly to your inbox, you may not be aware that June Insider has just been published.

Here is the editorial, which I always find interesting and sometimes harsh, but fair.