Jump to content


Photo
- - - - -

corruption in msgf


23 replies to this topic

#1 Joseph Bove

Joseph Bove

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 756 posts
  • Gender:Male
  • Location:Ramsey, United States

Posted 02 August 2005 - 05:10 PM

Dear list,

I've a problem at a large site that I'm at a loss for. MSGF.pro keeps getting corrupted.

It's on ProIV 5.5, SQL Server back end.

If I copy it over (with users on the system), it appears fine ischk's without error. However, within 30 seconds to 5 minutes, the file will be corrupt.

I know that copying over msgf.pro with users on the system is not ideal. However, due to the large size of the client, I can't justify asking them to take the system down just for the sake of msgf.

Has anyone ever run across something like this?

Thanks in advance,

Joseph

#2 Guest_Guest_*

Guest_Guest_*
  • Guests

Posted 02 August 2005 - 05:31 PM

(1) What do you mean by "copy it over"?
(2) Is it actually possible/legitimate to run ischk with users possibly accessing the file?!
(3) What does it actually "mean" on Windows to "replace" a "file" that's in use?

#3 Joseph Bove

Joseph Bove

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 756 posts
  • Gender:Male
  • Location:Ramsey, United States

Posted 02 August 2005 - 09:20 PM

Guest,


(1) What do you mean by "copy it over"?

I copy a known good version into the PROPATH directory.

copy c:\atc\hold\goodmsgf.pro c:\atc\livedir\msgf.pro

(2) Is it actually possible/legitimate to run ischk with users possibly accessing the file?!


Yes with the following caveat: You can get false negatives. However you will never get a false negative. Also, with a file like MSGF which is not being added to or deleted from, the ischk integrity should be fine.


(3) What does it actually "mean" on Windows to "replace" a "file" that's in use?


Same as the answer to number 1. You can copy a good version on top of a file that's in use.

Regards,

Joseph

#4 Rob Donovan

Rob Donovan

    rob@proivrc.com

  • Admin
  • 1,640 posts
  • Gender:Male
  • Location:Spain

Posted 02 August 2005 - 11:30 PM

Hi,

You should never copy a ProISAM (or any other file type really) while there are people on your system.

On a windows system, I would also stop the ProIV service before copying or replacing any of the ProISAM files. Just to make sure there are no processes left around that could have the file open and cause any corruption.

This also applies to physically creating ProISAM files (from within ProIV or using iscr / isin) or running a function with the Clear flag set to Y. This will also create corrupt ProISAM files.

Rob D.

#5 Richard Bassett

Richard Bassett

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 696 posts
  • Location:Rural France

Posted 03 August 2005 - 09:30 AM

Yeah, I can't see how this could ever work Joseph.
I know you're on Windows and I'm not really familiar enough with that but if I was considering Unix:

Replacing a file will not cause the processes that have the file open already to close their existing file handles and open the replacement file.

Processes that have the file open already will each have their own little cache of index and/or data blocks that they have read from the original file. Nothing will cause them to clear out or refresh this cache.

If the copy operation in fact overwrites the disk space of the original file (rather than say writing on newly-allocated space and finally overwriting the directory entry) then processes that have the file open will likely become utterly confused because the contents and the pointers/links in original blocks they have cached will be inconsistent with any blocks that they subsequently read from disk.

At that point all bets are off and if, for some reason, a process that had the file open already decides to write some original blocks back to it then the file is going to get trashed.
Nothing's as simple as you think

#6 Joseph Bove

Joseph Bove

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 756 posts
  • Gender:Male
  • Location:Ramsey, United States

Posted 03 August 2005 - 03:12 PM

Rob,

You should never copy a ProISAM (or any other file type really) while there are people on your system.

Right... However, the situation is not one that comfortably allows for me taking people off the system. At that point, you have to start looking at other options. I'm also drawing a distinction between a ProISAM file that is exclusively in Lookup mode versus a significant transactional mode.

Richard,

At that point all bets are off and if, for some reason, a process that had the file open already decides to write some original blocks back to it then the file is going to get trashed.


I agree, but the same distinction is in play. The file is only ever in Lookup mode. There should be no writing back to the file by any process.

...

Now, even if the methodology for trying to repair a corrupt msgf file on a live system is flawed, the question still remains: Has anyone experienced on-going problems with msgf corrupting?

Final note: I have also seen this problem on a laptop where ProIV was turned off, msgf copied across from a known good version, and then msgf corrupted again...

#7 George Macken

George Macken

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 248 posts
  • Gender:Male
  • Location:Co. Wicklow, Ireland

Posted 03 August 2005 - 04:13 PM

Hi Josef

I think I recollect a problem of msgf corrupting, but it was many years ago and a lot of alcohol has been consumed since then and some cells are not functioning as they used to

assuming that you correctly replace the msgf, while all users off etc., after this you run an ischk on it and it reports OK etc., how long after this does the file corruption occur?
Is it related to a server shutdown/re-boot/backup etc., is there something unique that occurs when the msgf corruption also raises its head

from what you've said the copy of the msgf does not work, try creating it as follows ....

could the corruption be related to the no. of records or the file size - the conundrum of creating pro-isam file using the comand iscr - k -page (1024, 2048, 3072).

maybe next time the file corrupts - create the msgf file as large as possible using iscr command and then populate it from a msgf.seq (isarch) as the source - create the file from an isin, see if this file lasts longer than a straight forward copy

Maybe go thru this process now to create that backup msgf.pro file which could then be used to overwrite the corrupting file (when users are off of the system)

hth

George

#8 Joseph Bove

Joseph Bove

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 756 posts
  • Gender:Male
  • Location:Ramsey, United States

Posted 03 August 2005 - 05:16 PM

George,

Thanks for the ideas.

It's definitely not a file size issue. The file is something like 1,214,000 bytes - so hardly near any ProISAM corrupting limit.

Due to the size of the client it will take me a couple of weeks to find out how quickly it corrupts after taking everyone off and putting in a clean version. The window of opportunity to actually do this is no more than once per day - possibly only once per week!

Regards,

Joseph

#9 Richard Bassett

Richard Bassett

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 696 posts
  • Location:Rural France

Posted 03 August 2005 - 06:58 PM

Joseph,

If nothing is writing MSGF then I would think ProIV should be able to run with the permissions on msgf.pro set so that nobody can write to it.

If you set the permissions that way when you replace the file, you may well be able to determine (from write errors or similar) which processing in your app is actually writing to the file (and maybe corrupting it).

It might even band-aid over your problem in the short term.. maybe :)
Nothing's as simple as you think

#10 Joseph Bove

Joseph Bove

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 756 posts
  • Gender:Male
  • Location:Ramsey, United States

Posted 03 August 2005 - 07:48 PM

Richard,

Excellent idea.

Thanks,

Joseph

#11 Rob Donovan

Rob Donovan

    rob@proivrc.com

  • Admin
  • 1,640 posts
  • Gender:Male
  • Location:Spain

Posted 03 August 2005 - 11:09 PM

Hi,

Also, just remember to also stop the ProIV Service when you are trying it out (since you are on windows) once you have got all your users off.

You definatly will get corrupt files while the ProIV Service is still running if you move / copy ProISAM files around.

I have had that on a Windows system that only I am using (on my PC) and got corrupt files. Even though I had nothing running. (just the p4 service).

I'm guessing you are on a 24/7 system then, if you cant easily get the users off??

How do you do backups in this situation? Because again, you should only backup ProISAM files if no processes are accessing / writting them.

Rob D.

#12 Richard Bassett

Richard Bassett

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 696 posts
  • Location:Rural France

Posted 04 August 2005 - 10:29 AM

Hello again Joseph,

Something else occurred to me..

To even try my suggestion "properly" you likely STILL have to shut down the ProIV system before you can put a read-only copy of MSGF in place. This would be because processes that already had MSGF open had it open in read/write mode and replacing the file won't change that.. so those processes might continue to believe they can write to the file (disk blocks) even though the file "appears" now to be read-only.

I certainly don't know that for a fact but we're talking about subtle semantics of the OS/filesystem here and their interaction with ProISAM - what you're doing is in "undefined results" territory for most people.

Incidentally, Rob asks an excellent question - how are you dealing with backup??
Is it that only the bootstrap is ProISAM in your installation and you shut the system down to apply changes to the ProIV software?
Nothing's as simple as you think

#13 tclulow

tclulow

    Member

  • Members
  • PipPip
  • 37 posts
  • Gender:Male
  • Location:Cambridge

Posted 04 August 2005 - 01:18 PM

Not sure about windows, but IIRC Pro-IV opens all Pro-Isam files read/write (even if only in 'L' mode) so you get a failure opening files that aren't writable.


Tony.

#14 Richard Bassett

Richard Bassett

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 696 posts
  • Location:Rural France

Posted 04 August 2005 - 01:42 PM

IIRC Pro-IV opens all Pro-Isam files read/write

It used to be that way once but for some time I think ProIV has had the ability to "fallback" to a read-only open when a read-write open doesn't work. I retried it and it certainly seems OK. You just get a write failure if you attempt a write.

Among other things, I believe that allows multiple "systems" to share a read-only bootstrap across NFS for example.
Nothing's as simple as you think

#15 Joseph Bove

Joseph Bove

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 756 posts
  • Gender:Male
  • Location:Ramsey, United States

Posted 04 August 2005 - 05:02 PM

Rob,

I'm guessing you are on a 24/7 system then, if you cant easily get the users off??

How do you do backups in this situation? Because again, you should only backup ProISAM files if no processes are accessing / writting them.


24/7 - yes... and moderate volume during some of those weird hours (example: 3:00 AM) to boot!

They are pretty reticent about not having more than one scheduled down time per week.

...

The source code is ProISAM. The database is SQL Server. They are able to backup the database without any exceptional effort.

All source code in the live region exists on test servers. Being able to recover from a catastrophe would not be a significant issue.

Regards,

Joseph



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users