grouper-dev - Re: [grouper-dev] Bad Membership Finder Utility .... Was: ( [grouper-users] Composite group problems)
Subject: Grouper Developers Forum
List archive
Re: [grouper-dev] Bad Membership Finder Utility .... Was: ( [grouper-users] Composite group problems)
Chronological Thread
- From: Shilen Patel <>
- To: "Black, Carey M." <>, "" <>
- Subject: Re: [grouper-dev] Bad Membership Finder Utility .... Was: ( [grouper-users] Composite group problems)
- Date: Fri, 20 Oct 2017 19:11:41 +0000
- Accept-language: en-US
- Authentication-results: oit.duke.edu; spf=none
- Ironport-phdr: 9a23:RIHOThWsaM8xKBKWT8CzukrwoR7V8LGtZVwlr6E/grcLSJyIuqrYbRWPt8tkgFKBZ4jH8fUM07OQ6PGwHzRYqb+681k6OKRWUBEEjchE1ycBO+WiTXPBEfjxciYhF95DXlI2t1uyMExSBdqsLwaK+i764jEdAAjwOhRoLerpBIHSk9631+ev8JHPfglEnjSwbLdxIRmssQndqtQdjJd/JKo21hbHuGZDdf5MxWNvK1KTnhL86dm18ZV+7SleuO8v+tBZX6nicKs2UbJXDDI9M2Ao/8LrrgXMTRGO5nQHTGoblAdDDhXf4xH7WpfxtTb6tvZ41SKHM8D6Uaw4VDK/5KpwVhTmlDkIOCI48GHPi8x/kqRboA66pxdix4LYeZyZOOZicq/Ye94RWGhPUdtLVyFZAo2ycZYBD/YPM+hboYnypVoOogexCgS3Huzj1iNEi2Xq0aEm0+ksFxzN0gw6H9IJtXTZtMj7NKcTUeCx0qbIyyjIYelM1jfh9ofIdg0qrPaXXbJwcMrRzVcgFwXeg1qNtIzlPC2a2v4TvGeG8uptTOSigHMkpQFpujWj28chhpfTio8b0FzI6CZ0zYIvKdGmR0N3fMaoHIVRui2GN4Z7R9ktTmB0tConz7ALuoK3cScXxJkiyRPfZeCLf5SN7x79SOqcIzl1iXdrdb2hhhu/8U2tx+n/W8ao1FtHqzFKn9vPu30OzxDf9NWLR/pn8kqvxzqDzR3f5+JZLUwuiKbWKIItz7gtnZQJq0vDBDX5mEDuga+WaEok/u+o5vziYrr8p5+cM5Z4ig7wM6g3h8CyAf40Mg8PX2iH4+izyaDj/U7nT7lQkPI5j7TZvIjbJcQduKG5HxdY3psj5hqhFTur3s4UkWQEIV9BYh6LkYfkN0zWLPD9F/i/glCskDlxx/DBO73sGo7NLnjCkLflY7l97VVRxxcuzdBc+Z1YEK8OL+/uWkPprtzXEgc5MxCow+bgENh92ZkeWWWSAq+BLqzSq0aE6f8xLOmSf4IVvDf9K+M55/71k3M1g14dfa+13ZQJcnC4GOppI1mHbXb2nNgODHoK7UICS7mgolmLWj0XL127Ra8trhR9QsryB4PKTYPr2eba9CCgA9tban0QThjGHm3vap2JQbIAZTy6I8l9nyYCWKT7DYItyFvm4ADgzKd/I/CR9iAGnZPlyNVv4eDPz1c/+SEiXOqH1GTYdGF1mm4ODwc/wK176RhmylaH3K5Qj+FbGJpe6+4fAVRyDoLV0+EvU4O6YQnGZNrcDQ/+Gtg=
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
Yeah we talked about doing locking before but I think avoided it due to the costs. We also talked about having checks either on post commit or a change log consumer. At the time we discussed it last, we decided a daemon would be an easy/good enough fix
for now. But I think a better fix is worth considering. I'm also going to look at the code and especially the loader (where these issues are presumably most happening) to see if there's a better approach.
- Shilen
Sent from my Verizon, Samsung Galaxy smartphone
-------- Original message --------
From: "Black, Carey M." <>
Date: 10/20/17 2:58 PM (GMT-05:00)
To:
Subject: [grouper-dev] Bad Membership Finder Utility .... Was: ( [grouper-users] Composite group problems)
Shilen ( et. al.) ,
I suspect that this condition is barely understood about the inner workings of the system by most deployers and/or users. Giving the AM ( Access Management ) team control over the promptness of the “fully effective By” window would be a very powerful tool/control that Grouper could assert. ( Or at least knowledge of when the changes are fully verified/effective in Grouper.)
I remember reading about the Bad Membership Finder Utility and thinking: “What??!?!? Why?? Can that not be done on any membership change? So that the “invalid state” for the composites is avoided all together?” Then I wandered off to other things, and have only bumped into the though a few times sense. (and every time decided “I don’t have time to think about it right now.” And wandered off again.)
Well here are some more thoughts on the implementation details:
I think I see some of the complexities here, but I doubt that I see all of them. The graph of dependencies for all of the composite groups seems knowable. (Possibly changing as a result of the change too. ) When any one of those dependencies are changed (for a given subject/group) it seems possible to walk/correct the affected parts of the graphs. ( in line, or at least triggering an event to config/fix as needed.) And since circular membership loops are possible it gets a bit more well…. Interesting…. to know where to start and stop some of these things too. :^/ Which is why the process is run repeatedly till it does not make changes. (Inferring that the dependency graph may not be used to optimize the path of changes, or the solution may not be done in a way that “pushes multiple peer changes” in a “top down” kind of flow.)
You alluded to a possible race condition in the system too. ( in the thread below. ) So apparently the backend does not do “locking” in a way to deal with overlapping dependency tree changes in a full ACID compliance way. ( no doubt complicated by the “circular membership loops” ) Likely trying to avoid DB thread deadlocks… ok… but…. Maybe, in some cases, that blocking would actually be desired by the users/system?
So, in this non-blocking model, with an attempt to not “thrash the system” and make every save take minutes, I could see the idea of stacking up a queue (change log consumer?) to process these checks/corrections in a timely ( a few minutes, < 2 ? , < 5 ? ) manor. But maybe that “acceptable delay” should be a property of the composite and/or the groups that are involved? I could imagine some cases were you always want: ) change in “this special group” to be 100% completed “NOW”. ( Global Exclude groups, or just “important” Exclude groups, etc… And maybe even in some “include groups” too.) ) While other groups may be ok to be “loosely consistent”. ( “Provision that group in the next hour and no harm done. “ ) Especially when in the context of Access Control Policies and/or Provisioning/DE provisioning. So maybe membership changes also needs to force (queue/call) Prov/DeProv processes too?
I doubt all of that would be easy to do. ( In fact, I think most of it would be fairly hard to implement without potentially causing other issues.)
But does the core idea of making this “loosely consistent model tunable by the users” make sense to anyone else?
-- Carey Matthew
From: [mailto:]
On Behalf Of Shilen Patel
That could have happened if you have composites that are factors of other composites. There may be other reasons too though. FWIW, the daemon in 2.3 is designed to take that into account and runs multiple times until all the issues are corrected.
- Shilen
Sent from my Verizon, Samsung Galaxy smartphone
-------- Original message -------- From: Dave Churchley <> Date: 10/20/17 10:12 AM (GMT-05:00) To: Shilen Patel <> Cc: Subject: RE: [grouper-users] Composite group problems
Yes, that makes sense. I’ve now scheduled the Bad Membership Finder Utility to run each morning, just after the Grouper loader groups are populated.
One more question, if you don’t mind, do you know why it took four goes to fix all the bad memberships this morning? Each time I ran it, it fixed the majority that it had found, but not all of them.
Thanks
From:
[]
On Behalf Of Shilen Patel
OK cool. The scenario you described is a similar situation where you probably have two threads running at the same time that deleted and added the user from/to the groups under Group B. The thread that deleted the user from the group under B would have thought the user wasn't an effective member of B anymore and would have deleted the user from A. Meanwhile the thread that added the user to the group under B would have seen that the user is already in A (since the other transaction may not have committed yet) and therefore wouldn't have done anything else. Does that at least explain the issue? We created the bad membership daemon in 2.3 because of this issue but we may need to handle it better.
Thanks!
- Shilen
Sent from my Verizon, Samsung Galaxy smartphone
-------- Original message -------- From: Dave Churchley <> Date: 10/20/17 1:28 AM (GMT-08:00) To: Shilen Patel <> Cc: Subject: RE: [grouper-users] Composite group problems
Thanks again Shilen
The Bad Membership Finder Utility cleaned up 118 bad memberships this morning. (I had to run it four times though until it found no membership errors.) I’m sure this utility will be useful to us!
I don’t know if you’re able to explain why the composite group memberships go wrong as in the example below?
Thanks
From:
[]
On Behalf Of Dave Churchley
Thanks Shilen, I'll take a look at that in the morning.
For at least one of the problem groups, however, this is definitely not the issue. Group A is made up of Group B complement Group C. Person X was in B and not C and so he rightly appeared in A. Two days ago he dropped out of A but he remained in B and not in C. Those groups' memberships hadn't changed. We did notice that Group B was built from several Grouper loader groups and Person X had moved from one of them into another, but this meant that he was still a member of B.
I hope I've managed to explain that!
Thanks Dave
From: Shilen Patel <>
If both factors in the composite are being updated at about the same time for the same subject, then a membership may be missed. For example, if Group A is an intersection
of Group B and Group C and you add the same person to B and C at almost the same time, then due to the way the database transactions work, the composite membership may not be added to Group A. Does that seem like the problem you’re having? |
- [grouper-dev] Bad Membership Finder Utility .... Was: ( [grouper-users] Composite group problems), Black, Carey M., 10/20/2017
- Re: [grouper-dev] Bad Membership Finder Utility .... Was: ( [grouper-users] Composite group problems), Shilen Patel, 10/20/2017
- [grouper-dev] RE: Bad Membership Finder Utility .... Was: ( [grouper-users] Composite group problems), Hyzer, Chris, 10/23/2017
- [grouper-dev] RE: Bad Membership Finder Utility .... Was: ( [grouper-users] Composite group problems), Black, Carey M., 10/23/2017
Archive powered by MHonArc 2.6.19.