Log of cluster/swarm operations

Ok so I would like to again start work on the next phase toward something like this:

But not necessarily via shell if that’s not the best way. My thoughts are to have some design where a designated node (and only that node) was in charge of gathering the data of all the file/folder CRUD entries and place them in a simple text/log file on one system. That’s it, nothing fancier (that could break). And then if the user wanted to, could place that file in a share directory to sync it out to other nodes on the network so they would know where changes are happening from any node (with slight scanning interval delay if they’re not checking from the “master” node of course).

The only gotcha I see here is some code might be needed to tell the “master” node to not record his changes made to THAT file he is writing to so that we don’t have a recursive problem. Or maybe just placing it in the ignore list (I’m trying to KISS so reusing existing functionality would be best I think).

Jakob: Going back to this comment in this PR on May 13th:

I’m thinking API might be the easiest way to gather this info from all other online nodes. But you have that event ignored from some reason. I’m guessing you think that many thousands of adds/deletes will kill the API service?

What do you think is the best way to design this?

Not necessarily kill the API service, I’m sure it can keep up, but it can be thousands of events per second and there’s no need to burden the UI and browser with this info today.

Ok so that still leaves us with the question of: how best should we inform the designated recorder node that “computer so-and-so has just added/deleted/changed file x” so he can record it?

And since we’re ruling out having him go fetch via API of the other nodes, should I try putting a field in the protocol.fileinfo schema called “ModifiedBy” or something? So that, every version increment, whoever made the change could put their name on it. And the receivers of the change either could use that info or ignore it, but wouldn’t ever modify it unless/until they performed a modification to that file also? At which point the global version increments again and they clobber/replace the last name with their name now.

I’m guessing in this way the recorder node could read all the ModifiedBy tags as he gets updates and write them to a global log of “Whodunit”.

I wasn’t ruling that out, merely answering why it’s not sent on the current event channel. You could add a new API endpoint for these events and use that for logging, for example.

PR 3626