Re: Converting Lock methods
Posted in 1992
>> From uunet!rmy.emory.edu!informix-list-owner Tue Apr 7 01:14:04 1992
>> To: informix-list@rmy.emory.edu
>> Subject: Converting Lock methods
>> From: uunet!das.harvard.edu!bochner
>>
>> On my platform (SE on a sun4), a side effect of upgrading to 4.1 was that the
>> DB engine changed locking schemes: no more .lok files! This was mentioned in
>> the release notes, which said that to convert the locks I should set the
>> RESETLOCK environment variable.
>>
>> What wasn't obvious to me from the release notes was that the new engine
>> wouldn't open my old databases AT ALL unless the environment variable was
>> set. This caused a few minutes of panic, until I connected it with the
>> locking issue; if I hadn't read the release notes, I would have been lost ...
Hmm. I thought the need to keep RESETLOCK set until all files were converted
was pretty clear in the text; then again, I wrote that section, so I'm not
the most objective judge of the language used. [-: (I've attached it below
so that others who may be affected in the future can get an advance peek.)
>> The release notes say you should read each table in the database with
>> RESETLOCK set. I did this by constructing a script that did
>> select * from xyz where ROWID < 5>> for each table in the database (for each of three databases, in my case :-().
Make sure you include the catalog tables, too! The bcheck methods are easier,
although potentially much slower.
>> After this, you can run without RESETLOCK being set. The .lok files are still
>> there, but it appears to be safe to remove them.
Yup, after conversion.
>> Hope this saves someone those few minutes of panic ...
>>
>> -- Harry Bochner
>> -- bochner@das.harvard.edu
The only platforms we've changed locking method in mid-release (that I know of)
are the Sun 4 (effective 4.10.UC2) and the Sun 3 (effective 4.10.UE1).
Here's the release note:
Conversion of Locking Methodology using the RESETLOCK variable
--------------------------------------------------------------
This Release Note pertains to C-ISAM and INFORMIX-SE.
Overview
--------
For C-ISAM and SE, record-level locking can be implemented using
any one of several different methods. The locking method is chosen
for each given platform after evaluating several criteria, including
system call support, reliability, and performance.
There are safeguards built into C-ISAM releases 4.00 and higher that
forbid the use of a C-ISAM program (or the SE engine) which uses a
locking method different from the method used when the files were
created. This prevents mixing product versions that would not recognize
each others' locks; without this safeguard, corruption could result.
Sometimes, for reasons relating to performance, reliability, and/or
functionality (e.g. support for LOCK MODE WAIT), we change the locking
method used in a new release for a given platform. The safeguards
mentioned above would prevent the new version from being used with
files or tables created using the older version. Therefore, with the
4.10.UD1 releases of C-ISAM and SE, we have introduced a new feature
to allow a user to request automatic conversion of the locking method
in an otherwise transparent fashion. This automatic conversion is
triggered by setting and exporting the environment variable RESETLOCK.
(RESETLOCK must simply be set; it can have any value, or no value.)
Changes Summary
---------------
If C-ISAM files or SE tables are accessed using a locking method
different from that which they were created with, and the RESETLOCK
variable is not set, the user will get an error. The ISAM-level
returned will be -105: Bad ISAM file format. This is a general
error indicating that the ISAM file header is damaged or otherwise
is not compatible with the program used to access it. (In a future
release, a different error will be returned for cases not relating
to file damage; be sure to read the release notes for future versions
carefully).
To enable the automatic conversion, RESETLOCK must be set and exported
in the environment in the manner appropriate for the shell in use:
Bourne or RESETLOCK=
Korn shell: export RESETLOCK
C shell: setenv RESETLOCK
The first user (with access privileges) that opens the C-ISAM file
(or SE table) using the newer version and who has RESETLOCK set
will cause the ISAM file header to be updated to note the new locking
format. From that time forward, that file can be opened only using
the new version.
Conversion Recommendations
--------------------------
To prevent problems with mixing versions and to avoid confusion among
users, we recommend that the DBA or systems administrator force
the conversion for all C-ISAM files (including SE tables) at once,
then remove the older product versions immediately afterward.
The actual opening of files to trigger the conversion can be
accomplished using any of the following methods:
For SE tables: as user "informix", run UPDATE STATISTICS in every
SE database on the system. (Warning: for large
tables, UPDATE STATISTICS may take several minutes).
For C-ISAM files
or SE tables: as user "informix" or "root", run use the
bcheck utility:
bcheck -inq filename [filename2 ...]
where: filename = the base file name of the
C-ISAM file, with no extension or the
.idx extension (extension is ignored).
Multiple C-ISAM file names may be
specified with each bcheck command.
This latter method can be used in tandem with a find(1) command
to search-and-convert all C-ISAM files on a given system. If
there are no files named with a .idx suffix that you did *not*
want to convert, the following could be used:
find / -name "*.idx" -exec bcheck -inq {} \\;
--------------------------------------------------------------
--
Alan Denney aland@informix.com {pyramid|uunet}!infmx!aland
"In the cafeteria just after lunch, (well, not *just* after, more like
*during* lunch, about 12:28; say 12:30, give or take a few minutes),
I leaned back in my chair (it was one of those aluminum chairs, good
strength-to-weight, like titanium but not quite; but then of course
titanium would be a bit of an overkill). Anyway, I heard one of the
girls talking about how boring she thought engineers could be."