Busy PVCS archive file and busy journal.vcs file

Our use of PVCS is primarily by way CLI commands embedded with various other tools (ex. Perl scripts).

We had a user report that they were checking out a file from PVCS and pressed Ctrl-c, thinking that something was hung. The net result was that the PVCS archive was left in an inconsistent state (not in the PVCS sense, but in our code management sense). So I had planned to unlock the programmers lock on the source file and remove a 'Dev' promotion group. Unfortunately, this was the result:

vcs -u 5007FCA12.sdm
PVCS Version Manager (vcs) v8.6.3.0 (Build 421) for Linux/x86_64
(C) Copyright 2021 Micro Focus or one of its affiliates. All Rights Reserved.
vcs: waiting for archive "/home/pvcs/cefms/archives/5007FCA12.vdm" (2).
vcs: waiting for archive "/home/pvcs/cefms/archives/5007FCA12.vdm" (1).
vcs: error, archive "/home/pvcs/cefms/archives/5007FCA12.vdm" is in use.

For other PVCS actions I also saw this:

get: error, journal "/home/pvcs/cefms/archives/journal.vcs" is in use.


I looked in the designated ARCHIVEWORK directory and found a .tmp file that was related to this PVCS archive and removed it This did not remedy the situation. 

I'm now told that code checkout and in is being prevented for any files stored in the PVCS project. And the symptom points to the journal.vcs file that is co-located with the PVCS archives files. I've always seen this file as a simple journal of any PVCS actions (ex. add label, checkout w/lock, assign promotion group, etc) for all the PVCS archives in the project. But for all the years I've worked with PVCS, I've never seen this file locked. It always seemed more like a log that was only updated by appending new actions. 

Anyhow, checking the timestamps on the original source file and on the journal.vcs, I found they were the same! And that would be a pretty big coincidence late on a Sunday night with only the single programmer likely working.

I found within the defined SEMAPHOREDIR, entries for both the above source file and for the journal.vcs. Based on information in the PVCS VM Admin Guide, it appears that these semaphore files are used to coordinate 'shared access' to PVCS archives and the journal.vcs file.

My question are: 

- Can I safely remove the files from the SEMAPHOREDIR for the purpose of regaining available use of these files?
- What would be the best method to handle situations like these, if they occur in the future?
- What would be the best way to prevent the need for administrative actions like these?

Thanks,
Mark



  • Suggested Answer

    0  

    Hello Mark,

    Semaphore files are indeed used to avoid multiple processes simultaneously updating the same file, which could result in data loss or file corruption. They are normally short lived.

    - Can I safely remove the files from the SEMAPHOREDIR for the purpose of regaining available use of these files?

    Semaphore files (including .lck) can safely be manually deleted from the SEMAPHOREDIR directory under the following conditions:

    1. They were not created very recently (say at least 60 minutes ago).
    2. The PVCS VM File Server is not used, or the PVCS VM File Server is not running when the file is deleted (or will be restarted afterwards).

    You check if a semaphore was created by the PVCS VM File Server by checking its contents. If those look like:

    File semaphore created by Serena File Server for UserID@IP_Address

    then the semaphore was created by a PVCS VM File Server. If that server is still running, the semaphore should be deleted from the PVCS Version Manager File Server Admin page (localhost:8080/.../Admin). In other situations, you can delete the semaphore files by hand.

    For more information, see KB doc S134615

    - What would be the best method to handle situations like these, if they occur in the future?

    Delete the semaphore files as indicated above.

    - What would be the best way to prevent the need for administrative actions like these?

    Do not kill a PVCS VM command, or reboot the server it is running on, while that command is performing an update.

    With kind regards,

    - Richard.