Bug 51199 - Speed up ExamUser deletion
Speed up ExamUser deletion
Status: CLOSED FIXED
Product: UCS@school
Classification: Unclassified
Component: UMC - Exam mode
UCS@school 4.4
Other Linux
: P5 normal (vote)
: UCS@school 4.4 v5-errata
Assigned To: Daniel Tröder
Sönke Schwardt-Krummrich
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2020-05-02 03:53 CEST by Daniel Tröder
Modified: 2020-05-05 19:26 CEST (History)
1 user (show)

See Also:
What kind of report is it?: Feature Request
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?: Yes
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2020042221000437
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Tröder univentionstaff 2020-05-02 03:53:33 CEST
Deleting ExamUser objects after an exam can take a few minutes.
The reason is, that the users have to be removed from various big groups ("Domain Users $OU" and "schueler-$OU").
If users are members of multiple schools, then the time required to delete a user rises linearly.

Remove all users of an exam from their groups (except the primary group) with one modification per group, before deleting the users one by one.
Comment 1 Daniel Tröder univentionstaff 2020-05-02 04:04:35 CEST
The solution required the use of the exam role in User.ucsschool_role. This is the case since Bug #50819.
If an ExamUser is to be removed - and is participating in only 1 exam - it is removed from its additional groups in one modification together with all other ExanStudents of the ended exam.

In tests this has reduced the time to finish an exam from 167s to 28s.

[4.4] 51ef11b20 Bug #51199: reduce ExamUser deletion time by removing them all at once from their additional groups
[4.4] c666e92f3 Bug #51199: improve logging
[4.4] 79549884a Bug #51199: advisory update

ucs-school-umc-exam (9.0.1-39)
Comment 2 Daniel Tröder univentionstaff 2020-05-04 22:26:39 CEST
The situation of a not-yet-updated DC master, missing the new UMC function call is now handled safely.
Additionally the information on the progress bar was improved to give users a better estimate on the remaining work when starting and stopping an exam.

Thanks for the patch adding source code documentation and better function names.

[4.4] 8c78f501f Bug #51199: add docs / renamed UMCP command+method
[4.4] e4ca00dc9 Bug #51199: fix UMC function name
[4.4] 6b22eaf69 Bug #51199: safely handle not-yet-updated master missing new UMC function
[4.4] 500ec73f5 Bug #51199: improve user-visible progress report
[4.4] a0504dff1 Bug #51199: changelog
[4.4] ce2fd86d7 Bug #51199: advisory update

ucs-school-umc-exam (9.0.1-40)
Comment 3 Sönke Schwardt-Krummrich univentionstaff 2020-05-05 15:59:34 CEST
OK: code change
OK: installation
OK: update
--: ucs-test
OK: changelog entry
OK: advisory
OK: functional change
OK: package built and installable

Tested manually on a DC slave with 
- master with outdated exam packages 
  → OK → warning is printed to log file
- master with uptodate exam packages
  → OK → group memberships are removed prior to exam user deletion
Comment 4 Daniel Tröder univentionstaff 2020-05-05 19:26:14 CEST
Has been published as errata to UCS@school 4.4 v5.