Done
Pinned fields
Click on the next to a field label to start pinning.
Details
Details
Assignee
Paulina Buzderewicz
Paulina BuzderewiczReporter
Paweł Gesek
Paweł GesekLabels
Story Points
8
Original estimate
1w
Time tracking
Sprint
None
Fix versions
Priority
Time Assistant
Time Assistant
Created August 26, 2017 at 8:59 AM
Updated October 30, 2018 at 4:44 AM
Resolved September 6, 2018 at 2:44 PM
While https://openlmis.atlassian.net/browse/OLMIS-2534#icft=OLMIS-2534 made some improvements to the initialization of Javers tables, we should still consider making further improvements to make our startup time better.
Currently the log initializer retrieves all objects (for example requisitions) and iterates over them, initializing the audit log for the entries that do not have it (in a paginated manner):
https://github.com/OpenLMIS/openlmis-requisition/blob/master/src/main/java/org/openlmis/AuditLogInitializer.java
We should avoid iterating over hundreds of thousands of items during startup. There a few ways we can do this:
figure out a way to fetch only the items that do not have audit history. From my understanding it's not trivial, that's why it was not implemented - but please make sure you try to figure out a way, this is the cleanest solution possible.
consider using spring profiles to enable/disable this process
a date based mechanism, that uses timestamps to figure out the newly added items
possibly others
In any case, the acceptance criteria is:
Services do not iterate over all records for auditable tables at startup
Auditable records inserted by demo data or directly into the database will still have their audit logs initialized properly upon startup
Before starting implementation, suggest a solution on the mailing list