Skip to content
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

History: support event tracking #117

Merged
merged 11 commits into from
Apr 19, 2016
Merged

History: support event tracking #117

merged 11 commits into from
Apr 19, 2016

Conversation

stdweird
Copy link
Member

Based on #120

use parent qw(Exporter);
our @EXPORT_OK = qw($EVENTS $IDX $ID $TS $REF);

# refaddr was added between 5.8.0 and 5.8.8
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this line have a "use 5.8.8" line in it to help catch versions of Perl that ar too old?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could but as we don't support anything older than EL5, it should always match...

@jrha
Copy link
Member

jrha commented Dec 3, 2015

@stdweird?

@stdweird
Copy link
Member Author

stdweird commented Dec 4, 2015

@jrha i fixed the remarks, but i'd prefer #103 to be merged first. than @ned21 can have another look 😄

@stdweird
Copy link
Member Author

stdweird commented Dec 6, 2015

@ned21 rebased for easier review

@stdweird stdweird modified the milestones: 16.2, 15.12 Dec 10, 2015
@ned21
Copy link
Contributor

ned21 commented Dec 15, 2015

I think the code is good but it's hard to see how this actually useful without a working POC application. My concern is that a lot of CAF/LC is already really (too?) complicated that this adds more code where things can go wrong unexpectedly.

Can we try sketching up how this might be used to implement some sort of "delete if removed from profile" option in ncm-metaconfig?

@stdweird
Copy link
Member Author

What exists now in quattor/ncm-ncd#51 is that at the end of each component run, it prints all events that came from a FileWriter (and Editor i think) and that modified something.
but it has the events of all files handled by FileWriter, including the ones that didn't change, so we can track what is possibly modified by metaconfig (or any other component).

What is is keeping some sort of local database to keep track of which files where once handled by a FileWriter (or a FileWriter/component combination). at the end of each component, the list of files once handled by FileWriter can be compared to list of files handled by FileWriter, and any differences can be acted upon.

So one missing bit is to store the recorded events at the end of each component (or ncm-ncd), and provide a way to query the stored events.
The other missing bit is to define actions on certain types of events: e.g. do we remove a file that is under metaconfig control, but that was not modified ever? e.g. configfile from rpm, and metaconfig just creates the same config file. if there's a backup, we could restore the backup instead of just deleting, but is the backup the backup of the pre-metaconfig run or just the latest backup.

same applies for e.g. symlinks: need to create a CAF::Symlink module, and add an event handler to the init and/or the createing of symlinks, and then we can act upon these symlink events.

(none of database or actions to take is implemneted here because this PR is mainly to handle #98)

@stdweird stdweird force-pushed the history branch 2 times, most recently from 81cc2f6 to bdef7cc Compare January 4, 2016 07:38
@stdweird
Copy link
Member Author

stdweird commented Jan 4, 2016

Had to rebase this on #120, there was a conflict

@ned21
Copy link
Contributor

ned21 commented Jan 10, 2016

Thanks for the context -- I am not sure I had realised the significance wrt to #98 before. Can we defer this one until the next workshop? I'd like to see a working demo of quattor/ncm-ncd#51 and have a full session on what we want and expect from logging both at a library and component level to avoid a few of us going off in a direction the rest of the community disagree with.

@stdweird
Copy link
Member Author

@ned21 anything in particular you want to see in the demo? i could try to arrange access to one of our systems, we are running this already.
but i agree we should discuss (and hopefully agree) on the way forward at the next workshop.

@ned21
Copy link
Contributor

ned21 commented Jan 11, 2016

@stdweird - an example of what works right now would be good, along with mock ups of anything you envision for the future. That should provide some good fuel for either violent agreement or polite debate. :-)

@jrha
Copy link
Member

jrha commented Jan 14, 2016

If this needs to be discussed at the next workshop, it won't be ready for 16.2?

@bmcann
Copy link

bmcann commented Mar 23, 2016

As an aside, would it be worth adding some functionality whereby the component first compares the file on the host with the profile that is one number less than the current profile number before making changes to the file? If a difference is found, it could log a warning that the file may have been modified by something other than quattor.

We occasionally have a problem at RAL were a person modifies by hand a file that is under quattor control and gets upset when their changes get overwritten by quattor. Whilst this behaviour is against our policy, it does happen and it would be nice to have a stick to use against these people.

@stdweird
Copy link
Member Author

@brunocanning can you open an issue for that feature?

@jrha
Copy link
Member

jrha commented Apr 11, 2016

@stdweird rebase?

@jrha
Copy link
Member

jrha commented Apr 11, 2016

@brunocanning please reference this PR when you open the issue.

@jrha
Copy link
Member

jrha commented Apr 19, 2016

@stdweird poke

@stdweird
Copy link
Member Author

@jrha rebased. this is safe to merge, because it doesn't do much on its own (as ooposed to the chatty LC pr)

@jrha
Copy link
Member

jrha commented Apr 19, 2016

Weird, Github is still telling me this is out of date, but that I can merge anyway... have they changed something again?

@stdweird
Copy link
Member Author

@jrha :rebased_on_master:

@jrha
Copy link
Member

jrha commented Apr 19, 2016

😀

@jrha jrha merged commit 2474394 into quattor:master Apr 19, 2016
@stdweird stdweird mentioned this pull request Apr 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

5 participants