Actions
Task #6121
closedTask #6116: EPIC: Speed up the stats updater daemon (scripts/workflow/update_stats.sh)
Make raw IIKO request/response logging to iiko_requests opt-in
Status:
Resolved
Priority:
High
Assignee:
-
Start date:
08/26/2026
Due date:
% Done:
100%
Estimated time:
Description
Problem¶
Every IIKO call persists its full request and response payload to iiko_requests, as two separate DB round-trips — an INSERT before the call and an UPDATE after:
-
IikoOlapV2RequestsFetchingService.fetchOlapData—iikoRequestsService.saveline 39,updateline 53 (and again at 62 on parse failure) -
DepartmentsFetchingService.fetchDepartments,IikoServerEmployeesFetchingService.fetchEmployees— same pattern
At the current request volume this is write amplification on the hot path plus unbounded table growth: the table accumulates a full copy of every OLAP report body the daemon has ever downloaded, round after round.
Proposed change¶
- Put raw request/response capture behind a config flag (e.g.
iiko.server.log-raw-requests, defaultfalse). - With the flag off, still record failures — a row written only when the call errors or the response fails to parse, which is when the payload is actually worth having.
- Add a retention job (or a documented cleanup) for rows older than N days.
Acceptance¶
- Default configuration performs no
iiko_requestswrites on a successful call. - Failures still land a row with url, request, response, error and trace.
- Enabling the flag restores today's behaviour for debugging.
Actions