Project

General

Profile

Actions

Defect #3037

closed

Business role breaks referential integrity and all task are in state wainting

Added by Ondřej Kopr over 2 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
High
Assignee:
Tomáš Doischer
Category:
Roles
Target version:
Start date:
01/14/2022
Due date:
% Done:

100%

Estimated time:
Affected versions:
Owner:

Description

Use case:
  • customer add new business role,
  • while new business is added to new user administrator same execute delete on same business role,
  • this behavior break (sometimes) referential integrity.

After this every operation on affected user violates error event or error role request etc.

Main issue with this behavior is that all task that execute any operation on affected user will be mark with "waiting" state. But all task waits on error events or etc.

Every another task that will be executed after is exceeded number of thread will be marked with state "created".

Please see images (sorry for czech language). Feel free to write us with all another questions and analyze.


Files

running.png (151 KB) running.png Ondřej Kopr, 01/14/2022 12:23 PM
created.png (204 KB) created.png Ondřej Kopr, 01/14/2022 12:23 PM
wait.png (169 KB) wait.png Ondřej Kopr, 01/14/2022 12:23 PM
Actions #1

Updated by Peter Štrunc about 2 years ago

  • Target version set to 12.2.0
Actions #2

Updated by Ondřej Kopr about 2 years ago

  • Priority changed from Normal to High

Still appears :( and more often than before

For workaround exists only one solutions. Remove all broken records from db manually:

select * from idm_identity_role ir where ir.role_composition_id is not null and not exists (select * from idm_role_composition rc where rc.id = ir.role_composition_id);
select * from acc_identity_account ia where ia.identity_role_id is not null and not exists (select * from idm_identity_role ir where ir.id = ia.identity_role_id);
select * from idm_identity_role ir where ir.direct_role_id is not null and not exists (select * from idm_identity_role ir2 where ir.direct_role_id = ir2.id)
Actions #4

Updated by Tomáš Doischer about 2 years ago

  • Assignee changed from Roman Kučera to Tomáš Doischer
Actions #5

Updated by Tomáš Doischer about 2 years ago

  • Status changed from New to Needs feedback
  • Assignee changed from Tomáš Doischer to Roman Kučera
  • % Done changed from 0 to 100

The solution is the same as the one working in ProcessAutomaticRoleByAttributeTaskExecutor. Even if the create task is waiting, we cannot start the removal. I tested it and it works well.

PR: https://github.com/bcvsolutions/CzechIdMng/pull/196

@kucerar, can you please give me feedback?

Actions #6

Updated by Roman Kučera about 2 years ago

  • Status changed from Needs feedback to Resolved
  • Assignee changed from Roman Kučera to Tomáš Doischer

Thx, merged into develop

Actions #7

Updated by Tomáš Doischer almost 2 years ago

We also need to add this fix to 11.2.6.

PR: https://github.com/bcvsolutions/CzechIdMng/pull/214

@kucerar, can you take a look, please?

Actions #8

Updated by Roman Kučera almost 2 years ago

Thx, merged to hotfix branch

Actions #9

Updated by Roman Kučera almost 2 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF