PxPlus User Forum

Twitter Twitter Twitter

Author Topic: Correcting missing key  (Read 2127 times)

chrisk

  • Member
  • **
  • Posts: 14
    • View Profile
Correcting missing key
« on: October 24, 2019, 11:15:39 AM »
Hello,

Recently, we have started seeing PxPlus messages indicating a missing key has been corrected.  The exact message has PxPlus at the header and shows the filename along with the statement "Correcting missing key" with an OK and Cancel button.

The message appears to be hard coded in the pxplus executable and it is causing concern with our users.

What can be done to determine these cause of these messages?

Is there is any way to suppress them?

Thanks,

Chris Kukuchka
Sequoia Group, Inc.

Mike King

  • Diamond Member
  • *****
  • Posts: 3811
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: Correcting missing key
« Reply #1 on: October 24, 2019, 12:03:46 PM »
Sounds like a file has gotten corrupted.  Has the system gone down while users are active or an update running (power failure, OS crash, user forced shutdown)?

What the system is reporting is that when it went to delete or modify a key for a record the expected key table entry wasn't found.

In the file there are key table for the primary and all alternate keys that point to the record.  When a record is changed that will impact an alternate key the system will find the old entry in the key tables that pointed to the record; remove it; and insert a new key table entry.  The message appears if, for some unknown reason, it cannot find the old key table entry.   

For example if you changed a client name from "Pet Sitters" to "Happy Dogs" and the system had an alternate key on client names, it would remove the key table entry for "Pet Sitters" which would have pointed to the record, and inserted a new "Happy Dogs" key table entry.  The message will occur if it could not find the "Pet Sitters" entry which should have existed.

Technically when the message occurs the specific instance has been resolved however it does indicate something suspicious has occurred causing the file key tables to be out of sync which can occur when sections of the file that we pending update to the physical disk were not flushed when the system failed.

To fix, open and lock the file then issue a KEYED LOAD directive against the file.  This will rebuild the key tables from the records.

Be sure to back the file first on the off chance the system cannot fully recover the data.
Also, if possible, do an application integrity check as while PxPlus defers key table updates until after the records are updated (thus the keys can usually be rebuilt from the data records), there is no guarantee that the OS flushed the data records to disc.


 
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

chrisk

  • Member
  • **
  • Posts: 14
    • View Profile
Re: Correcting missing key
« Reply #2 on: October 24, 2019, 02:09:54 PM »
Mike,

What does an "application integrity check" entail?
Chris Kukuchka
Sequoia Group, Inc.

ChrisKCAi

  • Silver Member
  • ***
  • Posts: 38
    • View Profile
Re: Correcting missing key
« Reply #3 on: October 24, 2019, 02:55:39 PM »
We've experienced this in the past when we remove records in rapid succession (e.g. from within a select loop) from a file with several (usu. >10) alternate keys. There never seems to be any corruption after the fact but you do have to click OK on the message box to proceed. Not only a nuisance, but can be problematic if the process is meant to run unattended (e.g. as a background task or from within a Windows service).

Mike King

  • Diamond Member
  • *****
  • Posts: 3811
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: Correcting missing key
« Reply #4 on: October 24, 2019, 04:09:01 PM »
ChrisK CAI

You really should never see this unless there is something wrong with the file.
Historically when people see these errors we find that the server was restarted without a clean shutdown and the problems start to surface a few days later.

Unlike many file systems PxPlus was designed to, where possible, allow you to run after a system failure without having to rebuild/recover the files as the files themselves possess some fault tolerance by design.  You can however enable the SYSTEM_JRNL DIRECTORY command which will advise you of which files were opened and being updated at the time of a system failure so on reboot of the server you can scan the directory and rebuild the impacted files.

Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

chrisk

  • Member
  • **
  • Posts: 14
    • View Profile
Re: Correcting missing key
« Reply #5 on: October 24, 2019, 04:36:15 PM »
Mike,

We have this message coming up on a problem file quite regularly.  This particular file tracks locking activities, so it can be erased and recreated without data loss.

However, even after erasing and recreating the file, after a few hours, the file again shows data corruption problems.  We have been working to programmatically handle the data problems we can capture, but cannot control this message.

Since we cannot find a cause for the corruption, we are looking for a way to disable the "Correcting missing key" message.
Chris Kukuchka
Sequoia Group, Inc.

Mike King

  • Diamond Member
  • *****
  • Posts: 3811
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: Correcting missing key
« Reply #6 on: October 24, 2019, 04:45:10 PM »
What are the file create parameters you are using?
Also what OS type and is the file local or remote?

We would suggest you contact your supplier so they can forward this information to us to have a look at.
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

chrisk

  • Member
  • **
  • Posts: 14
    • View Profile
Re: Correcting missing key
« Reply #7 on: October 24, 2019, 04:56:39 PM »
Mike,

This is running on RedHat and the file is being accessed locally.

The supplier recommended replacing the problem file with an fresh empty copy from the installation media.  Since the corruption is happening frequently, we are instead renaming the problem file and recreating it with this keyed directive:

keyed file_name$,"[1:1:2]+[2:1:3]+[3:1:10]+[4:1:6],[1:1:2]+[5:1:12]+[6:1:1]",,-256

Chris Kukuchka
Sequoia Group, Inc.

Thomas Bock

  • Diamond Member
  • *****
  • Posts: 177
    • View Profile
Re: Correcting missing key
« Reply #8 on: October 25, 2019, 01:45:22 AM »
A year ago we had similar problems with PxPlus V12.
Out of the sudden key #1 of a file became constantly corrupted on different customer systems. Repairing the file fixed the issue for less than 48h quite often.
We decided to eliminate that key, which has been there for many many years, at the price of poor performance.
Nobody could ever analyze the reason for that phenomenon.