pcp
[Top] [All Lists]

pcp updates: pmlogger - handle stale hard links after an upgrade

To: pcp <pcp@xxxxxxxxxxx>
Subject: pcp updates: pmlogger - handle stale hard links after an upgrade
From: Mark Goodwin <mgoodwin@xxxxxxxxxx>
Date: Sat, 01 Aug 2015 17:38:46 +1000
Delivered-to: pcp@xxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0
This  addresses Nathan's concern about upgrades following review of the
earlier commit.

I've tested an upgrade and it works as expected, provided the existing
pmlogger process is killed normally (as is the case during an upgrade).
In that case pmlogger's atexit(cleanup) handler gets run and the primary
control and socket links are correctly removed prior to the new version
of pmlogger getting started.

However, there is a corner case if the primary logger is killed with
a SIGKILL prior to the upgrade, in which case there are legacy *hard*
links that need to be removed by the new pmlogger process.

Also updated qa/808 to exercise this corner case.


Changes committed to git://pcp.io/markgw/pcp/pcp.git master

commit 7148bf11e779f93d930416c9ac50979ea253b82e
Author: Mark Goodwin <mgoodwin@xxxxxxxxxx>
Date:   Sat Aug 1 17:20:52 2015 +1000

    pmlogger - also handle stale legacy hard links for primary pmlogger run 
files

    On an upgrade from a previous version of PCP (that still used hard links for
    the control and socket primary links), if pmlogger is killed with SIGKILL
    prior to the upgrade, then there may be stale legacy hard links for the
    primary control file and socket. If found, these need to be removed before
    checking for stale symlinks - hard links are always stale here.

    Also add an additional test for this in qa/808.

        modified:   qa/808
        modified:   qa/808.out
        modified:   src/pmlogger/src/ports.c

<Prev in Thread] Current Thread [Next in Thread>
  • pcp updates: pmlogger - handle stale hard links after an upgrade, Mark Goodwin <=