Actions
Task #3101
openLogging events are generated with low IDs, possible collision
Status:
New
Priority:
Normal
Assignee:
Roman Kučera
Category:
Logging
Target version:
-
Start date:
04/07/2022
Due date:
% Done:
0%
Estimated time:
Owner:
Description
After upgrading to the version 12.1, the IDs in Audit -> Logging events started to be created with different (lower) IDs:
Consequences:
Consequences:
- when we first come to the page, we don't see the newest logging messages. We see older messages created before the upgrade.
- there would be a possible collision if the new IDs' sequence met the original IDs' sequence. (It depends, however, how quickly new logging events are generated, because older logging events are removed by RemoveOldLogsTaskExecutor after 90 days by default.)
Currently, the IDs' are generated from the same sequence as the IDs for Audit, i.e. hibernate_sequence. Originally, the sequence logging_event_id_seq was used.
Please, ensure that the collision wouldn't happen, either by Changelog, or Flyway script, or some different way.
Files
Related issues
Updated by Alena Peterová about 2 years ago
- Related to Task #3036: Upgrade logback to 1.2.10 added
Updated by Alena Peterová about 2 years ago
One possible solution/workaround: setting the hibernate sequence to high enough number:
setval('hibernate_sequence', ( select max(maximum) from ( SELECT max(id)+1 as maximum FROM idm_audit union all select max(event_id) + 1 as maximum from logging_event ) s ), FALSE);
(this worked in our project)
OR
SELECT setval('logging_event_id_seq', (select max(event_id) + 1 from logging_event), FALSE);
(this worked for Peter)
TODO to be investigated further
Second possible solution (applicable depending on the company policy for storing logs):
Just delete all older logging events by RemoveOldLogsTaskExecutor
Actions