Salesforce

PROUTIL -C HOLDER or BUSY incorrectly shows db as running after a server reboot

« Go Back

Information

 
TitlePROUTIL -C HOLDER or BUSY incorrectly shows db as running after a server reboot
URL Name000035390
Article Number000177893
EnvironmentProduct: Progress
Version: 9.x
Product: OpenEdge
Version: 10.x, 11.x, 12.x
OS: UNIX
Question/Problem Description
PROUTIL -C HOLDER or PROUTIL -C BUSY incorrectly shows db as running
PROUTIL -C HOLDER shows that the database is in use.
PROUTIL -C BUSY reports that the database is running in multi-user mode.

fuser shows no processes using the .db file.
ps -leaf shows that no Progress processes are running.
lsof +D <db_dirname> shows no-one has a directory and/or the database files within it open.
Database .lk file dates before the reboot or system failure.

Steps to Reproduce
Clarifying Information
Server has been rebooted without shutting databases down first
Server has suffered a power outage.
Database startup scripts rely on the return codes from PROUTIL -C HOLDER or PROUTIL -C BUSY to determine if the database should be started or not if it is already running.
Since PROUTIL -C HOLDER/BUSY returns that the database is running in multi-user mode, the database is not started and users cannot access the application.
Error MessageThe database <dbname> is in use in multi-user mode. (276)
SYSTEM ERROR: Can't attach shared memory with segment_id: <id> for <dbname>
There is no server for database <dbname>. (1423)
Defect Number
Enhancement Number
Cause
Resolution
PROUTIL -C HOLDER or PROUTIL -C BUSY will still show that the database is in use when the database is not shutdown properly prior to reboot, or after a power failure, since the database .lk file is still present (even if it dates prior to the reboot).

There's a difference between the .lk file checks when a process tries to open the database and the PROUTIL -C holder or PROUTIL -C busy qualifiers that simply check for the .lk file's existence and content - these do not access the database.

The database .lk file contains three pieces of information:
  1. The mode in which the database was started. (which is what the PROUTIL utilities are reporting on)
  2. The process id (pid) of the process that started the database.
  3. The hostname where the process that started it is running.
The database .lk file contains validation information about the broker during the current session, and will clear it out at the database normal shutdown time. This is why If a power outage or reboot occurs while the Database was running, the PROUTIL -C holder/busy qualifiers report wrong information as they don't have the required knowledge to reconise that the Database has crashed and will return incorrectly that the database is running in multi-user mode, since that was the last 'content' of the .lk file.

While server outage is unavoidable at times, a reboot is manageable and the process should be reviewed in terms of shutting down the AdminServer (if in use) and databases prior to issuing the reboot.

In the database startup scripts (_mprosrv or proadsv + dbman), instead of using/relying on proutil -C holder/busy, within the same database startup script delete the .lk file and utility/broker will work normally.
  • Check if the uptime is less than 90 seconds, (ensuring that the system has rebooted recently)
  • If true, delete the .lk file first
  • and then/else:
  • Truncate of the BI to ensure that the shared memory segment ids stored in the master block are cleared up
  • Optionally run proutil -C BIGROW 
  • Start the database.

EXAMPLE (LINUX)
UPTIME=`cat /proc/uptime | cut -d " " -f 1| cut -d . -f1`

# check for stale lk-Files resulting from a crash and delete them if uptime < 90seconds
if [ "$UPTIME" -le "90" ]; then
echo "Uptime less than 90 seconds, system rebooted recently, no DBs can be running yet. Deleting db.lk files."
find /db/ -type f -name "*.lk" -exec rm -f {} \;
else
echo "Uptime above 90 sec, continue to start databases."
fi

# done

# Truncate bi: proutil dbname -C truncate bi
# Grow bi file: proutil dbname -C bigrow 13
# Start database: _mprosrv dbname -pf dbname.pf

​​​​​​​

 

​​​​​​​
Workaround

 
Notes
Keyword Phrase
Last Modified Date5/31/2021 9:33 AM

Powered by