Thursday, December 4, 2008

Refactoring Foxhound: Always Watch For

In order to preserve some semblance of sanity, the huge Foxhound "To Do" list has been broken into separate files by category: bug fixes, necessary enhancements to the Schema Display portion, enhancements to the Monitor, future changes and so on, plus a "Done" list where completed to-do items are moved when they're done.

The current refactoring walk-through has pointed out the need for a new category: the "Always Watch For" to-do items. These are tasks which must be repeated, sometimes frequently, and are never really "Done".

Here's the brand-new "Always Watch For" list... only three items, but the list is only a day old:

  • Always watch for new problems in Foxhound Options - Display Diagnostics.

  • When upgrading to a new version of SQL Anywhere, check code for references to SQLANY11.

  • When upgrading to a new version of SQL Anywhere, check code in 610_rroad_dbping.sql for version-specific environmental changes (folder names, etc.)
The first one was really nasty... the Foxhound build process can create three different versions: the final delivery version, a version to be used for tuning, and a version with lots of extra diagnostics for use during development only.

Multiple versions of the same code exist in some places, and which version is actually compiled depends on the build version; for example, multiple versions of a CREATE TABLE may exist with more constraints in the development build than the final deployment build. When making maintenance changes it's important to check ALL the versions of the same code to see if they ALL need the same change; e.g., a new column is needed in all build versions.

You can see where this is heading: The diagnostic development build works OK, but not the final delivery version, because a change was made in one place when it needed to be made in two places. In some cases, the result is a "soft error" that is not fatal to Foxhound operation, but causes a runtime diagnostic to be stored.

And that's the reason for the to-do item "Always watch for new problems in Foxhound Options - Display Diagnostics"... over 500 of these messages appeared there before I noticed anything was amiss:
514 2008-12-03 07:45:40.093 Full Build 3331a 1000000321 201a3(201eh1) SQLCODE = -143, SQLSTATE = 52003, ERRORMSG() = Column 'timeout_retry_at' not found
The other two "When upgrading..." items refer to code that is specific to the version of SQL Anywhere used to build Foxhound. Regardless of whether version-specific data is hard-coded or placed in a configuration file, it still needs to be revisited when the version changes... hence these reminders in the "Always Watch For" list.

All the items got added to the list the hard way: I made a mistake, and it's likely I'll make the same mistake again.

There will be lots more entries, I'm sure... the reason I'm talking about it is that you might benefit from creating your own "Always Watch For" list, on your own projects.

No comments: