Task #1464
closedRecalculation of time slices - temporary removed automatic roles
100%
Description
Version: 9.3.3 with projspec hotfixes (attached)
User has valid contract. It was split to several slices using past date, but the contract is still valid. But the automatic roles by organization were temporary removed during the recalculation at night.
Before synchronization, there were 2 slices. The synchronization created 2 new slices, the last of them is the new currently used slice:
The synchronization of slices was reconcilation, it updated all slices in IdM.
After that, ClearDirtyStateForContractSliceTaskExecutor handled all slices.
After that SelectCurrentContractSliceTaskExecutor run for 11 minutes, the count is 949, but its processed items are empty.
The slices of the user in ClearDirtyStateForContractSliceTaskExecutor were processed from last to newest. The 1-day slice (from 14.01.2019 to 14.01.2019) was processed between 02:06:34 and 02:08:17, during this period the contract was evidently updated from this slice and so the automatic roles were removed (not only made invalid, but really removed). This visible partly from audit log (attached) and partly from the catalina log.
2019-01-22 02:06:35.057 INFO 14022 --- [task-executor-1] e.b.i.c.a.e.AbstractEntityEventProcessor : Processor [contract-slice-save-processor]([core]) end for [CoreEvent [type: UPDATE, content: eu.bcvsolutions.idm.core.api.dto.IdmContractSliceDto [id= e629c115-c598-4883-80fc-2ad288a61734], properties: {}]] with order [0]. 2019-01-22 02:06:35.058 INFO 14022 --- [task-executor-1] e.b.i.c.a.e.AbstractEntityEventProcessor : Processor [chmi-contract-slice-save-recalculate-processor]([chmi]) start for [CoreEvent [type: UPDATE, content: eu.bcvsolutions.idm.core.api.dto.IdmContractSliceDto [id= e629c115-c598-4883-80fc-2ad288a61734], properties: {}]] with order [1]. 2019-01-22 02:06:35.081 INFO 14022 --- [task-executor-1] e.b.i.c.m.s.i.DefaultEntityEventManager : Publishing event [IdentityContractEvent [type: UPDATE, content: eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto [id= 17851d0c-94e0-4887-b9e5-bcc360467283], properties: {}]] 2019-01-22 02:06:35.105 INFO 14022 --- [task-executor-1] e.b.i.c.a.e.AbstractEntityEventProcessor : Processor [identity-contract-before-save-processor]([acc]) start for [IdentityContractEvent [type: UPDATE, content: eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto [id= 17851d0c-94e0-4887-b9e5-bcc360467283], properties: {}]] with order [-1000]. 2019-01-22 02:06:35.106 INFO 14022 --- [task-executor-1] e.b.i.c.a.e.AbstractEntityEventProcessor : Processor [identity-contract-before-save-processor]([acc]) end for [IdentityContractEvent [type: UPDATE, content: eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto [id= 17851d0c-94e0-4887-b9e5-bcc360467283], properties: {}]] with order [-1000]. 2019-01-22 02:06:35.106 INFO 14022 --- [task-executor-1] e.b.i.c.a.e.AbstractEntityEventProcessor : Processor [identity-contract-save-processor]([core]) start for [IdentityContractEvent [type: UPDATE, content: eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto [id= 17851d0c-94e0-4887-b9e5-bcc360467283], properties: {}]] with order [0]. 2019-01-22 02:06:35.140 INFO 14022 --- [task-executor-1] e.b.i.c.a.e.AbstractEntityEventProcessor : Processor [identity-contract-save-processor]([core]) end for [IdentityContractEvent [type: UPDATE, content: eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto [id= 17851d0c-94e0-4887-b9e5-bcc360467283], properties: {}]] with order [0]. 2019-01-22 02:06:35.141 INFO 14022 --- [task-executor-1] e.b.i.c.a.e.AbstractEntityEventProcessor : Processor [core-formable-save-processor]([core]) start for [IdentityContractEvent [type: UPDATE, content: eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto [id= 17851d0c-94e0-4887-b9e5-bcc360467283], properties: {}]] with order [50]. 2019-01-22 02:06:35.141 INFO 14022 --- [task-executor-1] e.b.i.c.a.e.AbstractEntityEventProcessor : Processor [core-formable-save-processor]([core]) end for [IdentityContractEvent [type: UPDATE, content: eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto [id= 17851d0c-94e0-4887-b9e5-bcc360467283], properties: {}]] with order [50]. 2019-01-22 02:06:35.141 INFO 14022 --- [task-executor-1] e.b.i.c.a.e.AbstractEntityEventProcessor : Processor [identity-contract-end-processor]([core]) start for [IdentityContractEvent [type: UPDATE, content: eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto [id= 17851d0c-94e0-4887-b9e5-bcc360467283], properties: {}]] with order [200]. 2019-01-22 02:06:35.147 INFO 14022 --- [task-executor-4] chmuIsAccountDisabled : Start 'chmuIsAccountDisabled' script. 2019-01-22 02:06:35.154 INFO 14022 --- [task-executor-1] i.c.m.e.p.c.IdentityContractEndProcessor : Change identity [*******] state [LEFT] ....... account management etc........ 2019-01-22 02:08:16.738 INFO 14022 --- [task-executor-1] e.b.i.c.a.e.AbstractEntityEventProcessor : Processor [identity-contract-end-processor]([core]) end for [IdentityContractEvent [type: UPDATE, content: eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto [id= 17851d0c-94e0-4887-b9e5-bcc360467283], properties: {}]] with order [200]. 2019-01-22 02:08:16.738 INFO 14022 --- [task-executor-1] e.b.i.c.a.e.AbstractEntityEventProcessor : Processor [identity-contract-publish-change-processor]([core]) start for [IdentityContractEvent [type: UPDATE, content: eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto [id= 17851d0c-94e0-4887-b9e5-bcc360467283], properties: {}]] with order [10000]. 2019-01-22 02:08:16.755 INFO 14022 --- [task-executor-1] e.b.i.c.m.s.i.DefaultEntityEventManager : Publishing event [CoreEvent [type: CREATE, content: eu.bcvsolutions.idm.core.api.dto.IdmEntityEventDto [id= null], properties: {}]] 2019-01-22 02:08:16.755 INFO 14022 --- [task-executor-1] e.b.i.c.a.e.AbstractEntityEventProcessor : Processor [core-entity-generate-values-processor]([core]) start for [CoreEvent [type: CREATE, content: eu.bcvsolutions.idm.core.api.dto.IdmEntityEventDto [id= null], properties: {}]] with order [-100]. 2019-01-22 02:08:16.756 INFO 14022 --- [task-executor-1] e.b.i.c.a.e.AbstractEntityEventProcessor : Processor [core-entity-generate-values-processor]([core]) end for [CoreEvent [type: CREATE, content: eu.bcvsolutions.idm.core.api.dto.IdmEntityEventDto [id= null], properties: {}]] with order [-100]. 2019-01-22 02:08:16.756 INFO 14022 --- [task-executor-1] e.b.i.c.a.e.AbstractEntityEventProcessor : Processor [entity-event-save-processor]([core]) start for [CoreEvent [type: CREATE, content: eu.bcvsolutions.idm.core.api.dto.IdmEntityEventDto [id= null], properties: {}]] with order [0]. 22-Jan-2019 02:08:16.802 INFO [event-task-executor-2] eu.bcvsolutions.idm.connector.jdbc.beanshell.JDBCConnector.init(JDBCConnector.java:131) Connector INIT. 22-Jan-2019 02:08:16.846 INFO [event-task-executor-2] eu.bcvsolutions.idm.connector.jdbc.beanshell.JDBCConnection.startConnection(JDBCConnection.java:94) Connection started for user FRWS 2019-01-22 02:08:16.853 INFO 14022 --- [task-executor-1] e.b.i.c.a.e.AbstractEntityEventProcessor : Processor [entity-event-save-processor]([core]) end for [CoreEvent [type: CREATE, content: eu.bcvsolutions.idm.core.api.dto.IdmEntityEventDto [id= 0e313fa5-a588-444d-af6c-136054982c6b], properties: {}]] with order [0]. 2019-01-22 02:08:16.853 INFO 14022 --- [task-executor-1] e.b.i.c.m.s.i.DefaultEntityEventManager : Event [CoreEvent [type: CREATE, content: eu.bcvsolutions.idm.core.api.dto.IdmEntityEventDto [id= 0e313fa5-a588-444d-af6c-136054982c6b], properties: {}]] is completed 2019-01-22 02:08:16.853 INFO 14022 --- [task-executor-1] e.b.i.c.a.e.AbstractEntityEventProcessor : Processor [identity-contract-publish-change-processor]([core]) end for [IdentityContractEvent [type: UPDATE, content: eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto [id= 17851d0c-94e0-4887-b9e5-bcc360467283], properties: {}]] with order [10000]. 2019-01-22 02:08:16.854 INFO 14022 --- [task-executor-1] e.b.i.c.m.s.i.DefaultEntityEventManager : Event [IdentityContractEvent [type: UPDATE, content: eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto [id= 17851d0c-94e0-4887-b9e5-bcc360467283], properties: {}]] is completed ............. 2019-01-22 02:08:17.516 INFO 14022 --- [task-executor-1] e.b.i.c.a.e.AbstractEntityEventProcessor : Processor [chmi-contract-slice-save-recalculate-processor]([chmi]) end for [CoreEvent [type: UPDATE, content: eu.bcvsolutions.idm.core.api.dto.IdmContractSliceDto [id= e629c115-c598-4883-80fc-2ad288a61734], properties: {}]] with order [1].
Updating of the contract from the slice in the end created event Contract NOTIFY, which has empty content.
The second event was created by processing the newest slice a few seconds after the 1-day slice (02:08:20). This second event probabaly corrected the final state of the automatic roles - thanks to 22.01.2019 02:21:06 core:identity-contract-update-by-automatic-role-processor
Files
Updated by Vít Švanda almost 6 years ago
- Target version set to Onyx (9.3.4)
- % Done changed from 0 to 80
Updated by Vít Švanda almost 6 years ago
I fixed this issues.
I use this solutions:
LRT for recalculation dirty slices is now diveded to 4 steps:
1 - recalculation of slices with valid contracts,
2 - recalculation of slices with future valid contracts,
3 - recalculation of slices with invalid contracts,
4 - recalculation of slices to delete,
For step 4, I had to implemented recalculation for deleted slices. If sync try to delete slice, is that slice marked as dirty. Slice is not deleted in this phase! As last is in LRT for slice recalculation are that slices deleted.
I fixed problem with executing a HR processes during bulk recalculation too.
Tests and release remains.
Commit: https://github.com/bcvsolutions/CzechIdMng/commit/12690dfdecf73f5ea5a28c367e797d49cba8ee3f
Updated by Vít Švanda almost 6 years ago
ChmiContractSliceSaveRecalculateProcessor.java can be deleted is implemented in 9.3.4. EntityEventManager not.
Updated by Vít Švanda almost 6 years ago
- Status changed from In Progress to Needs feedback
- Assignee changed from Vít Švanda to Ondřej Kopr
I created some tests and did some minor fixies.
https://github.com/bcvsolutions/CzechIdMng/commit/6eb54e4b8f9cdf41e1f178a7234e9ff75c44c2b4
Updated by Ondřej Kopr almost 6 years ago
- Status changed from Needs feedback to Resolved
- Assignee changed from Ondřej Kopr to Vít Švanda
- % Done changed from 80 to 100
I made code review seems like little big changes in recalculation of contract slices. Code is awesome. From my code in LRT ClearDirtyStateForContractSliceTaskExecutor stay not kamen on kamen.