New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide safe mechanism for migrating archives to an alternative storage area #1613
Comments
Hi @kmcdonell - thats some good sleuthing and the proposed solution seems to me a fair approach to take. I have another consideration that would be good to think about in this context, and a very similar issue came up in unrelated discussions this past week. When pcp-zeroconf was initially added a script - pmlogger_daily_report(1) - was included, with the intention of generating daily summaries. The implementation turned out to interact extremely badly with daily rotation, such that its not disabled by default (but still present and problematic). IIRC the problem with it is that it runs (too-long) after daily log merging, compression and rotation. It runs a series of pmrep commands on the recently-rotated daily log. I was on a call with another team wanting the same functionality - generating daily log summaries to send back-to-base later. The problem with our current setup is that these scripts have no knowledge of rotation - they wait until "some time later", and then run pcp client tools (pmrep, pmlogsummary, etc) to generate a daily report which is left in some convenient location. This ends up being hideously expensive because the archive is now compressed - in the case of the existing pmlogger_daily_report it runs multiple (tens of?) pmrep invocations, each uncompressing-reporting-and-discarding the temporary archive. A better, extensible design would fit into the mechanism you're describing, such that user scripts could run on the daily archive just at the right moment - after daily merging but before the daily compression. So, could we extend the PCP_DAILY_CALLBACK mechanism to allow multiple, user-defined scripts? I think that'd mean we could start enabling pmlogger_daily_report once more, and these other folks would be able to plug in for their needs too. Final, unrelated thought - should we formalise all those $(date...) calls in the examples and provide "macros" (well, constants) like we've done for LOCALHOSTNAME? (perhaps DATEMM, DATEDD, DATEYYYY - something like that?) There's a teensy race condition I see there currently (in the example) where subsequent calls to 'date' might end up spanning days/months/years and providing different values for the "same" date command on one control line. cheers. |
I subsequently realized a flaw in the XDMoD example above. Since pmlogger_daily runs soon after midnight:
will save yesterday's archive in a directory named with today's date! And even more obscure, if pmlogger_daily failed for some reason yesterday, but worked today then this would save yesterday's archive and the day before's archive in a directory named with today's date, etc, etc. This adds more force to the arguments from @natoscott to avoid the use of $(date ...) in the control files. So now we have a revised proposal:
With these changes, the simplest XDMoD variant becomes:
Note that $PCP_MERGE_CALLBACK dodges the decompression issue, so is a suitable hook for pmlogger_daily_report, or any other customized scripts that need to process one day's worth of archive data. One would not normally expect more than one of the new options to be set, but they could safely all be used to achieve different processing goals. The nice thing about all of this is that it appears simple to implement and without regression risk. |
This is all done now, and will be on board when the bright shiny new PCP 6.0 sets sail. |
The issue has arisen in the context of performance analysis in computing clusters (e.g. XDMoD), although the issue is more general than just computing clusters.
In these environments there are 1,000s or 10,000s of compute nodes, each with their own pmcd-pmlogger pair archiving performance data. Consolidation of the archives for analysis is achieved using some cluster-wide parallel filesystem, like GPFS or Lustre or Panasas or (in the distant past) CXFS. What all of the parallel filesystems have in common is a distinct performance hit associated with concurrent operations in the same directory and directories with large numbers of entries.
To overcome this, the XDMoD folk suggest a path for the archives on each node (as specified in the /etc/pcp/pmlogger/control* file) along the lines of:
This has worked in the past (they are still on PCP 4.3.2) because pmlogger_daily launched a new pmlogger each night and so the directory path changed each day. But it will not work with any PCP version that includes the "reexec" feature for pmlogger, as this does not re-evaluate the path by default (the expansion of the $(date ...) parts is done in pmlogger_daily, but unless pmlogger_daily is run with a -z option, if pmlogger is already running it is sent a SIGUSR2 rather than being killed off and restarted).
So these users would be forced to edit the pmlogger_daily.service file to add "-z" to PMLOGGER_DAILY_PARAMS to maintain the old semantics, or we could devise a better scheme.
Note that this is a special case of a more generic requirement, namely once PCP has finished creating an archive in the infrastructure supported by pmlogger_check and pmlogger_daily (the scripts behind the PCP systemd bits), it would be helpful to provide some safe mechanism to migrate those archives off to some other storage place (cloud, off-line, ...) or allow data reduction (pmlogextract, pmlogreduce or something else) or report generation or ...
The proposal is:
So for the XDMoD example if the pmlogger processes need to create their archives in /gpfs this would require a control file stanza like:
Otherwise the archives could be created in each node's local filesystem and moved to /gpfs after the daily combination with a control file stanza like:
All of this would be done holding the PCP archive per-directory lock, so it would be protected from any concurrent pmlogger_check activity.
The text was updated successfully, but these errors were encountered: